1 package com.bull.eclipse.jonas.actions.ejb; 2 3 4 import java.util.Properties ; 5 import java.util.Vector ; 6 7 import com.bull.eclipse.jonas.JonasLauncherPlugin; 8 import com.bull.eclipse.jonas.JonasProject; 9 import com.bull.eclipse.jonas.actions.JonasProjectAbstractActionDelegate; 10 import com.bull.eclipse.jonas.utils.AntUtils; 11 import com.bull.eclipse.jonas.utils.UpdatePropsFile; 12 import com.bull.eclipse.newbean.JopeUpdateBean; 13 14 15 16 public class ExportJarActionDelegate extends JonasProjectAbstractActionDelegate 17 { 18 19 public boolean doActionOn(JonasProject prj) throws Exception { 20 Properties props = new Properties (); 22 props.setProperty("jonas.root", JonasLauncherPlugin.getDefault().getJonasDir()); 23 UpdatePropsFile.updatePropsProject(prj); 24 25 26 String jonasRoot = JonasLauncherPlugin.getDefault().getJonasDir(); 27 Vector pkgListe = prj.getPackageProjectFolder(); 28 if (pkgListe == null) { 29 throw new Exception ("There is no EJB"); 30 } else if (pkgListe.isEmpty()) { 31 throw new Exception ("There is no EJB"); 32 } 33 JopeUpdateBean jub = new JopeUpdateBean(pkgListe,prj); 34 jub.generate(); 35 36 AntUtils.runAnt(prj.getProject().getFullPath().append(prj.getSrcEJBDir()).append("/build.xml").toOSString()); 37 38 46 47 return false; 48 } 49 50 51 55 public static String [] concat( String [] s1, String s2, String s3 ) 56 { 57 String [] full = new String [ s1.length + 2 ]; 58 System.arraycopy( s1, 0, full, 0, s1.length ); 59 full[ full.length-2 ] = s2; 60 full[ full.length-1 ] = s3; 61 return full; 62 } 63 64 68 public static String [] concat( String [] s1, String s2 ) 69 { 70 String [] full = new String [ s1.length + 1 ]; 71 System.arraycopy( s1, 0, full, 0, s1.length ); 72 full[ full.length-1 ] = s2; 73 return full; 74 } 75 76 } 77 78 | Popular Tags |