1 9 10 package org.enhydra.jawe.actions; 11 12 import org.enhydra.jawe.*; 13 14 import java.awt.event.ActionEvent ; 15 16 17 20 public class New extends ActionBase { 21 22 public New (PackageEditor editor) { 23 super(editor); 24 } 25 26 public void actionPerformed(ActionEvent e) { 27 if (JaWE.getInstance().close()) { 28 openNewPackage(); 29 PackageEditor pe=(PackageEditor)editor; 30 if (!pe.isInitialized()) { 31 pe.enterPackageID(); 32 } 33 pe.update(); 34 } 35 } 36 37 public static void openNewPackage () { 38 PackageEditor pe=JaWE.getInstance().getPackageEditor(); 39 if (JaWE.getInstance().getRealXMLPackage()!=null) { 40 pe.displayPackage(JaWE.getInstance().getRealXMLPackage()); 41 } 42 org.enhydra.jawe.xml.elements.Package pkg= 43 JaWE.getInstance().openDocument(null,true,false); 44 pe.setNewPackage(pkg,true); 45 } 46 47 } 48 | Popular Tags |