X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2FFrameworkWizardUI.java;h=ec826817da5bb652eec8e6cd76e1a5eecde8a2bc;hp=2b6b25f9bef3fc5a163a14690e5bb23d8a034167;hb=dbf5dd75da639461456ce96ea48c0f73a1d071cc;hpb=ed1665f26835816c3ef05ef5eadd30bff1ec4829 diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java index 2b6b25f9be..ec826817da 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java @@ -17,7 +17,6 @@ package org.tianocore.frameworkwizard; import java.awt.event.ActionEvent; import java.awt.event.ComponentEvent; -import java.awt.event.ComponentListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.WindowEvent; @@ -44,22 +43,18 @@ import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; import org.apache.xmlbeans.XmlException; -import org.tianocore.ModuleSurfaceAreaDocument; import org.tianocore.PackageSurfaceAreaDocument; -import org.tianocore.PlatformSurfaceAreaDocument; import org.tianocore.frameworkwizard.common.DataType; +import org.tianocore.frameworkwizard.common.GlobalData; import org.tianocore.frameworkwizard.common.IFileFilter; import org.tianocore.frameworkwizard.common.Log; -import org.tianocore.frameworkwizard.common.OpenFile; import org.tianocore.frameworkwizard.common.SaveFile; import org.tianocore.frameworkwizard.common.Tools; import org.tianocore.frameworkwizard.common.Identifications.Identification; -import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleList; import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType; -import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageList; import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType; -import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformList; import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType; +//import org.tianocore.frameworkwizard.common.find.FindPPIsResult; import org.tianocore.frameworkwizard.common.ui.IDefaultMutableTreeNode; import org.tianocore.frameworkwizard.common.ui.IDesktopManager; import org.tianocore.frameworkwizard.common.ui.IFrame; @@ -71,7 +66,6 @@ import org.tianocore.frameworkwizard.far.updateui.UpdateStepOne; import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; import org.tianocore.frameworkwizard.module.ui.ModuleBootModes; import org.tianocore.frameworkwizard.module.ui.ModuleDataHubs; -import org.tianocore.frameworkwizard.module.ui.ModuleDefinitions; import org.tianocore.frameworkwizard.module.ui.ModuleEvents; import org.tianocore.frameworkwizard.module.ui.ModuleExterns; import org.tianocore.frameworkwizard.module.ui.ModuleGuids; @@ -91,7 +85,6 @@ import org.tianocore.frameworkwizard.packaging.ui.SpdGuidDecls; import org.tianocore.frameworkwizard.packaging.ui.SpdHeader; import org.tianocore.frameworkwizard.packaging.ui.SpdLibClassDecls; import org.tianocore.frameworkwizard.packaging.ui.SpdMsaFiles; -import org.tianocore.frameworkwizard.packaging.ui.SpdPackageDefinitions; import org.tianocore.frameworkwizard.packaging.ui.SpdPackageHeaders; import org.tianocore.frameworkwizard.packaging.ui.SpdPcdDefs; import org.tianocore.frameworkwizard.packaging.ui.SpdPpiDecls; @@ -106,40 +99,31 @@ import org.tianocore.frameworkwizard.platform.ui.FpdPlatformDefs; import org.tianocore.frameworkwizard.workspace.Workspace; import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.ui.SwitchWorkspace; +import org.tianocore.frameworkwizard.toolchain.Preferences; /** - The class is used to show main GUI of ModuleEditor - It extends IFrame implements MouseListener, TreeSelectionListener + The class is used to show main GUI of FrameworkWizard + It extends IFrame implements MouseListener, TreeSelectionListener, ComponentListener and MenuListener **/ -public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSelectionListener, ComponentListener, - MenuListener { +public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSelectionListener, MenuListener { /// /// Define class Serial Version UID /// private static final long serialVersionUID = -7103240960573031772L; - // - // To save information of all files - // - private Vector vModuleList = new Vector(); - - private Vector vPackageList = new Vector(); - - private Vector vPlatformList = new Vector(); - - private OpeningModuleList openingModuleList = new OpeningModuleList(); - - private OpeningPackageList openingPackageList = new OpeningPackageList(); - - private OpeningPlatformList openingPlatformList = new OpeningPlatformList(); - + /// + /// Used to record current operation target + /// private int currentOpeningModuleIndex = -1; private int currentOpeningPackageIndex = -1; private int currentOpeningPlatformIndex = -1; + /// + /// Used to generate tree structure + /// private IDefaultMutableTreeNode dmtnRoot = null; private IDefaultMutableTreeNode dmtnModuleDescription = null; @@ -148,6 +132,9 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele private IDefaultMutableTreeNode dmtnPlatformDescription = null; + /// + /// Used for UI + /// private JPanel jContentPane = null; private JMenuBar jMenuBar = null; @@ -230,8 +217,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele private JMenuItem jMenuItemEditSelectAll = null; - private JMenuItem jMenuItemEditFind = null; - private JMenuItem jMenuItemEditFindNext = null; private JMenu jMenuView = null; @@ -254,11 +239,11 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele private JMenuItem jMenuItemProjectChangeWorkspace = null; - private JMenu jMenuProjectBuildTargets = null; + private JMenuItem jMenuItemToolsBuildPreferences = null; - private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsDebug = null; +// private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsDebug = null; - private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsRelease = null; +// private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsRelease = null; private JMenuItem jMenuItemToolsToolChainConfiguration = null; @@ -292,16 +277,33 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele private JMenuItem jMenuItemProjectRemoveFar = null; - //private JToolBar jToolBarFile = null; + private JMenuItem jMenuItemProjectCreateFar = null; + + private JMenu jMenuEditFind = null; - //private JToolBar jToolBarEdit = null; + private JMenuItem jMenuItemEditFindPcd = null; - //private JToolBar jToolBarWindow = null; + private JMenuItem jMenuItemEditFindLibraryClass = null; - private static FrameworkWizardUI fwui = null; + private JMenuItem jMenuItemEditFindPpi = null; - private JMenuItem jMenuItemProjectCreateFar = null; + private JMenuItem jMenuItemEditFindProtocol = null; + + private JMenuItem jMenuItemEditFindGuid = null; + + private JMenuItem jMenuItemEditFindLibraryInstance = null; + + /// + /// A static definition for this class itself + /// + private static FrameworkWizardUI fwui = null; + /** + If the class hasn't an instnace, new one. + + @return FrameworkWizardUI The instance of this class + + **/ public static FrameworkWizardUI getInstance() { if (fwui == null) { fwui = new FrameworkWizardUI(); @@ -351,7 +353,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JTabbedPane - */ + **/ private JTabbedPane getJTabbedPaneEditor() { if (jTabbedPaneEditor == null) { jTabbedPaneEditor = new JTabbedPane(); @@ -363,7 +365,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele .setMinimumSize(new java.awt.Dimension( DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH, DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT)); - //jTabbedPaneEditor.addChangeListener(this); jTabbedPaneEditor.addTab("Module", null, getJDesktopPaneModule(), null); jTabbedPaneEditor.addTab("Package", null, getJDesktopPanePackage(), null); jTabbedPaneEditor.addTab("Platform", null, getJDesktopPanePlatform(), null); @@ -376,7 +377,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JTabbedPane - */ + **/ private JTabbedPane getJTabbedPaneTree() { if (jTabbedPaneTree == null) { jTabbedPaneTree = new JTabbedPane(); @@ -400,29 +401,35 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private JMenu getJMenuFile() { if (jMenuFile == null) { + // + // Set jMenuFile's attributes + // jMenuFile = new JMenu(); jMenuFile.setText("File"); jMenuFile.setMnemonic('F'); + jMenuFile.addMenuListener(this); + + // + // Add sub menu items + // jMenuFile.add(getJMenuItemFileNew()); jMenuFile.add(getJMenuItemFileOpen()); jMenuFile.add(getJMenuItemFileClose()); jMenuFile.add(getJMenuItemFileCloseAll()); jMenuFile.addSeparator(); + jMenuFile.add(getJMenuFileRecentFiles()); - //jMenuFile.addSeparator(); jMenuFile.add(getJMenuItemFileSave()); jMenuFile.add(getJMenuItemFileSaveAs()); jMenuFile.add(getJMenuItemFileSaveAll()); jMenuFile.addSeparator(); + jMenuFile.add(getJMenuItemFilePageSetup()); jMenuFile.add(getJMenuItemFilePrint()); - //jMenuFile.addSeparator(); jMenuFile.add(getJMenuItemFileImport()); - //jMenuFile.addSeparator(); jMenuFile.add(getJMenuItemFileProperties()); - //jMenuFile.addSeparator(); + jMenuFile.add(getJMenuItemFileExit()); - jMenuFile.addMenuListener(this); } return jMenuFile; } @@ -469,22 +476,31 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private JMenu getJMenuEdit() { if (jMenuEdit == null) { + // + // Set jMenuEdit's attributes + // jMenuEdit = new JMenu(); jMenuEdit.setText("Edit"); jMenuEdit.setMnemonic('E'); + jMenuEdit.setVisible(false); + + // + // Add sub menu items + // jMenuEdit.add(getJMenuItemEditUndo()); jMenuEdit.add(getJMenuItemEditRedo()); - jMenuEdit.addSeparator(); + //jMenuEdit.addSeparator(); + jMenuEdit.add(getJMenuItemEditCut()); jMenuEdit.add(getJMenuItemEditCopy()); jMenuEdit.add(getJMenuItemEditPaste()); jMenuEdit.add(getJMenuItemEditDelete()); - jMenuEdit.addSeparator(); + //jMenuEdit.addSeparator(); + jMenuEdit.add(getJMenuItemEditSelectAll()); - jMenuEdit.add(getJMenuItemEditFind()); + jMenuEdit.add(getJMenuEditFind()); jMenuEdit.add(getJMenuItemEditFindNext()); - jMenuEdit.addSeparator(); - jMenuEdit.setVisible(false); + //jMenuEdit.addSeparator(); } return jMenuEdit; } @@ -571,7 +587,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele private JScrollPane getJScrollPaneTree() { if (jScrollPaneTree == null) { jScrollPaneTree = new JScrollPane(); - //jScrollPaneTree.setBounds(new java.awt.Rectangle(0, 1, 290, 545)); jScrollPaneTree .setPreferredSize(new java.awt.Dimension( DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH, @@ -607,12 +622,19 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private JMenu getJMenuHelp() { if (jMenuHelp == null) { + // + // Set jMenuHelp's attributes + // jMenuHelp = new JMenu(); jMenuHelp.setText("Help"); + + // + // Add sub menu items + // jMenuHelp.add(getJMenuItemHelpContents()); jMenuHelp.add(getJMenuItemHelpIndex()); jMenuHelp.add(getJMenuItemHelpSearch()); - //jMenuHelp.addSeparator(); + jMenuHelp.add(getJMenuItemHelpAbout()); } return jMenuHelp; @@ -644,84 +666,17 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele jMenuItemEditDelete = new JMenuItem(); jMenuItemEditDelete.setText("Delete"); jMenuItemEditDelete.setMnemonic('D'); + jMenuItemEditDelete.setVisible(false); + jMenuItemEditDelete.setEnabled(false); jMenuItemEditDelete.addActionListener(this); // - //Disabled when no module is open + //Disabled first when no module is open // jMenuItemEditDelete.setEnabled(false); } return jMenuItemEditDelete; } - // /** - // This method initializes jPopupMenu - // - // @return javax.swing.JPopupMenu jPopupMenu - // - // **/ - // private JPopupMenu getJPopupMenu() { - // if (jPopupMenu == null) { - // jPopupMenu = new JPopupMenu(); - // // - // //Add menu items of popup menu - // // - // jPopupMenu.add(getJMenuItemPopupAdd()); - // jPopupMenu.add(getJMenuItemPopupUpdate()); - // jPopupMenu.add(getJMenuItemPopupDelete()); - // jPopupMenu.setBorder(new BevelBorder(BevelBorder.RAISED)); - // jPopupMenu.addMouseListener(this); - // } - // return jPopupMenu; - // } - // - // /** - // This method initializes jMenuItemPopupAdd - // - // @return javax.swing.JMenuItem jMenuItemPopupAdd - // - // **/ - // private JMenuItem getJMenuItemPopupAdd() { - // if (jMenuItemPopupAdd == null) { - // jMenuItemPopupAdd = new JMenuItem(); - // jMenuItemPopupAdd.setText("Add"); - // jMenuItemPopupAdd.addActionListener(this); - // jMenuItemPopupAdd.setEnabled(false); - // } - // return jMenuItemPopupAdd; - // } - // - // /** - // This method initializes jMenuItemPopupUpdate - // - // @return javax.swing.JMenuItem jMenuItemPopupUpdate - // - // **/ - // private JMenuItem getJMenuItemPopupUpdate() { - // if (jMenuItemPopupUpdate == null) { - // jMenuItemPopupUpdate = new JMenuItem(); - // jMenuItemPopupUpdate.setText("Update"); - // jMenuItemPopupUpdate.addActionListener(this); - // jMenuItemPopupUpdate.setEnabled(false); - // } - // return jMenuItemPopupUpdate; - // } - // - // /** - // This method initializes jMenuItemPopupDelete - // - // @return javax.swing.JMenuItem jMenuItemPopupDelete - // - // **/ - // private JMenuItem getJMenuItemPopupDelete() { - // if (jMenuItemPopupDelete == null) { - // jMenuItemPopupDelete = new JMenuItem(); - // jMenuItemPopupDelete.setText("Delete"); - // jMenuItemPopupDelete.addActionListener(this); - // jMenuItemPopupDelete.setEnabled(false); - // } - // return jMenuItemPopupDelete; - // } - /** This method initializes jMenuFileNew @@ -781,15 +736,24 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private JMenu getJMenuTools() { if (jMenuTools == null) { + // + // Set jMenuTools's attributes + // jMenuTools = new JMenu(); jMenuTools.setText("Tools"); jMenuTools.setMnemonic('T'); - jMenuTools.add(getJMenuItemToolsToolChainConfiguration()); - jMenuTools.addSeparator(); + jMenuTools.addMenuListener(this); + + // + // Add sub menu items + // + jMenuTools.add(getJMenuItemToolsClone()); - //jMenuTools.addSeparator(); jMenuTools.add(getJMenuItemToolsCodeScan()); - jMenuTools.addMenuListener(this); + jMenuTools.addSeparator(); + + jMenuTools.add(getJMenuItemToolsToolChainConfiguration()); + jMenuTools.add(getJMenuItemToolsBuildPreferences()); } return jMenuTools; } @@ -803,25 +767,36 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private JMenu getJMenuWindow() { if (jMenuWindow == null) { + // + // Set jMenuWindow's attribute + // jMenuWindow = new JMenu(); jMenuWindow.setText("Window"); jMenuWindow.setMnemonic('W'); + jMenuWindow.setVisible(false); + + // + // Add sub menu items + // jMenuWindow.add(getJMenuItemWindowDisplaySide()); jMenuWindow.add(getJMenuItemWindowDisplayTopBottom()); jMenuWindow.addSeparator(); + jMenuWindow.add(getJMenuItemWindowTabView()); jMenuWindow.addSeparator(); + jMenuWindow.add(getJMenuItemWindowSource()); jMenuWindow.add(getJMenuItemWindowXML()); jMenuWindow.addSeparator(); + jMenuWindow.add(getJMenuItemWindowPreferences()); - jMenuWindow.setVisible(false); } return jMenuWindow; } /** - This method initializes jPanelOperation + This method initializes jPanelOperation + Reserved @return javax.swing.JPanel jPanelOperation @@ -839,7 +814,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } /** - This method initializes jButtonOk + This method initializes jButtonOk + Reserved @return javax.swing.JButton jButtonOk @@ -856,7 +832,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } /** - This method initializes jButtonCancel + This method initializes jButtonCancel + Reserved @return javax.swing.JButton jButtonCancel @@ -877,7 +854,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele This method initializes jMenuItemFileOpen @return javax.swing.JMenuItem jMenuItemFileOpen - */ + + **/ private JMenuItem getJMenuItemFileOpen() { if (jMenuItemFileOpen == null) { jMenuItemFileOpen = new JMenuItem(); @@ -892,7 +870,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele This method initializes jMenuItemFileCloseAll @return javax.swing.JMenuItem jMenuItemFileOpen - */ + + **/ private JMenuItem getJMenuItemFileCloseAll() { if (jMenuItemFileCloseAll == null) { jMenuItemFileCloseAll = new JMenuItem(); @@ -907,7 +886,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele This method initializes jMenuItemFileSaveAll @return javax.swing.JMenuItem jMenuItemFileSaveAll - */ + + **/ private JMenuItem getJMenuItemFileSaveAll() { if (jMenuItemFileSaveAll == null) { jMenuItemFileSaveAll = new JMenuItem(); @@ -923,7 +903,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele This method initializes jMenuItemFilePageSetup @return javax.swing.JMenuItem - */ + + **/ private JMenuItem getJMenuItemFilePageSetup() { if (jMenuItemFilePageSetup == null) { jMenuItemFilePageSetup = new JMenuItem(); @@ -940,7 +921,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele This method initializes jMenuItemFilePrint @return javax.swing.JMenuItem - */ + + **/ private JMenuItem getJMenuItemFilePrint() { if (jMenuItemFilePrint == null) { jMenuItemFilePrint = new JMenuItem(); @@ -957,7 +939,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele This method initializes jMenuItemFileImport @return javax.swing.JMenuItem - */ + + **/ private JMenuItem getJMenuItemFileImport() { if (jMenuItemFileImport == null) { jMenuItemFileImport = new JMenuItem(); @@ -971,10 +954,11 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } /** - * This method initializes jMenuItemFileProperties - * - * @return javax.swing.JMenuItem - */ + This method initializes jMenuItemFileProperties + + @return javax.swing.JMenuItem + + **/ private JMenuItem getJMenuItemFileProperties() { if (jMenuItemFileProperties == null) { jMenuItemFileProperties = new JMenuItem(); @@ -988,10 +972,11 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } /** - * This method initializes jMenuFileRecentFiles - * - * @return javax.swing.JMenu - */ + This method initializes jMenuFileRecentFiles + + @return javax.swing.JMenu + + **/ private JMenu getJMenuFileRecentFiles() { if (jMenuFileRecentFiles == null) { jMenuFileRecentFiles = new JMenu(); @@ -1007,14 +992,16 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele /** This method initializes jMenuItemEditUndo - @return javax.swing.JMenuItem - */ + @return javax.swing.JMenuItem + + **/ private JMenuItem getJMenuItemEditUndo() { if (jMenuItemEditUndo == null) { jMenuItemEditUndo = new JMenuItem(); jMenuItemEditUndo.setText("Undo"); jMenuItemEditUndo.setMnemonic('U'); jMenuItemEditUndo.setEnabled(false); + jMenuItemEditUndo.setVisible(false); jMenuItemEditUndo.addActionListener(this); } return jMenuItemEditUndo; @@ -1024,13 +1011,15 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele This method initializes jMenuItemEditRedo @return javax.swing.JMenuItem - */ + + **/ private JMenuItem getJMenuItemEditRedo() { if (jMenuItemEditRedo == null) { jMenuItemEditRedo = new JMenuItem(); jMenuItemEditRedo.setText("Redo"); jMenuItemEditRedo.setMnemonic('R'); jMenuItemEditRedo.setEnabled(false); + jMenuItemEditRedo.setVisible(false); jMenuItemEditRedo.addActionListener(this); } return jMenuItemEditRedo; @@ -1040,13 +1029,15 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele This method initializes jMenuItemEditCut @return javax.swing.JMenuItem - */ + + **/ private JMenuItem getJMenuItemEditCut() { if (jMenuItemEditCut == null) { jMenuItemEditCut = new JMenuItem(); jMenuItemEditCut.setText("Cut"); jMenuItemEditCut.setMnemonic('t'); jMenuItemEditCut.setEnabled(false); + jMenuItemEditCut.setVisible(false); jMenuItemEditCut.addActionListener(this); } return jMenuItemEditCut; @@ -1056,13 +1047,15 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele This method initializes jMenuItemEditCopy @return javax.swing.JMenuItem - */ + + **/ private JMenuItem getJMenuItemEditCopy() { if (jMenuItemEditCopy == null) { jMenuItemEditCopy = new JMenuItem(); jMenuItemEditCopy.setText("Copy"); jMenuItemEditCopy.setMnemonic('C'); jMenuItemEditCopy.setEnabled(false); + jMenuItemEditCopy.setVisible(false); jMenuItemEditCopy.addActionListener(this); } return jMenuItemEditCopy; @@ -1072,13 +1065,15 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele This method initializes jMenuItemEditPaste return javax.swing.JMenuItem - */ + + **/ private JMenuItem getJMenuItemEditPaste() { if (jMenuItemEditPaste == null) { jMenuItemEditPaste = new JMenuItem(); jMenuItemEditPaste.setText("Paste"); jMenuItemEditPaste.setMnemonic('P'); jMenuItemEditPaste.setEnabled(false); + jMenuItemEditPaste.setVisible(false); jMenuItemEditPaste.addActionListener(this); } return jMenuItemEditPaste; @@ -1088,46 +1083,33 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele This method initializes jMenuItem @return javax.swing.JMenuItem - */ + + **/ private JMenuItem getJMenuItemEditSelectAll() { if (jMenuItemEditSelectAll == null) { jMenuItemEditSelectAll = new JMenuItem(); jMenuItemEditSelectAll.setText("Select All"); jMenuItemEditSelectAll.setMnemonic('A'); jMenuItemEditSelectAll.setEnabled(false); + jMenuItemEditSelectAll.setVisible(false); jMenuItemEditSelectAll.addActionListener(this); } return jMenuItemEditSelectAll; } - /** - This method initializes jMenuItemEditFind - - @return javax.swing.JMenuItem - */ - private JMenuItem getJMenuItemEditFind() { - if (jMenuItemEditFind == null) { - jMenuItemEditFind = new JMenuItem(); - jMenuItemEditFind.setText("Find"); - jMenuItemEditFind.setMnemonic('F'); - jMenuItemEditFind.setEnabled(false); - jMenuItemEditFind.addActionListener(this); - } - return jMenuItemEditFind; - } - /** This method initializes jMenuItemEditFindNext @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemEditFindNext() { if (jMenuItemEditFindNext == null) { jMenuItemEditFindNext = new JMenuItem(); jMenuItemEditFindNext.setText("Find Next"); jMenuItemEditFindNext.setMnemonic('n'); jMenuItemEditFindNext.setEnabled(false); + jMenuItemEditFindNext.setVisible(false); jMenuItemEditFindNext.addActionListener(this); } return jMenuItemEditFindNext; @@ -1138,17 +1120,24 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenu - */ + **/ private JMenu getJMenuView() { if (jMenuView == null) { + // + // Set jMenuView's attributes + // jMenuView = new JMenu(); jMenuView.setText("View"); jMenuView.setMnemonic('V'); + jMenuView.setVisible(false); + + // + // Add sub menu items + // jMenuView.add(getJMenuViewToolbars()); jMenuView.add(getJMenuItemViewAdvanced()); jMenuView.add(getJMenuItemViewStandard()); jMenuView.add(getJMenuItemViewXML()); - jMenuView.setVisible(false); } return jMenuView; } @@ -1158,12 +1147,13 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenu - */ + **/ private JMenu getJMenuViewToolbars() { if (jMenuViewToolbars == null) { jMenuViewToolbars = new JMenu(); jMenuViewToolbars.setText("Toolbars"); jMenuViewToolbars.setMnemonic('T'); + jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsFile()); jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsEdit()); jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsWindow()); @@ -1176,7 +1166,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JCheckBoxMenuItem - */ + **/ private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsFile() { if (jCheckBoxMenuItemViewToolbarsFile == null) { jCheckBoxMenuItemViewToolbarsFile = new JCheckBoxMenuItem(); @@ -1192,7 +1182,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JCheckBoxMenuItem - */ + **/ private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsEdit() { if (jCheckBoxMenuItemViewToolbarsEdit == null) { jCheckBoxMenuItemViewToolbarsEdit = new JCheckBoxMenuItem(); @@ -1208,7 +1198,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JCheckBoxMenuItem - */ + **/ private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsWindow() { if (jCheckBoxMenuItemViewToolbarsWindow == null) { jCheckBoxMenuItemViewToolbarsWindow = new JCheckBoxMenuItem(); @@ -1224,7 +1214,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemViewStandard() { if (jMenuItemViewStandard == null) { jMenuItemViewStandard = new JMenuItem(); @@ -1241,7 +1231,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemViewAdvanced() { if (jMenuItemViewAdvanced == null) { jMenuItemViewAdvanced = new JMenuItem(); @@ -1258,22 +1248,29 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenu - */ + **/ private JMenu getJMenuProject() { if (jMenuProject == null) { + // + // Set jMenuProject's attributes + // jMenuProject = new JMenu(); jMenuProject.setText("Project"); jMenuProject.setMnemonic('P'); + + // + // Add sub menu items + // jMenuProject.add(getJMenuItemProjectAdmin()); - //jMenuProject.addSeparator(); + jMenuProject.add(getJMenuItemProjectChangeWorkspace()); jMenuProject.addSeparator(); + jMenuProject.add(getJMenuItemProjectCreateFar()); jMenuProject.add(getJMenuItemProjectInstallFar()); jMenuProject.add(getJMenuItemProjectUpdateFar()); jMenuProject.add(getJMenuItemProjectRemoveFar()); - //jMenuProject.addSeparator(); - jMenuProject.add(getJMenuProjectBuildTargets()); + } return jMenuProject; } @@ -1283,7 +1280,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemProjectAdmin() { if (jMenuItemProjectAdmin == null) { jMenuItemProjectAdmin = new JMenuItem(); @@ -1301,7 +1298,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemProjectChangeWorkspace() { if (jMenuItemProjectChangeWorkspace == null) { jMenuItemProjectChangeWorkspace = new JMenuItem(); @@ -1314,51 +1311,20 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } /** - This method initializes jMenuProjectBuildTargets + This method initializes jMenuProjectBuildPreferences @return javax.swing.JMenu - */ - private JMenu getJMenuProjectBuildTargets() { - if (jMenuProjectBuildTargets == null) { - jMenuProjectBuildTargets = new JMenu(); - jMenuProjectBuildTargets.setText("Build Targets"); - jMenuProjectBuildTargets.setMnemonic('T'); - jMenuProjectBuildTargets.add(getJCheckBoxMenuItemProjectBuildTargetsDebug()); - jMenuProjectBuildTargets.add(getJCheckBoxMenuItemProjectBuildTargetsRelease()); - jMenuProjectBuildTargets.setVisible(false); - } - return jMenuProjectBuildTargets; - } - - /** - This method initializes jCheckBoxMenuItemProjectBuildTargetsDebug - - @return javax.swing.JCheckBoxMenuItem - - */ - private JCheckBoxMenuItem getJCheckBoxMenuItemProjectBuildTargetsDebug() { - if (jCheckBoxMenuItemProjectBuildTargetsDebug == null) { - jCheckBoxMenuItemProjectBuildTargetsDebug = new JCheckBoxMenuItem(); - jCheckBoxMenuItemProjectBuildTargetsDebug.setText("Debug"); - jCheckBoxMenuItemProjectBuildTargetsDebug.setEnabled(false); - } - return jCheckBoxMenuItemProjectBuildTargetsDebug; - } - - /** - This method initializes jCheckBoxMenuItemProjectBuildTargetsRelease - - @return javax.swing.JCheckBoxMenuItem - - */ - private JCheckBoxMenuItem getJCheckBoxMenuItemProjectBuildTargetsRelease() { - if (jCheckBoxMenuItemProjectBuildTargetsRelease == null) { - jCheckBoxMenuItemProjectBuildTargetsRelease = new JCheckBoxMenuItem(); - jCheckBoxMenuItemProjectBuildTargetsRelease.setText("Release"); - jCheckBoxMenuItemProjectBuildTargetsRelease.setEnabled(false); + **/ + private JMenuItem getJMenuItemToolsBuildPreferences() { + if (jMenuItemToolsBuildPreferences == null) { + jMenuItemToolsBuildPreferences = new JMenuItem(); + jMenuItemToolsBuildPreferences.setText("Build Preferences"); + jMenuItemToolsBuildPreferences.setMnemonic('P'); + jMenuItemToolsBuildPreferences.setEnabled(true); + jMenuItemToolsBuildPreferences.addActionListener(this); } - return jCheckBoxMenuItemProjectBuildTargetsRelease; + return jMenuItemToolsBuildPreferences; } /** @@ -1366,7 +1332,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemToolsToolChainConfiguration() { if (jMenuItemToolsToolChainConfiguration == null) { jMenuItemToolsToolChainConfiguration = new JMenuItem(); @@ -1382,7 +1348,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemToolsClone() { if (jMenuItemToolsClone == null) { jMenuItemToolsClone = new JMenuItem(); @@ -1399,7 +1365,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemToolsCodeScan() { if (jMenuItemToolsCodeScan == null) { jMenuItemToolsCodeScan = new JMenuItem(); @@ -1417,7 +1383,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemWindowDisplaySide() { if (jMenuItemWindowDisplaySide == null) { jMenuItemWindowDisplaySide = new JMenuItem(); @@ -1434,7 +1400,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemWindowDisplayTopBottom() { if (jMenuItemWindowDisplayTopBottom == null) { jMenuItemWindowDisplayTopBottom = new JMenuItem(); @@ -1451,7 +1417,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemViewXML() { if (jMenuItemViewXML == null) { jMenuItemViewXML = new JMenuItem(); @@ -1468,7 +1434,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemWindowTabView() { if (jMenuItemWindowTabView == null) { jMenuItemWindowTabView = new JMenuItem(); @@ -1485,7 +1451,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemWindowSource() { if (jMenuItemWindowSource == null) { jMenuItemWindowSource = new JMenuItem(); @@ -1502,7 +1468,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemWindowXML() { if (jMenuItemWindowXML == null) { jMenuItemWindowXML = new JMenuItem(); @@ -1519,7 +1485,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemWindowPreferences() { if (jMenuItemWindowPreferences == null) { jMenuItemWindowPreferences = new JMenuItem(); @@ -1536,7 +1502,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemHelpContents() { if (jMenuItemHelpContents == null) { jMenuItemHelpContents = new JMenuItem(); @@ -1554,7 +1520,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele @return javax.swing.JMenuItem - */ + **/ private JMenuItem getJMenuItemHelpIndex() { if (jMenuItemHelpIndex == null) { jMenuItemHelpIndex = new JMenuItem(); @@ -1585,30 +1551,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele return jMenuItemHelpSearch; } - /** - * This method initializes jToolBar - * - * @return javax.swing.JToolBar - */ - // private JToolBar getJToolBarFile() { - // if (jToolBarFile == null) { - // jToolBarFile = new JToolBar(); - // jToolBarFile.setFloatable(false); - // } - // return jToolBarFile; - // } - /** - * This method initializes jToolBarEdit - * - * @return javax.swing.JToolBar - */ - // private JToolBar getJToolBarEdit() { - // if (jToolBarEdit == null) { - // jToolBarEdit = new JToolBar(); - // jToolBarEdit.setFloatable(false); - // } - // return jToolBarEdit; - // } /** * This method initializes jMenuItemToolsInstallPackage * @@ -1673,6 +1615,119 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele return jMenuItemProjectCreateFar; } + /** + * This method initializes jMenuEditFind + * + * @return javax.swing.JMenu + */ + private JMenu getJMenuEditFind() { + if (jMenuEditFind == null) { + jMenuEditFind = new JMenu(); + jMenuEditFind.setText("Find"); + jMenuEditFind.setMnemonic('F'); + + jMenuEditFind.add(getJMenuItemEditFindPpi()); + jMenuEditFind.add(getJMenuItemEditFindProtocol()); + jMenuEditFind.add(getJMenuItemEditFindGuid()); + jMenuEditFind.add(getJMenuItemEditFindPcd()); + jMenuEditFind.addSeparator(); + + jMenuEditFind.add(getJMenuItemEditFindLibraryClass()); + jMenuEditFind.add(getJMenuItemEditFindLibraryInstance()); + } + return jMenuEditFind; + } + + /** + * This method initializes jMenuItemEditFindPcd + * + * @return javax.swing.JMenuItem + */ + private JMenuItem getJMenuItemEditFindPcd() { + if (jMenuItemEditFindPcd == null) { + jMenuItemEditFindPcd = new JMenuItem(); + jMenuItemEditFindPcd.setText("All PCD entries"); + jMenuItemEditFindPcd.setMnemonic('P'); + jMenuItemEditFindPcd.addActionListener(this); + } + return jMenuItemEditFindPcd; + } + + /** + * This method initializes jMenuItemEditFindLibraryClass + * + * @return javax.swing.JMenuItem + */ + private JMenuItem getJMenuItemEditFindLibraryClass() { + if (jMenuItemEditFindLibraryClass == null) { + jMenuItemEditFindLibraryClass = new JMenuItem(); + jMenuItemEditFindLibraryClass.setText("All Library Classes"); + jMenuItemEditFindLibraryClass.setMnemonic('C'); + jMenuItemEditFindLibraryClass.addActionListener(this); + } + return jMenuItemEditFindLibraryClass; + } + + /** + * This method initializes jMenuItemEditFindPpi + * + * @return javax.swing.JMenuItem + */ + private JMenuItem getJMenuItemEditFindPpi() { + if (jMenuItemEditFindPpi == null) { + jMenuItemEditFindPpi = new JMenuItem(); + jMenuItemEditFindPpi.setText("All PPIs"); + jMenuItemEditFindPpi.setMnemonic('I'); + jMenuItemEditFindPpi.addActionListener(this); + } + return jMenuItemEditFindPpi; + } + + /** + * This method initializes jMenuItemEditFindProtocol + * + * @return javax.swing.JMenuItem + */ + private JMenuItem getJMenuItemEditFindProtocol() { + if (jMenuItemEditFindProtocol == null) { + jMenuItemEditFindProtocol = new JMenuItem(); + jMenuItemEditFindProtocol.setText("All Protocols"); + jMenuItemEditFindProtocol.setMnemonic('r'); + jMenuItemEditFindProtocol.addActionListener(this); + } + return jMenuItemEditFindProtocol; + } + + /** + * This method initializes jMenuItemEditFindGuid + * + * @return javax.swing.JMenuItem + */ + private JMenuItem getJMenuItemEditFindGuid() { + if (jMenuItemEditFindGuid == null) { + jMenuItemEditFindGuid = new JMenuItem(); + jMenuItemEditFindGuid.setText("All GUIDs"); + jMenuItemEditFindGuid.setMnemonic('G'); + jMenuItemEditFindGuid.addActionListener(this); + } + return jMenuItemEditFindGuid; + } + + /** + * This method initializes jMenuItemEditFindLibraryInstance + * + * @return javax.swing.JMenuItem + */ + private JMenuItem getJMenuItemEditFindLibraryInstance() { + if (jMenuItemEditFindLibraryInstance == null) { + jMenuItemEditFindLibraryInstance = new JMenuItem(); + jMenuItemEditFindLibraryInstance.setText("All Library Instances"); + jMenuItemEditFindLibraryInstance.setMnemonic('n'); + jMenuItemEditFindLibraryInstance.addActionListener(this); + } + return jMenuItemEditFindLibraryInstance; + } + /* (non-Javadoc) * @see org.tianocore.packaging.common.ui.IFrame#main(java.lang.String[]) * @@ -1712,11 +1767,17 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele System.exit(0); } + // + // Init Global Data + // + GlobalData.init(); + + // + // Init the frame + // this.setSize(DataType.MAIN_FRAME_PREFERRED_SIZE_WIDTH, DataType.MAIN_FRAME_PREFERRED_SIZE_HEIGHT); this.setResizable(true); this.setJMenuBar(getjJMenuBar()); - this.addComponentListener(this); - this.getCompontentsFromFrameworkDatabase(); this.setContentPane(getJContentPane()); this.setTitle(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION + " " + "- [" + Workspace.getCurrentWorkspace() + "]"); @@ -1754,98 +1815,75 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // // Operations of Menu // - if (arg0.getSource() == jMenuItemFileNew) { + if (arg0.getSource() == this.jMenuItemFileNew) { this.fileNew(); } - if (arg0.getSource() == jMenuItemFileOpen) { + if (arg0.getSource() == this.jMenuItemFileOpen) { this.open(); } - if (arg0.getSource() == jMenuItemFileClose) { + if (arg0.getSource() == this.jMenuItemFileClose) { this.close(); } - if (arg0.getSource() == jMenuItemFileCloseAll) { + if (arg0.getSource() == this.jMenuItemFileCloseAll) { this.closeAll(); } - if (arg0.getSource() == jMenuItemFileSave) { + if (arg0.getSource() == this.jMenuItemFileSave) { this.save(); } - if (arg0.getSource() == jMenuItemFileSaveAs) { + if (arg0.getSource() == this.jMenuItemFileSaveAs) { this.saveAs(); } - if (arg0.getSource() == jMenuItemFileSaveAll) { + if (arg0.getSource() == this.jMenuItemFileSaveAll) { this.saveAll(); } - if (arg0.getSource() == jMenuItemFileExit) { + if (arg0.getSource() == this.jMenuItemFileExit) { this.exit(); } - if (arg0.getSource() == jMenuItemProjectChangeWorkspace) { - changeWorkspace(); + if (arg0.getSource() == this.jMenuItemEditFindPpi) { +// this.findPpi(); + } + + if (arg0.getSource() == jMenuItemToolsBuildPreferences) { + configBuildPreferences(); } - if (arg0.getSource() == jMenuItemProjectCreateFar) { - CreateStepOne cso = new CreateStepOne(this, true); - int result = cso.showDialog(); - if (result == DataType.RETURN_TYPE_OK) { - String strReturn = "Create Far Done!"; - JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, - JOptionPane.INFORMATION_MESSAGE); - } - cso.dispose(); + if (arg0.getSource() == this.jMenuItemProjectChangeWorkspace) { + this.changeWorkspace(); } - if (arg0.getSource() == jMenuItemProjectInstallFar) { - InstallStepOne iso = new InstallStepOne(this, true); - int result = iso.showDialog(); - if (result == DataType.RETURN_TYPE_OK) { - String strReturn = "Install Far Done!
The WORKSPACE will be refreshed!"; - JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, - JOptionPane.INFORMATION_MESSAGE); - this.closeAll(); - } - iso.dispose(); + if (arg0.getSource() == this.jMenuItemProjectCreateFar) { + this.createFar(); } - if (arg0.getSource() == jMenuItemProjectRemoveFar) { - DeleteStepOne dso = new DeleteStepOne(this, true); - int result = dso.showDialog(); - if (result == DataType.RETURN_TYPE_OK) { - String strReturn = "Delete Far Done!
The WORKSPACE will be refreshed!"; - JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, - JOptionPane.INFORMATION_MESSAGE); - this.closeAll(); - } - dso.dispose(); + if (arg0.getSource() == this.jMenuItemProjectInstallFar) { + this.installFar(); } - if (arg0.getSource() == jMenuItemProjectUpdateFar) { - UpdateStepOne uso = new UpdateStepOne(this, true); - int result = uso.showDialog(); - if (result == DataType.RETURN_TYPE_OK) { - String strReturn = "Update Far Done!
The WORKSPACE will be refreshed!"; - JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, - JOptionPane.INFORMATION_MESSAGE); - this.closeAll(); - } - uso.dispose(); + if (arg0.getSource() == this.jMenuItemProjectRemoveFar) { + this.removeFar(); + } + + if (arg0.getSource() == this.jMenuItemProjectUpdateFar) { + this.updateFar(); } - if (arg0.getSource() == jMenuItemToolsClone) { - cloneItem(); + if (arg0.getSource() == this.jMenuItemToolsClone) { + this.cloneItem(); } - if (arg0.getSource() == jMenuItemToolsToolChainConfiguration) { - setupToolChainConfiguration(); + if (arg0.getSource() == this.jMenuItemToolsToolChainConfiguration) { + this.setupToolChainConfiguration(); } - if (arg0.getSource() == jMenuItemHelpAbout) { + if (arg0.getSource() == this.jMenuItemHelpAbout) { About a = new About(this, true); int result = a.showDialog(); if (result == DataType.RETURN_TYPE_OK) { @@ -1859,41 +1897,47 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private void makeEmptyTree() { + // // Make root + // dmtnRoot = new IDefaultMutableTreeNode("WORKSPACE", IDefaultMutableTreeNode.WORKSPACE, -1); + // // Make Module Description + // dmtnModuleDescription = new IDefaultMutableTreeNode("ModuleDescription", IDefaultMutableTreeNode.MODULE, -1); // // First add package // - if (this.vPackageList.size() > 0) { - for (int index = 0; index < this.vPackageList.size(); index++) { + if (GlobalData.vPackageList.size() > 0) { + for (int index = 0; index < GlobalData.vPackageList.size(); index++) { IDefaultMutableTreeNode dmtnModulePackage = null; IDefaultMutableTreeNode dmtnModulePackageLibrary = null; IDefaultMutableTreeNode dmtnModulePackageModule = null; - dmtnModulePackage = new IDefaultMutableTreeNode(this.vPackageList.elementAt(index).getName(), + dmtnModulePackage = new IDefaultMutableTreeNode(GlobalData.vPackageList.elementAt(index).getName(), IDefaultMutableTreeNode.MODULE_PACKAGE, false, - this.vPackageList.elementAt(index)); + GlobalData.vPackageList.elementAt(index)); dmtnModulePackageLibrary = new IDefaultMutableTreeNode("Library", IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY, - false, this.vPackageList.elementAt(index)); + false, GlobalData.vPackageList.elementAt(index)); dmtnModulePackageModule = new IDefaultMutableTreeNode("Module", IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE, - false, this.vPackageList.elementAt(index)); - - Vector vModule = wt.getAllModules(this.vPackageList.elementAt(index)); + false, GlobalData.vPackageList.elementAt(index)); + // + // And then add each module in its package + // + Vector vModule = wt.getAllModules(GlobalData.vPackageList.elementAt(index)); for (int indexJ = 0; indexJ < vModule.size(); indexJ++) { if (vModule.get(indexJ).isLibrary()) { dmtnModulePackageLibrary.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(), - IDefaultMutableTreeNode.MSA_HEADER, - false, vModule.get(indexJ))); + IDefaultMutableTreeNode.MODULE, false, + vModule.get(indexJ))); } else { dmtnModulePackageModule.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(), - IDefaultMutableTreeNode.MSA_HEADER, - false, vModule.get(indexJ))); + IDefaultMutableTreeNode.MODULE, false, + vModule.get(indexJ))); } } if (dmtnModulePackageModule.getChildCount() > 0) { @@ -1907,35 +1951,36 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } } - // if (this.vModuleList.size() > 0) { - // for (int index = 0; index < this.vModuleList.size(); index++) { - // dmtnModuleDescription.add(new IDefaultMutableTreeNode(this.vModuleList.elementAt(index).getName(), - // IDefaultMutableTreeNode.MSA_HEADER, false, - // this.vModuleList.elementAt(index))); - // } - // } - + // // Make Package Description + // dmtnPackageDescription = new IDefaultMutableTreeNode("PackageDescription", IDefaultMutableTreeNode.PACKAGE, -1); - if (this.vPackageList.size() > 0) { - for (int index = 0; index < this.vPackageList.size(); index++) { - dmtnPackageDescription.add(new IDefaultMutableTreeNode(this.vPackageList.elementAt(index).getName(), - IDefaultMutableTreeNode.SPD_HEADER, false, - this.vPackageList.elementAt(index))); + if (GlobalData.vPackageList.size() > 0) { + for (int index = 0; index < GlobalData.vPackageList.size(); index++) { + dmtnPackageDescription.add(new IDefaultMutableTreeNode(GlobalData.vPackageList.elementAt(index) + .getName(), + IDefaultMutableTreeNode.PACKAGE, false, + GlobalData.vPackageList.elementAt(index))); } } + // // Make Platform Description + // dmtnPlatformDescription = new IDefaultMutableTreeNode("PlatformDescription", IDefaultMutableTreeNode.PLATFORM, -1); - if (this.vPlatformList.size() > 0) { - for (int index = 0; index < this.vPlatformList.size(); index++) { - dmtnPlatformDescription.add(new IDefaultMutableTreeNode(this.vPlatformList.elementAt(index).getName(), - IDefaultMutableTreeNode.FPD_PLATFORMHEADER, - false, this.vPlatformList.elementAt(index))); + if (GlobalData.vPlatformList.size() > 0) { + for (int index = 0; index < GlobalData.vPlatformList.size(); index++) { + dmtnPlatformDescription.add(new IDefaultMutableTreeNode(GlobalData.vPlatformList.elementAt(index) + .getName(), + IDefaultMutableTreeNode.PLATFORM, false, + GlobalData.vPlatformList.elementAt(index))); } } + // + // Add sub nodes to root node + // dmtnRoot.add(dmtnModuleDescription); dmtnRoot.add(dmtnPackageDescription); dmtnRoot.add(dmtnPlatformDescription); @@ -2062,8 +2107,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // // Add new MsaHeader node to the tree // - IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(mid.getName(), IDefaultMutableTreeNode.MSA_HEADER, - true, mid); + IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(mid.getName(), IDefaultMutableTreeNode.MODULE, true, + mid); // // First find the module belongs to which package // @@ -2122,88 +2167,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } } - /** - Open Module - - @param path input file path - - **/ - private void openModule(String path, ModuleIdentification moduleId) { - ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = null; - try { - msa = OpenFile.openMsaFile(path); - } catch (IOException e) { - Log.wrn("Open Module Surface Area " + path, e.getMessage()); - Log.err("Open Module Surface Area " + path, e.getMessage()); - return; - } catch (XmlException e) { - Log.wrn("Open Module Surface Area " + path, e.getMessage()); - Log.err("Open Module Surface Area " + path, e.getMessage()); - return; - } catch (Exception e) { - Log.wrn("Open Module Surface Area " + path, "Invalid file type"); - Log.err("Open Module Surface Area " + path, "Invalid file type"); - return; - } - Identification id = new Identification(msa.getMsaHeader().getModuleName(), msa.getMsaHeader().getGuidValue(), - msa.getMsaHeader().getVersion(), path); - // - // Generate module id - // - PackageIdentification pid = wt.getPackageIdByModuleId(id); - if (pid != null) { - // - // To judge if the module existed in vModuleList - // If not, add it to vModuleList - // - boolean isFind = false; - for (int index = 0; index < vModuleList.size(); index++) { - if (vModuleList.elementAt(index).equals(id)) { - isFind = true; - break; - } - } - if (!isFind) { - ModuleIdentification mid = new ModuleIdentification(id, pid, moduleId.isLibrary()); - vModuleList.addElement(mid); - addModuleToTree(mid); - } - } else { - // - // The module is not in existing packages - // - Log.err("The module hasn't been added to any package of current workspace!"); - return; - } - - // - // Make the node selected - // - iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id, - IDefaultMutableTreeNode.MSA_HEADER))); - // - // Update opening Module list information - // - if (!openingModuleList.existsModule(id)) { - // - // Insert sub node of module - // - insertModuleTreeNode(id); - iTree.getSelectNode().setOpening(true); - - // - // Update opening module list - // - openingModuleList.insertToOpeningModuleList(id, msa); - openingModuleList.setTreePathById(id, iTree.getSelectionPath()); - } - // - // Show msa header in editor panel - // - showModuleElement(IDefaultMutableTreeNode.MSA_HEADER, openingModuleList.getOpeningModuleById(id)); - this.currentOpeningModuleIndex = openingModuleList.findIndexOfListById(id); - } - /** Open Module @@ -2211,46 +2174,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private void openModule(String path) { - ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = null; - try { - msa = OpenFile.openMsaFile(path); - } catch (IOException e) { - Log.wrn("Open Module Surface Area " + path, e.getMessage()); - Log.err("Open Module Surface Area " + path, e.getMessage()); - return; - } catch (XmlException e) { - Log.wrn("Open Module Surface Area " + path, e.getMessage()); - Log.err("Open Module Surface Area " + path, e.getMessage()); - return; - } catch (Exception e) { - Log.wrn("Open Module Surface Area " + path, "Invalid file type"); - Log.err("Open Module Surface Area " + path, "Invalid file type"); - return; - } - Identification id = new Identification(msa.getMsaHeader().getModuleName(), msa.getMsaHeader().getGuidValue(), - msa.getMsaHeader().getVersion(), path); - // - // Generate module id - // - PackageIdentification pid = wt.getPackageIdByModuleId(id); - if (pid != null) { - // - // To judge if the module existed in vModuleList - // If not, add it to vModuleList - // - boolean isFind = false; - for (int index = 0; index < vModuleList.size(); index++) { - if (vModuleList.elementAt(index).equals(id)) { - isFind = true; - break; - } - } - if (!isFind) { - ModuleIdentification mid = new ModuleIdentification(id, pid); - vModuleList.addElement(mid); - addModuleToTree(mid); - } - } else { + ModuleIdentification id = GlobalData.openingModuleList.getIdByPath(path); + if (id == null) { // // The module is not in existing packages // @@ -2262,11 +2187,11 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // Make the node selected // iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id, - IDefaultMutableTreeNode.MSA_HEADER))); + IDefaultMutableTreeNode.MODULE))); // // Update opening Module list information // - if (!openingModuleList.existsModule(id)) { + if (!GlobalData.openingModuleList.getModuleOpen(id)) { // // Insert sub node of module // @@ -2276,14 +2201,16 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // // Update opening module list // - openingModuleList.insertToOpeningModuleList(id, msa); - openingModuleList.setTreePathById(id, iTree.getSelectionPath()); + GlobalData.openingModuleList.setModuleOpen(id, true); + GlobalData.openingModuleList.setTreePathById(id, iTree.getSelectionPath()); } // - // Show msa header in editor panel + // Select msa header node and show it in editor panel // - showModuleElement(IDefaultMutableTreeNode.MSA_HEADER, openingModuleList.getOpeningModuleById(id)); - this.currentOpeningModuleIndex = openingModuleList.findIndexOfListById(id); + iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id, + IDefaultMutableTreeNode.MSA_HEADER))); + showModuleElement(IDefaultMutableTreeNode.MSA_HEADER, GlobalData.openingModuleList.getOpeningModuleById(id)); + this.currentOpeningModuleIndex = GlobalData.openingModuleList.findIndexOfListById(id); } /** @@ -2293,38 +2220,10 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private void openPackage(String path) { - PackageSurfaceAreaDocument.PackageSurfaceArea spd = null; - try { - spd = OpenFile.openSpdFile(path); - } catch (IOException e) { - Log.wrn("Open Package Surface Area " + path, e.getMessage()); - Log.err("Open Package Surface Area " + path, e.getMessage()); - return; - } catch (XmlException e) { - Log.wrn("Open Package Surface Area " + path, e.getMessage()); - Log.err("Open Package Surface Area " + path, e.getMessage()); - return; - } catch (Exception e) { - Log.wrn("Open Package Surface Area " + path, "Invalid file type"); - Log.err("Open Package Surface Area " + path, "Invalid file type"); - return; - } - Identification id = new Identification(spd.getSpdHeader().getPackageName(), spd.getSpdHeader().getGuidValue(), - spd.getSpdHeader().getVersion(), path); - // - // To judge if the package existed in vPackageList - // If not, add it to vPackageList - // - boolean isFind = false; - for (int index = 0; index < vPackageList.size(); index++) { - if (vPackageList.elementAt(index).equals(id)) { - isFind = true; - break; - } - } - if (!isFind) { + PackageIdentification id = GlobalData.openingPackageList.getIdByPath(path); + if (id == null) { // - // The module is not in existing packages + // The package is not in current workspace // Log.wrn("Open Package", "The package hasn't been added to current workspace!"); return; @@ -2334,11 +2233,11 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // Make the node selected // iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPackageDescription, id, - IDefaultMutableTreeNode.SPD_HEADER))); + IDefaultMutableTreeNode.PACKAGE))); // // Update opening package list information // - if (!openingPackageList.existsPackage(id)) { + if (!GlobalData.openingPackageList.getPackageOpen(id)) { // // Insert sub node of module // @@ -2348,14 +2247,16 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // // Update opening module list // - openingPackageList.insertToOpeningPackageList(id, spd); - openingPackageList.setTreePathById(id, iTree.getSelectionPath()); + GlobalData.openingPackageList.setPackageOpen(id, true); + GlobalData.openingPackageList.setTreePathById(id, iTree.getSelectionPath()); } // // Show spd header in editor panel // - showPackageElement(IDefaultMutableTreeNode.SPD_HEADER, openingPackageList.getOpeningPackageById(id)); - this.currentOpeningPackageIndex = openingPackageList.findIndexOfListById(id); + iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPackageDescription, id, + IDefaultMutableTreeNode.SPD_HEADER))); + showPackageElement(IDefaultMutableTreeNode.SPD_HEADER, GlobalData.openingPackageList.getOpeningPackageById(id)); + this.currentOpeningPackageIndex = GlobalData.openingPackageList.findIndexOfListById(id); } /** @@ -2365,39 +2266,10 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private void openPlatform(String path) { - PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd = null; - try { - fpd = OpenFile.openFpdFile(path); - } catch (IOException e) { - Log.wrn("Open Platform Surface Area " + path, e.getMessage()); - Log.err("Open Platform Surface Area " + path, e.getMessage()); - return; - } catch (XmlException e) { - Log.wrn("Open Platform Surface Area " + path, e.getMessage()); - Log.err("Open Platform Surface Area " + path, e.getMessage()); - return; - } catch (Exception e) { - Log.wrn("Open Platform Surface Area " + path, "Invalid file type"); - Log.err("Open Platform Surface Area " + path, "Invalid file type"); - return; - } - Identification id = new Identification(fpd.getPlatformHeader().getPlatformName(), fpd.getPlatformHeader() - .getGuidValue(), - fpd.getPlatformHeader().getVersion(), path); - // - // To judge if the platform existed in vPlatformList - // If not, add it to vPlatformList - // - boolean isFind = false; - for (int index = 0; index < vPlatformList.size(); index++) { - if (vPlatformList.elementAt(index).equals(id)) { - isFind = true; - break; - } - } - if (!isFind) { + PlatformIdentification id = GlobalData.openingPlatformList.getIdByPath(path); + if (id == null) { // - // The module is not in existing packages + // The platform is not in current workspace // Log.wrn("Open Platform", "The platform hasn't been added to current workspace!"); return; @@ -2407,11 +2279,11 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // Make the node selected // iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPlatformDescription, id, - IDefaultMutableTreeNode.FPD_PLATFORMHEADER))); + IDefaultMutableTreeNode.PLATFORM))); // // Update opening package list information // - if (!openingPlatformList.existsPlatform(id)) { + if (!GlobalData.openingPlatformList.getPlatformOpen(id)) { // // Insert sub node of module // @@ -2421,14 +2293,17 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // // Update opening module list // - openingPlatformList.insertToOpeningPlatformList(id, fpd); - openingPlatformList.setTreePathById(id, iTree.getSelectionPath()); + GlobalData.openingPlatformList.setPlatformOpen(id, true); + GlobalData.openingPlatformList.setTreePathById(id, iTree.getSelectionPath()); } // // Show fpd header in editor panel // - showPlatformElement(IDefaultMutableTreeNode.FPD_PLATFORMHEADER, openingPlatformList.getOpeningPlatformById(id)); - this.currentOpeningPlatformIndex = openingPlatformList.findIndexOfListById(id); + iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPlatformDescription, id, + IDefaultMutableTreeNode.FPD_PLATFORMHEADER))); + showPlatformElement(IDefaultMutableTreeNode.FPD_PLATFORMHEADER, + GlobalData.openingPlatformList.getOpeningPlatformById(id)); + this.currentOpeningPlatformIndex = GlobalData.openingPlatformList.findIndexOfListById(id); } /** @@ -2436,7 +2311,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private void saveModule(int index) { - OpeningModuleType omt = openingModuleList.getOpeningModuleByIndex(index); + OpeningModuleType omt = GlobalData.openingModuleList.getOpeningModuleByIndex(index); if (omt.isNew()) { if (getNewFilePath(DataType.MODULE_SURFACE_AREA_EXT) != JFileChooser.APPROVE_OPTION) { return; @@ -2444,8 +2319,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } try { SaveFile.saveMsaFile(omt.getId().getPath(), omt.getXmlMsa()); - openingModuleList.setNew(omt.getId(), false); - openingModuleList.setModuleSaved(omt.getId(), true); + GlobalData.openingModuleList.setNew(omt.getId(), false); + GlobalData.openingModuleList.setModuleSaved(omt.getId(), true); } catch (Exception e) { Log.wrn("Save Module", e.getMessage()); Log.err("Save Module", e.getMessage()); @@ -2457,7 +2332,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private void savePackage(int index) { - OpeningPackageType opt = openingPackageList.getOpeningPackageByIndex(index); + OpeningPackageType opt = GlobalData.openingPackageList.getOpeningPackageByIndex(index); if (opt.isNew()) { if (getNewFilePath(DataType.PACKAGE_SURFACE_AREA_EXT) != JFileChooser.APPROVE_OPTION) { return; @@ -2465,8 +2340,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } try { SaveFile.saveSpdFile(opt.getId().getPath(), opt.getXmlSpd()); - openingPackageList.setNew(opt.getId(), false); - openingPackageList.setPackageSaved(opt.getId(), true); + GlobalData.openingPackageList.setNew(opt.getId(), false); + GlobalData.openingPackageList.setPackageSaved(opt.getId(), true); } catch (Exception e) { Log.wrn("Save Package", e.getMessage()); Log.err("Save Package", e.getMessage()); @@ -2478,7 +2353,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private void savePlatform(int index) { - OpeningPlatformType opt = openingPlatformList.getOpeningPlatformByIndex(index); + OpeningPlatformType opt = GlobalData.openingPlatformList.getOpeningPlatformByIndex(index); if (opt.isNew()) { if (getNewFilePath(DataType.PACKAGE_SURFACE_AREA_EXT) != JFileChooser.APPROVE_OPTION) { return; @@ -2486,34 +2361,21 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } try { SaveFile.saveFpdFile(opt.getId().getPath(), opt.getXmlFpd()); - openingPlatformList.setNew(opt.getId(), false); - openingPlatformList.setPlatformSaved(opt.getId(), true); + GlobalData.openingPlatformList.setNew(opt.getId(), false); + GlobalData.openingPlatformList.setPlatformSaved(opt.getId(), true); } catch (Exception e) { Log.wrn("Save Package", e.getMessage()); Log.err("Save Package", e.getMessage()); } } - public void componentHidden(ComponentEvent arg0) { - // TODO Auto-generated method stub - - } - - public void componentMoved(ComponentEvent arg0) { - // TODO Auto-generated method stub - - } - public void componentResized(ComponentEvent arg0) { - this.jSplitPane.setSize(this.getWidth() - DataType.MAIN_FRAME_WIDTH_SPACING, - this.getHeight() - DataType.MAIN_FRAME_HEIGHT_SPACING); - this.jSplitPane.validate(); - resizeDesktopPanel(); - } - - public void componentShown(ComponentEvent arg0) { - // TODO Auto-generated method stub - + if (this.jSplitPane != null) { + this.jSplitPane.setSize(this.getWidth() - DataType.MAIN_FRAME_WIDTH_SPACING, + this.getHeight() - DataType.MAIN_FRAME_HEIGHT_SPACING); + this.jSplitPane.validate(); + resizeDesktopPanel(); + } } /** @@ -2537,18 +2399,11 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } } - private void getCompontentsFromFrameworkDatabase() { - this.vModuleList = wt.getAllModules(); - this.vPackageList = wt.getAllPackages(); - this.vPlatformList = wt.getAllPlatforms(); - } - private void insertModuleTreeNode(Identification id) { - iTree.addNode(new IDefaultMutableTreeNode("Module Definitions", IDefaultMutableTreeNode.MSA_MODULEDEFINITIONS, - true, id)); + iTree.addNode(new IDefaultMutableTreeNode("Module Header", IDefaultMutableTreeNode.MSA_HEADER, true, id)); + iTree.addNode(new IDefaultMutableTreeNode("Source Files", IDefaultMutableTreeNode.MSA_SOURCEFILES, true, id)); iTree.addNode(new IDefaultMutableTreeNode("Library Class Definitions", IDefaultMutableTreeNode.MSA_LIBRARYCLASSDEFINITIONS, true, id)); - iTree.addNode(new IDefaultMutableTreeNode("Source Files", IDefaultMutableTreeNode.MSA_SOURCEFILES, true, id)); iTree.addNode(new IDefaultMutableTreeNode("Package Dependencies", IDefaultMutableTreeNode.MSA_PACKAGEDEPENDENCIES, true, id)); iTree.addNode(new IDefaultMutableTreeNode("Protocols", IDefaultMutableTreeNode.MSA_PROTOCOLS, true, id)); @@ -2566,12 +2421,11 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } private void insertPackageTreeNode(Identification id) { - iTree.addNode(new IDefaultMutableTreeNode("Package Definitions", - IDefaultMutableTreeNode.SPD_PACKAGEDEFINITIONS, true, id)); + iTree.addNode(new IDefaultMutableTreeNode("Package Header", IDefaultMutableTreeNode.SPD_HEADER, true, id)); iTree.addNode(new IDefaultMutableTreeNode("Library Class Declarations", IDefaultMutableTreeNode.SPD_LIBRARYCLASSDECLARATIONS, true, id)); iTree.addNode(new IDefaultMutableTreeNode("Msa Files", IDefaultMutableTreeNode.SPD_MSAFILES, false, id)); - iTree.addNode(new IDefaultMutableTreeNode("Package Headers", IDefaultMutableTreeNode.SPD_PACKAGEHEADERS, true, + iTree.addNode(new IDefaultMutableTreeNode("Package Includes", IDefaultMutableTreeNode.SPD_PACKAGEHEADERS, true, id)); iTree.addNode(new IDefaultMutableTreeNode("Guid Declarations", IDefaultMutableTreeNode.SPD_GUIDDECLARATIONS, true, id)); @@ -2584,6 +2438,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } private void insertPlatformTreeNode(Identification id) { + iTree.addNode(new IDefaultMutableTreeNode("Platform Header", IDefaultMutableTreeNode.FPD_PLATFORMHEADER, true, + id)); iTree.addNode(new IDefaultMutableTreeNode("Platform Definitions", IDefaultMutableTreeNode.FPD_PLATFORMDEFINITIONS, true, id)); iTree.addNode(new IDefaultMutableTreeNode("Flash", IDefaultMutableTreeNode.FPD_FLASH, true, id)); @@ -2599,57 +2455,74 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private void doubleClickModuleTreeNode() { - Identification id = iTree.getSelectNode().getId(); - int intCategory = iTree.getSelectCategory(); + Identification id = null; + int intCategory = -1; String path = null; + boolean isOpen = false; try { - // - // If the node is not opened yet - // Insert top level elements first - // - //if (intCategory == IDefaultMutableTreeNode.MSA_HEADER || intCategory == IDefaultMutableTreeNode.SPD_MSAFILES) { - if (intCategory == IDefaultMutableTreeNode.MSA_HEADER) { + id = iTree.getSelectNode().getId(); + intCategory = iTree.getSelectCategory(); + isOpen = iTree.getSelectNode().isOpening(); + + if (!isOpen) { + // + // If the node is not opened yet + // Insert top level elements first + // + if (intCategory == IDefaultMutableTreeNode.MODULE) { - if (intCategory == IDefaultMutableTreeNode.MSA_HEADER) { + if (intCategory == IDefaultMutableTreeNode.MODULE) { + path = iTree.getSelectNode().getId().getPath(); + } + if (intCategory == IDefaultMutableTreeNode.PACKAGE) { + path = iTree.getSelectNode().getId().getPath(); + } + openModule(path); + return; + } + if (intCategory == IDefaultMutableTreeNode.PACKAGE) { path = iTree.getSelectNode().getId().getPath(); + openPackage(path); + return; } - if (intCategory == IDefaultMutableTreeNode.SPD_MSAFILES) { + if (intCategory == IDefaultMutableTreeNode.PLATFORM) { path = iTree.getSelectNode().getId().getPath(); + openPlatform(path); + return; } - openModule(path); - return; - } - if (intCategory == IDefaultMutableTreeNode.SPD_HEADER) { - path = iTree.getSelectNode().getId().getPath(); - openPackage(path); - return; - } - if (intCategory == IDefaultMutableTreeNode.FPD_PLATFORMHEADER) { - path = iTree.getSelectNode().getId().getPath(); - openPlatform(path); - return; } + // // Show editor panel // if (intCategory >= IDefaultMutableTreeNode.MSA_HEADER && intCategory < IDefaultMutableTreeNode.SPD_HEADER) { - showModuleElement(intCategory, openingModuleList.getOpeningModuleById(id)); - this.currentOpeningModuleIndex = openingModuleList.findIndexOfListById(id); + showModuleElement(intCategory, + GlobalData.openingModuleList.getOpeningModuleById(new ModuleIdentification(id))); + this.currentOpeningModuleIndex = GlobalData.openingModuleList + .findIndexOfListById(new ModuleIdentification( + id)); } if (intCategory >= IDefaultMutableTreeNode.SPD_HEADER && intCategory < IDefaultMutableTreeNode.FPD_PLATFORMHEADER) { - showPackageElement(intCategory, openingPackageList.getOpeningPackageById(id)); - this.currentOpeningPackageIndex = openingPackageList.findIndexOfListById(id); + showPackageElement(intCategory, + GlobalData.openingPackageList.getOpeningPackageById(new PackageIdentification(id))); + this.currentOpeningPackageIndex = GlobalData.openingPackageList + .findIndexOfListById(new PackageIdentification( + id)); } if (intCategory >= IDefaultMutableTreeNode.FPD_PLATFORMHEADER) { - showPlatformElement(intCategory, openingPlatformList.getOpeningPlatformById(id)); - this.currentOpeningPlatformIndex = openingPlatformList.findIndexOfListById(id); + showPlatformElement( + intCategory, + GlobalData.openingPlatformList + .getOpeningPlatformById(new PlatformIdentification(id))); + this.currentOpeningPlatformIndex = GlobalData.openingPlatformList + .findIndexOfListById(new PlatformIdentification( + id)); } } catch (RuntimeException e) { - Log.log("double click category: " + intCategory); - Log.log("double click id path: " + id.getPath()); - Log.log("double click exception: " + e.getMessage()); - e.printStackTrace(); + Log.err("double click category: " + intCategory); + Log.err("double click id path: " + id); + Log.err("double click exception: " + e.getMessage()); } } @@ -2708,10 +2581,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele SpdHeader frmSpdHeader = new SpdHeader(spd); getJDesktopPanePackage().add(frmSpdHeader, 1); break; - case IDefaultMutableTreeNode.SPD_PACKAGEDEFINITIONS: - SpdPackageDefinitions frmSpdPackageDefinitions = new SpdPackageDefinitions(spd); - getJDesktopPanePackage().add(frmSpdPackageDefinitions, 1); - break; case IDefaultMutableTreeNode.SPD_LIBRARYCLASSDECLARATIONS: SpdLibClassDecls frmSlcd = new SpdLibClassDecls(spd); getJDesktopPanePackage().add(frmSlcd, 1); @@ -2759,10 +2628,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele MsaHeader frmMsaHeader = new MsaHeader(msa); getJDesktopPaneModule().add(frmMsaHeader, 1); break; - case IDefaultMutableTreeNode.MSA_MODULEDEFINITIONS: - ModuleDefinitions frmMd = new ModuleDefinitions(msa); - getJDesktopPaneModule().add(frmMd, 1); - break; case IDefaultMutableTreeNode.MSA_LIBRARYCLASSDEFINITIONS: ModuleLibraryClassDefinitions frmMlcd = new ModuleLibraryClassDefinitions(msa); getJDesktopPaneModule().add(frmMlcd, 1); @@ -2858,26 +2723,47 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele smb.dispose(); return; } else if (result == DataType.RETURN_TYPE_OK) { - PackageSurfaceAreaDocument.PackageSurfaceArea psa = null; - if (this.openingPackageList.existsPackage(smb.getMid().getPackageId())) { - psa = openingPackageList.getPackageSurfaceAreaFromId(smb.getMid().getPackageId()); - } - try { - wt.addModuleToPackage(smb.getMid(), psa); - } catch (IOException e) { - Log.wrn("Upddate MsaFiles of Package", e.getMessage()); - Log.err("Upddate MsaFiles of Package", e.getMessage()); - return; - } catch (XmlException e) { - Log.wrn("Upddate MsaFiles of Package", e.getMessage()); - Log.err("Upddate MsaFiles of Package", e.getMessage()); - return; - } catch (Exception e) { - Log.wrn("Upddate MsaFiles of Package", e.getMessage()); - Log.err("Upddate MsaFiles of Package", e.getMessage()); - return; + ModuleIdentification mid = smb.getMid(); + if (mid != null) { + // + // Update package of workspace first + // + PackageSurfaceAreaDocument.PackageSurfaceArea psa = null; + if (GlobalData.openingPackageList.existsPackage(mid.getPackageId())) { + psa = GlobalData.openingPackageList.getPackageSurfaceAreaFromId(mid.getPackageId()); + } + try { + wt.addModuleToPackage(mid, psa); + } catch (IOException e) { + Log.wrn("Upddate MsaFiles of Package", e.getMessage()); + Log.err("Upddate MsaFiles of Package", e.getMessage()); + return; + } catch (XmlException e) { + Log.wrn("Upddate MsaFiles of Package", e.getMessage()); + Log.err("Upddate MsaFiles of Package", e.getMessage()); + return; + } catch (Exception e) { + Log.wrn("Upddate MsaFiles of Package", e.getMessage()); + Log.err("Upddate MsaFiles of Package", e.getMessage()); + return; + } + + // + // Update Global Data + // + GlobalData.openingModuleList.insertToOpeningModuleList(mid, smb.getMsa()); + GlobalData.vModuleList.addElement(mid); + + // + // Create new node on the tree + // + addModuleToTree(mid); + + // + // Open the node + // + this.openModule(mid.getPath()); } - this.openModule(smb.getMid().getPath(), smb.getMid()); } } else if (result == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) { // @@ -2891,31 +2777,37 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele smb.dispose(); return; } else if (result == DataType.RETURN_TYPE_OK) { - try { - wt.addPackageToDatabase(smb.getPid()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - vPackageList.addElement(smb.getPid()); + PackageIdentification pid = smb.getPid(); + if (pid != null) { + try { + wt.addPackageToDatabase(smb.getPid()); + } catch (Exception e) { + Log.err("addPackageToDatabase", e.getMessage()); + } - // - // Add to Module Description node - // - IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(vPackageList.lastElement().getName(), - IDefaultMutableTreeNode.MODULE_PACKAGE, - false, vPackageList.lastElement()); + // + // Update Global Data + // + GlobalData.openingPackageList.insertToOpeningPackageList(pid, smb.getSpd()); + GlobalData.vPackageList.addElement(pid); - iTree.addNode(dmtnModuleDescription, node); + // + // Add to Module Description node + // + IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(pid.getName(), + IDefaultMutableTreeNode.MODULE_PACKAGE, + false, pid); - // - // Add new SpdHeader node to the tree - // - node = new IDefaultMutableTreeNode(vPackageList.lastElement().getName(), - IDefaultMutableTreeNode.SPD_HEADER, true, vPackageList.lastElement()); - iTree.addNode(dmtnPackageDescription, node); + iTree.addNode(dmtnModuleDescription, node); - this.openPackage(smb.getPid().getPath()); + // + // Add new SpdHeader node to the tree + // + node = new IDefaultMutableTreeNode(pid.getName(), IDefaultMutableTreeNode.PACKAGE, true, pid); + iTree.addNode(dmtnPackageDescription, node); + + this.openPackage(pid.getPath()); + } } } else if (result == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) { // @@ -2929,21 +2821,28 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele smb.dispose(); return; } else if (result == DataType.RETURN_TYPE_OK) { - try { - wt.addPlatformToDatabase(smb.getFid()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); + PlatformIdentification fid = smb.getFid(); + if (fid != null) { + try { + wt.addPlatformToDatabase(fid); + } catch (Exception e) { + Log.err("addPlatformToDatabase", e.getMessage()); + } + + // + // Update global data + // + GlobalData.openingPlatformList.insertToOpeningPlatformList(fid, smb.getFpd()); + GlobalData.vPlatformList.addElement(fid); + // + // Add new SpdHeader node to the tree + // + IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(fid.getName(), + IDefaultMutableTreeNode.PLATFORM, true, + fid); + iTree.addNode(dmtnPlatformDescription, node); + this.openPlatform(fid.getPath()); } - vPlatformList.addElement(smb.getFid()); - // - // Add new SpdHeader node to the tree - // - IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(vPlatformList.lastElement().getName(), - IDefaultMutableTreeNode.FPD_PLATFORMHEADER, - true, vPlatformList.lastElement()); - iTree.addNode(dmtnPlatformDescription, node); - this.openPlatform(smb.getFid().getPath()); } } } @@ -2989,7 +2888,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // case 0: if (this.currentOpeningModuleIndex > -1) { - if (!openingModuleList.getModuleSaved(currentOpeningModuleIndex)) { + if (!GlobalData.openingModuleList.getModuleSaved(currentOpeningModuleIndex)) { int result = showSaveDialog(); if (result == JOptionPane.YES_OPTION) { this.saveAll(); @@ -3001,18 +2900,20 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele return; } } - iTree.removeNodeChildrenByPath(openingModuleList.getTreePathByIndex(currentOpeningModuleIndex)); - this.openingModuleList.removeFromOpeningModuleListByIndex(this.currentOpeningModuleIndex); + iTree + .removeNodeChildrenByPath(GlobalData.openingModuleList + .getTreePathByIndex(currentOpeningModuleIndex)); + GlobalData.openingModuleList.setModuleOpen(this.currentOpeningModuleIndex, false); this.cleanDesktopPaneModule(); this.currentOpeningModuleIndex = -1; } break; // // Current is package - // + // case 1: if (this.currentOpeningPackageIndex > -1) { - if (!openingPackageList.getPackageSaved(currentOpeningPackageIndex)) { + if (!GlobalData.openingPackageList.getPackageSaved(currentOpeningPackageIndex)) { int result = showSaveDialog(); if (result == JOptionPane.YES_OPTION) { this.saveAll(); @@ -3024,8 +2925,10 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele return; } } - iTree.removeNodeChildrenByPath(openingPackageList.getTreePathByIndex(currentOpeningPackageIndex)); - this.openingPackageList.removeFromOpeningPackageListByIndex(this.currentOpeningPackageIndex); + iTree + .removeNodeChildrenByPath(GlobalData.openingPackageList + .getTreePathByIndex(currentOpeningPackageIndex)); + GlobalData.openingPackageList.setPackageOpen(this.currentOpeningPackageIndex, false); this.cleanDesktopPanePackage(); this.currentOpeningPackageIndex = -1; } @@ -3035,7 +2938,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // case 2: if (this.currentOpeningPlatformIndex > -1) { - if (!openingPlatformList.getPlatformSaved(currentOpeningPlatformIndex)) { + if (!GlobalData.openingPlatformList.getPlatformSaved(currentOpeningPlatformIndex)) { int result = showSaveDialog(); if (result == JOptionPane.YES_OPTION) { this.saveAll(); @@ -3047,8 +2950,10 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele return; } } - iTree.removeNodeChildrenByPath(openingPlatformList.getTreePathByIndex(currentOpeningPlatformIndex)); - this.openingPlatformList.removeFromOpeningPlatformListByIndex(this.currentOpeningPlatformIndex); + iTree + .removeNodeChildrenByPath(GlobalData.openingPlatformList + .getTreePathByIndex(currentOpeningPlatformIndex)); + GlobalData.openingPlatformList.setPlatformOpen(this.currentOpeningPlatformIndex, false); this.cleanDesktopPanePlatform(); this.currentOpeningPlatformIndex = -1; } @@ -3062,23 +2967,25 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private void closeAll() { int result = -1; - if (!openingModuleList.isSaved() || !openingPackageList.isSaved() || !openingPlatformList.isSaved()) { + if (!GlobalData.openingModuleList.isSaved() || !GlobalData.openingPackageList.isSaved() + || !GlobalData.openingPlatformList.isSaved()) { result = showSaveDialog(); } if (result == JOptionPane.YES_OPTION) { this.saveAll(); } if (result == JOptionPane.NO_OPTION) { + // // Do nothing + // } if (result == JOptionPane.CANCEL_OPTION) { return; } this.cleanDesktopPane(); - this.getCompontentsFromFrameworkDatabase(); - openingModuleList.removeAllFromOpeningModuleList(); - openingPackageList.removeAllFromOpeningPackageList(); - openingPlatformList.removeAllFromOpeningPlatformList(); + GlobalData.openingModuleList.closeAll(); + GlobalData.openingPackageList.closeAll(); + GlobalData.openingPlatformList.closeAll(); this.makeEmptyTree(); } @@ -3114,8 +3021,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // // Save all modules // - for (int index = 0; index < openingModuleList.size(); index++) { - if (!openingModuleList.getModuleSaved(index)) { + for (int index = 0; index < GlobalData.openingModuleList.size(); index++) { + if (!GlobalData.openingModuleList.getModuleSaved(index)) { saveModule(index); } } @@ -3123,8 +3030,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // // Save all packages // - for (int index = 0; index < openingPackageList.size(); index++) { - if (!openingPackageList.getPackageSaved(index)) { + for (int index = 0; index < GlobalData.openingPackageList.size(); index++) { + if (!GlobalData.openingPackageList.getPackageSaved(index)) { savePackage(index); } } @@ -3132,8 +3039,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // // Save all platforms // - for (int index = 0; index < openingPlatformList.size(); index++) { - if (!openingPlatformList.getPlatformSaved(index)) { + for (int index = 0; index < GlobalData.openingPlatformList.size(); index++) { + if (!GlobalData.openingPlatformList.getPlatformSaved(index)) { savePlatform(index); } } @@ -3145,7 +3052,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele **/ private void exit() { int result = -1; - if (!openingModuleList.isSaved() || !openingPackageList.isSaved() || !openingPlatformList.isSaved()) { + if (!GlobalData.openingModuleList.isSaved() || !GlobalData.openingPackageList.isSaved() + || !GlobalData.openingPlatformList.isSaved()) { result = showSaveDialog(); } if (result == JOptionPane.YES_OPTION) { @@ -3161,6 +3069,15 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele System.exit(0); } + /** + To find all defined PPIs in workspace + + **/ +// private void findPpi() { +// FindPPIsResult fpr = FindPPIsResult.getInstance(); +// fpr.setVisible(true); +// } + /** Switch current workspace to others @@ -3177,10 +3094,77 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele closeAll(); this.setTitle(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION + " " + "- [" + Workspace.getCurrentWorkspace() + "]"); + // + // Reinit Global Data + // + GlobalData.init(); } sw.dispose(); } + /** + To create a Far file from current workspace + + **/ + private void createFar() { + CreateStepOne cso = new CreateStepOne(this, true); + int result = cso.showDialog(); + if (result == DataType.RETURN_TYPE_OK) { + String strReturn = "Create Far Done!"; + JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, + JOptionPane.INFORMATION_MESSAGE); + } + cso.dispose(); + } + + /** + To install a Far file to current workspace + + **/ + private void installFar() { + InstallStepOne iso = new InstallStepOne(this, true); + int result = iso.showDialog(); + if (result == DataType.RETURN_TYPE_OK) { + String strReturn = "Install Far Done!
The WORKSPACE will be refreshed!"; + JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, + JOptionPane.INFORMATION_MESSAGE); + this.closeAll(); + } + iso.dispose(); + } + + /** + To remove a Far's items from current workspace + + **/ + private void removeFar() { + DeleteStepOne dso = new DeleteStepOne(this, true); + int result = dso.showDialog(); + if (result == DataType.RETURN_TYPE_OK) { + String strReturn = "Delete Far Done!
The WORKSPACE will be refreshed!"; + JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, + JOptionPane.INFORMATION_MESSAGE); + this.closeAll(); + } + dso.dispose(); + } + + /** + To update an existing Far file + + **/ + private void updateFar() { + UpdateStepOne uso = new UpdateStepOne(this, true); + int result = uso.showDialog(); + if (result == DataType.RETURN_TYPE_OK) { + String strReturn = "Update Far Done!
The WORKSPACE will be refreshed!"; + JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, + JOptionPane.INFORMATION_MESSAGE); + this.closeAll(); + } + uso.dispose(); + } + /** Show Tool Chain Configuration Dialog to setup Tool Chain @@ -3190,6 +3174,10 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele tcc.showDialog(); } + private void configBuildPreferences() { + Preferences bt = Preferences.getInstance(); + bt.showDialog(); + } /** Clone selected item @@ -3237,29 +3225,30 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } if (result == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) { Tools.showInformationMessage("Module Surface Area Clone Finished"); - vModuleList.addElement(c.getMid()); + GlobalData.vModuleList.addElement(c.getMid()); addModuleToTree(c.getMid()); } if (result == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) { Tools.showInformationMessage("Package Surface Area Clone Finished"); - vPackageList.addElement(c.getPid()); + GlobalData.vPackageList.addElement(c.getPid()); // // Add new SpdHeader node to the tree // - IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(vPackageList.lastElement().getName(), + IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(GlobalData.vPackageList.lastElement().getName(), IDefaultMutableTreeNode.SPD_HEADER, true, - vPackageList.lastElement()); + GlobalData.vPackageList.lastElement()); iTree.addNode(dmtnPackageDescription, node); } if (result == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) { Tools.showInformationMessage("Platform Surface Area Clone Finished"); - vPlatformList.addElement(c.getFid()); + GlobalData.vPlatformList.addElement(c.getFid()); // // Add new SpdHeader node to the tree // - IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(vPlatformList.lastElement().getName(), + IDefaultMutableTreeNode node = new IDefaultMutableTreeNode( + GlobalData.vPlatformList.lastElement().getName(), IDefaultMutableTreeNode.FPD_PLATFORMHEADER, - true, vPlatformList.lastElement()); + true, GlobalData.vPlatformList.lastElement()); iTree.addNode(dmtnPlatformDescription, node); //this.openPlatform(c.getFid().getPath()); } @@ -3288,18 +3277,22 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // // Enable close/close all if some files are opened // - jMenuItemFileClose.setEnabled(openingModuleList.isOpend() || openingPackageList.isOpend() - || openingPlatformList.isOpend()); - jMenuItemFileCloseAll.setEnabled(openingModuleList.isOpend() || openingPackageList.isOpend() - || openingPlatformList.isOpend()); + jMenuItemFileClose.setEnabled(GlobalData.openingModuleList.isOpen() + || GlobalData.openingPackageList.isOpen() + || GlobalData.openingPlatformList.isOpen()); + jMenuItemFileCloseAll.setEnabled(GlobalData.openingModuleList.isOpen() + || GlobalData.openingPackageList.isOpen() + || GlobalData.openingPlatformList.isOpen()); // // Enable save/save all if some files are changed // - jMenuItemFileSave.setEnabled(!openingModuleList.isSaved() || !openingPackageList.isSaved() - || !openingPlatformList.isSaved()); - jMenuItemFileSaveAll.setEnabled(!openingModuleList.isSaved() || !openingPackageList.isSaved() - || !openingPlatformList.isSaved()); + jMenuItemFileSave.setEnabled(!GlobalData.openingModuleList.isSaved() + || !GlobalData.openingPackageList.isSaved() + || !GlobalData.openingPlatformList.isSaved()); + jMenuItemFileSaveAll.setEnabled(!GlobalData.openingModuleList.isSaved() + || !GlobalData.openingPackageList.isSaved() + || !GlobalData.openingPlatformList.isSaved()); } if (arg0.getSource() == jMenuTools) {