1 9 10 package org.enhydra.jawe.actions; 11 12 import org.enhydra.jawe.*; 13 import org.enhydra.jawe.xml.*; 14 import org.enhydra.jawe.xml.panels.*; 15 16 import javax.swing.*; 17 import java.util.*; 18 import java.awt.event.ActionEvent ; 19 20 21 24 public class ExternalPackages extends ActionBase { 25 26 public ExternalPackages (PackageEditor editor) { 27 super(editor); 28 } 29 30 public void actionPerformed(ActionEvent e) { 31 PackageEditor pe=(PackageEditor)editor; 32 if (!pe.isInitialized()) { 33 pe.enterPackageID(); 34 } 35 if (JaWE.getInstance().getFilename()==null) { 36 String msg=ResourceManager.getLanguageDependentString( 37 "InformationFileNeedToBeSavedBeforeAddingExternalPackages"); 38 JaWE.getInstance().message(msg,JOptionPane.INFORMATION_MESSAGE); 39 return; 40 } 41 XMLPanel p=pe.getXMLPackage().getPanel(4); 42 43 XMLElementDialog d=new XMLElementDialog((JFrame)pe.getWindow(), 44 ResourceManager.getLanguageDependentString("PackageKey")+" '"+ 45 pe.getXMLPackage().get("Id").toString()+"' - "+ 46 ResourceManager.getLanguageDependentString("ExternalPackagesKey")); 47 Set pre=new HashSet(JaWE.getInstance().getXMLInterface().getAllPackageIds()); 48 d.editXMLElement(p,false,false); 49 Set post=new HashSet(JaWE.getInstance().getXMLInterface().getAllPackageIds()); 50 post.removeAll(pre); 52 Iterator it=post.iterator(); 53 while (it.hasNext()) { 54 pe.createGraphForPackage(JaWE.getInstance().getXMLInterface().getPackageById((String )it.next()),true); 55 } 56 } 57 } 58 | Popular Tags |