d97c61a20c808d484440e4f896ae7d8f2f636c44
[people/mcb30/edk2.git] / edk2 / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / FrameworkWizardUI.java
1 /** @file\r
2  \r
3  The main GUI for module editor. \r
4  \r
5  Copyright (c) 2006, Intel Corporation\r
6  All rights reserved. This program and the accompanying materials\r
7  are licensed and made available under the terms and conditions of the BSD License\r
8  which accompanies this distribution.  The full text of the license may be found at\r
9  http://opensource.org/licenses/bsd-license.php\r
10  \r
11  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13  \r
14  **/\r
15 \r
16 package org.tianocore.frameworkwizard;\r
17 \r
18 import java.awt.event.ActionEvent;\r
19 import java.awt.event.ComponentEvent;\r
20 import java.awt.event.MouseEvent;\r
21 import java.awt.event.MouseListener;\r
22 import java.awt.event.WindowEvent;\r
23 import java.io.IOException;\r
24 import java.util.Vector;\r
25 \r
26 import javax.swing.JButton;\r
27 import javax.swing.JCheckBoxMenuItem;\r
28 import javax.swing.JDesktopPane;\r
29 import javax.swing.JFileChooser;\r
30 import javax.swing.JFrame;\r
31 import javax.swing.JInternalFrame;\r
32 import javax.swing.JMenu;\r
33 import javax.swing.JMenuBar;\r
34 import javax.swing.JMenuItem;\r
35 import javax.swing.JOptionPane;\r
36 import javax.swing.JPanel;\r
37 import javax.swing.JScrollPane;\r
38 import javax.swing.JSplitPane;\r
39 import javax.swing.JTabbedPane;\r
40 import javax.swing.event.MenuEvent;\r
41 import javax.swing.event.MenuListener;\r
42 import javax.swing.event.TreeSelectionEvent;\r
43 import javax.swing.event.TreeSelectionListener;\r
44 \r
45 import org.apache.xmlbeans.XmlException;\r
46 import org.tianocore.PackageSurfaceAreaDocument;\r
47 import org.tianocore.frameworkwizard.common.DataType;\r
48 import org.tianocore.frameworkwizard.common.GlobalData;\r
49 import org.tianocore.frameworkwizard.common.IFileFilter;\r
50 import org.tianocore.frameworkwizard.common.Log;\r
51 import org.tianocore.frameworkwizard.common.SaveFile;\r
52 import org.tianocore.frameworkwizard.common.Tools;\r
53 import org.tianocore.frameworkwizard.common.Identifications.Identification;\r
54 import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;\r
55 import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;\r
56 import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;\r
57 //import org.tianocore.frameworkwizard.common.find.FindPPIsResult;\r
58 import org.tianocore.frameworkwizard.common.ui.IDefaultMutableTreeNode;\r
59 import org.tianocore.frameworkwizard.common.ui.IDesktopManager;\r
60 import org.tianocore.frameworkwizard.common.ui.IFrame;\r
61 import org.tianocore.frameworkwizard.common.ui.ITree;\r
62 import org.tianocore.frameworkwizard.far.createui.CreateStepOne;\r
63 import org.tianocore.frameworkwizard.far.deleteui.DeleteStepOne;\r
64 import org.tianocore.frameworkwizard.far.installui.InstallStepOne;\r
65 import org.tianocore.frameworkwizard.far.updateui.UpdateStepOne;\r
66 import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
67 import org.tianocore.frameworkwizard.module.ui.ModuleBootModes;\r
68 import org.tianocore.frameworkwizard.module.ui.ModuleDataHubs;\r
69 import org.tianocore.frameworkwizard.module.ui.ModuleEvents;\r
70 import org.tianocore.frameworkwizard.module.ui.ModuleExterns;\r
71 import org.tianocore.frameworkwizard.module.ui.ModuleGuids;\r
72 import org.tianocore.frameworkwizard.module.ui.ModuleHiiPackages;\r
73 import org.tianocore.frameworkwizard.module.ui.ModuleHobs;\r
74 import org.tianocore.frameworkwizard.module.ui.ModuleLibraryClassDefinitions;\r
75 import org.tianocore.frameworkwizard.module.ui.ModulePCDs;\r
76 import org.tianocore.frameworkwizard.module.ui.ModulePackageDependencies;\r
77 import org.tianocore.frameworkwizard.module.ui.ModulePpis;\r
78 import org.tianocore.frameworkwizard.module.ui.ModuleProtocols;\r
79 import org.tianocore.frameworkwizard.module.ui.ModuleSourceFiles;\r
80 import org.tianocore.frameworkwizard.module.ui.ModuleSystemTables;\r
81 import org.tianocore.frameworkwizard.module.ui.ModuleVariables;\r
82 import org.tianocore.frameworkwizard.module.ui.MsaHeader;\r
83 import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
84 import org.tianocore.frameworkwizard.packaging.ui.SpdGuidDecls;\r
85 import org.tianocore.frameworkwizard.packaging.ui.SpdHeader;\r
86 import org.tianocore.frameworkwizard.packaging.ui.SpdLibClassDecls;\r
87 import org.tianocore.frameworkwizard.packaging.ui.SpdMsaFiles;\r
88 import org.tianocore.frameworkwizard.packaging.ui.SpdPackageHeaders;\r
89 import org.tianocore.frameworkwizard.packaging.ui.SpdPcdDefs;\r
90 import org.tianocore.frameworkwizard.packaging.ui.SpdPpiDecls;\r
91 import org.tianocore.frameworkwizard.packaging.ui.SpdProtocolDecls;\r
92 import org.tianocore.frameworkwizard.platform.PlatformIdentification;\r
93 import org.tianocore.frameworkwizard.platform.ui.FpdBuildOptions;\r
94 import org.tianocore.frameworkwizard.platform.ui.FpdDynamicPcdBuildDefinitions;\r
95 import org.tianocore.frameworkwizard.platform.ui.FpdFlash;\r
96 import org.tianocore.frameworkwizard.platform.ui.FpdFrameworkModules;\r
97 import org.tianocore.frameworkwizard.platform.ui.FpdHeader;\r
98 import org.tianocore.frameworkwizard.platform.ui.FpdPlatformDefs;\r
99 import org.tianocore.frameworkwizard.workspace.Workspace;\r
100 import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
101 import org.tianocore.frameworkwizard.workspace.ui.SwitchWorkspace;\r
102 \r
103 /**\r
104  The class is used to show main GUI of FrameworkWizard\r
105  It extends IFrame implements MouseListener, TreeSelectionListener, ComponentListener and MenuListener\r
106 \r
107  **/\r
108 public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSelectionListener, MenuListener {\r
109     ///\r
110     /// Define class Serial Version UID\r
111     ///\r
112     private static final long serialVersionUID = -7103240960573031772L;\r
113 \r
114     ///\r
115     /// Used to record current operation target\r
116     ///\r
117     private int currentOpeningModuleIndex = -1;\r
118 \r
119     private int currentOpeningPackageIndex = -1;\r
120 \r
121     private int currentOpeningPlatformIndex = -1;\r
122 \r
123     ///\r
124     /// Used to generate tree structure\r
125     ///\r
126     private IDefaultMutableTreeNode dmtnRoot = null;\r
127 \r
128     private IDefaultMutableTreeNode dmtnModuleDescription = null;\r
129 \r
130     private IDefaultMutableTreeNode dmtnPackageDescription = null;\r
131 \r
132     private IDefaultMutableTreeNode dmtnPlatformDescription = null;\r
133 \r
134     ///\r
135     /// Used for UI\r
136     ///\r
137     private JPanel jContentPane = null;\r
138 \r
139     private JMenuBar jMenuBar = null;\r
140 \r
141     private JMenu jMenuFile = null;\r
142 \r
143     private JMenuItem jMenuItemFileNew = null;\r
144 \r
145     private JMenuItem jMenuItemFileSaveAs = null;\r
146 \r
147     private JMenuItem jMenuItemFileExit = null;\r
148 \r
149     private JMenu jMenuEdit = null;\r
150 \r
151     private JDesktopPane jDesktopPaneModule = null;\r
152 \r
153     private JDesktopPane jDesktopPanePackage = null;\r
154 \r
155     private JDesktopPane jDesktopPanePlatform = null;\r
156 \r
157     private JTabbedPane jTabbedPaneTree = null;\r
158 \r
159     private JTabbedPane jTabbedPaneEditor = null;\r
160 \r
161     private IDesktopManager iDesktopManager = new IDesktopManager();\r
162 \r
163     private JScrollPane jScrollPaneTree = null;\r
164 \r
165     private ITree iTree = null;\r
166 \r
167     private JMenu jMenuHelp = null;\r
168 \r
169     private JMenuItem jMenuItemHelpAbout = null;\r
170 \r
171     private JMenuItem jMenuItemEditDelete = null;\r
172 \r
173     private WorkspaceTools wt = new WorkspaceTools();\r
174 \r
175     private JMenuItem jMenuItemFileSave = null;\r
176 \r
177     private JMenuItem jMenuItemFileClose = null;\r
178 \r
179     private JMenu jMenuTools = null;\r
180 \r
181     private JMenu jMenuWindow = null;\r
182 \r
183     private JPanel jPanelOperation = null;\r
184 \r
185     private JButton jButtonOk = null;\r
186 \r
187     private JButton jButtonCancel = null;\r
188 \r
189     private JMenuItem jMenuItemFileOpen = null;\r
190 \r
191     private JMenuItem jMenuItemFileCloseAll = null;\r
192 \r
193     private JMenuItem jMenuItemFileSaveAll = null;\r
194 \r
195     private JMenuItem jMenuItemFilePageSetup = null;\r
196 \r
197     private JMenuItem jMenuItemFilePrint = null;\r
198 \r
199     private JMenuItem jMenuItemFileImport = null;\r
200 \r
201     private JMenuItem jMenuItemFileProperties = null;\r
202 \r
203     private JMenu jMenuFileRecentFiles = null;\r
204 \r
205     private JSplitPane jSplitPane = null;\r
206 \r
207     private JMenuItem jMenuItemEditUndo = null;\r
208 \r
209     private JMenuItem jMenuItemEditRedo = null;\r
210 \r
211     private JMenuItem jMenuItemEditCut = null;\r
212 \r
213     private JMenuItem jMenuItemEditCopy = null;\r
214 \r
215     private JMenuItem jMenuItemEditPaste = null;\r
216 \r
217     private JMenuItem jMenuItemEditSelectAll = null;\r
218 \r
219     private JMenuItem jMenuItemEditFindNext = null;\r
220 \r
221     private JMenu jMenuView = null;\r
222 \r
223     private JMenu jMenuViewToolbars = null;\r
224 \r
225     private JCheckBoxMenuItem jCheckBoxMenuItemViewToolbarsFile = null;\r
226 \r
227     private JCheckBoxMenuItem jCheckBoxMenuItemViewToolbarsEdit = null;\r
228 \r
229     private JCheckBoxMenuItem jCheckBoxMenuItemViewToolbarsWindow = null;\r
230 \r
231     private JMenuItem jMenuItemViewStandard = null;\r
232 \r
233     private JMenuItem jMenuItemViewAdvanced = null;\r
234 \r
235     private JMenu jMenuProject = null;\r
236 \r
237     private JMenuItem jMenuItemProjectAdmin = null;\r
238 \r
239     private JMenuItem jMenuItemProjectChangeWorkspace = null;\r
240 \r
241     private JMenu jMenuProjectBuildTargets = null;\r
242 \r
243     private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsDebug = null;\r
244 \r
245     private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsRelease = null;\r
246 \r
247     private JMenuItem jMenuItemToolsToolChainConfiguration = null;\r
248 \r
249     private JMenuItem jMenuItemToolsClone = null;\r
250 \r
251     private JMenuItem jMenuItemToolsCodeScan = null;\r
252 \r
253     private JMenuItem jMenuItemWindowDisplaySide = null;\r
254 \r
255     private JMenuItem jMenuItemWindowDisplayTopBottom = null;\r
256 \r
257     private JMenuItem jMenuItemViewXML = null;\r
258 \r
259     private JMenuItem jMenuItemWindowTabView = null;\r
260 \r
261     private JMenuItem jMenuItemWindowSource = null;\r
262 \r
263     private JMenuItem jMenuItemWindowXML = null;\r
264 \r
265     private JMenuItem jMenuItemWindowPreferences = null;\r
266 \r
267     private JMenuItem jMenuItemHelpContents = null;\r
268 \r
269     private JMenuItem jMenuItemHelpIndex = null;\r
270 \r
271     private JMenuItem jMenuItemHelpSearch = null;\r
272 \r
273     private JMenuItem jMenuItemProjectInstallFar = null;\r
274 \r
275     private JMenuItem jMenuItemProjectUpdateFar = null;\r
276 \r
277     private JMenuItem jMenuItemProjectRemoveFar = null;\r
278 \r
279     private JMenuItem jMenuItemProjectCreateFar = null;\r
280 \r
281     private JMenu jMenuEditFind = null;\r
282 \r
283     private JMenuItem jMenuItemEditFindPcd = null;\r
284 \r
285     private JMenuItem jMenuItemEditFindLibraryClass = null;\r
286 \r
287     private JMenuItem jMenuItemEditFindPpi = null;\r
288 \r
289     private JMenuItem jMenuItemEditFindProtocol = null;\r
290 \r
291     private JMenuItem jMenuItemEditFindGuid = null;\r
292 \r
293     private JMenuItem jMenuItemEditFindLibraryInstance = null;\r
294 \r
295     ///\r
296     /// A static definition for this class itself\r
297     ///\r
298     private static FrameworkWizardUI fwui = null;\r
299 \r
300     /**\r
301      If the class hasn't an instnace, new one.\r
302      \r
303      @return FrameworkWizardUI The instance of this class\r
304      \r
305      **/\r
306     public static FrameworkWizardUI getInstance() {\r
307         if (fwui == null) {\r
308             fwui = new FrameworkWizardUI();\r
309         }\r
310         return fwui;\r
311     }\r
312 \r
313     /**\r
314      This method initializes jMenuBar \r
315      \r
316      @return javax.swing.JMenuBar Main menu bar for the entire GUI\r
317      \r
318      **/\r
319     private JMenuBar getjJMenuBar() {\r
320         if (jMenuBar == null) {\r
321             jMenuBar = new JMenuBar();\r
322             jMenuBar.setPreferredSize(new java.awt.Dimension(0, 18));\r
323             jMenuBar.add(getJMenuFile());\r
324             jMenuBar.add(getJMenuEdit());\r
325             jMenuBar.add(getJMenuView());\r
326             jMenuBar.add(getJMenuProject());\r
327             jMenuBar.add(getJMenuTools());\r
328             jMenuBar.add(getJMenuWindow());\r
329             jMenuBar.add(getJMenuHelp());\r
330         }\r
331         return jMenuBar;\r
332     }\r
333 \r
334     /**\r
335      This method initializes jSplitPane\r
336      \r
337      @return javax.swing.JSplitPane\r
338      \r
339      **/\r
340     private JSplitPane getJSplitPane() {\r
341         if (jSplitPane == null) {\r
342             jSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, getJTabbedPaneTree(), getJTabbedPaneEditor());\r
343             jSplitPane.setBounds(new java.awt.Rectangle(0, 1, DataType.MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_WIDTH,\r
344                                                         DataType.MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_HEIGHT));\r
345             jSplitPane.addComponentListener(this);\r
346         }\r
347         return jSplitPane;\r
348     }\r
349 \r
350     /**\r
351      This method initializes jTabbedPaneEditor  \r
352      \r
353      @return javax.swing.JTabbedPane    \r
354      \r
355      **/\r
356     private JTabbedPane getJTabbedPaneEditor() {\r
357         if (jTabbedPaneEditor == null) {\r
358             jTabbedPaneEditor = new JTabbedPane();\r
359             jTabbedPaneEditor.setBounds(new java.awt.Rectangle(DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_X,\r
360                                                                DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_Y,\r
361                                                                DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,\r
362                                                                DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));\r
363             jTabbedPaneEditor\r
364                              .setMinimumSize(new java.awt.Dimension(\r
365                                                                     DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,\r
366                                                                     DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));\r
367             jTabbedPaneEditor.addTab("Module", null, getJDesktopPaneModule(), null);\r
368             jTabbedPaneEditor.addTab("Package", null, getJDesktopPanePackage(), null);\r
369             jTabbedPaneEditor.addTab("Platform", null, getJDesktopPanePlatform(), null);\r
370         }\r
371         return jTabbedPaneEditor;\r
372     }\r
373 \r
374     /**\r
375      This method initializes jTabbedPaneTree\r
376      \r
377      @return javax.swing.JTabbedPane    \r
378      \r
379      **/\r
380     private JTabbedPane getJTabbedPaneTree() {\r
381         if (jTabbedPaneTree == null) {\r
382             jTabbedPaneTree = new JTabbedPane();\r
383             jTabbedPaneTree\r
384                            .setPreferredSize(new java.awt.Dimension(\r
385                                                                     DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH,\r
386                                                                     DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT));\r
387             jTabbedPaneTree\r
388                            .setMinimumSize(new java.awt.Dimension(DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH,\r
389                                                                   DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT));\r
390             jTabbedPaneTree.addTab("Workspace Explorer", null, getJScrollPaneTree(), null);\r
391         }\r
392         return jTabbedPaneTree;\r
393     }\r
394 \r
395     /**\r
396      This method initializes jMenuFile \r
397      \r
398      @return javax.swing.JMenu jMenuModule\r
399      \r
400      **/\r
401     private JMenu getJMenuFile() {\r
402         if (jMenuFile == null) {\r
403             //\r
404             // Set jMenuFile's attributes\r
405             //\r
406             jMenuFile = new JMenu();\r
407             jMenuFile.setText("File");\r
408             jMenuFile.setMnemonic('F');\r
409             jMenuFile.addMenuListener(this);\r
410 \r
411             //\r
412             // Add sub menu items\r
413             //\r
414             jMenuFile.add(getJMenuItemFileNew());\r
415             jMenuFile.add(getJMenuItemFileOpen());\r
416             jMenuFile.add(getJMenuItemFileClose());\r
417             jMenuFile.add(getJMenuItemFileCloseAll());\r
418             jMenuFile.addSeparator();\r
419 \r
420             jMenuFile.add(getJMenuFileRecentFiles());\r
421             jMenuFile.add(getJMenuItemFileSave());\r
422             jMenuFile.add(getJMenuItemFileSaveAs());\r
423             jMenuFile.add(getJMenuItemFileSaveAll());\r
424             jMenuFile.addSeparator();\r
425 \r
426             jMenuFile.add(getJMenuItemFilePageSetup());\r
427             jMenuFile.add(getJMenuItemFilePrint());\r
428             jMenuFile.add(getJMenuItemFileImport());\r
429             jMenuFile.add(getJMenuItemFileProperties());\r
430 \r
431             jMenuFile.add(getJMenuItemFileExit());\r
432         }\r
433         return jMenuFile;\r
434     }\r
435 \r
436     /**\r
437      This method initializes jMenuItemFileSaveAs \r
438      \r
439      @return javax.swing.JMenuItem jMenuItemFileSaveAs\r
440      \r
441      **/\r
442     private JMenuItem getJMenuItemFileSaveAs() {\r
443         if (jMenuItemFileSaveAs == null) {\r
444             jMenuItemFileSaveAs = new JMenuItem();\r
445             jMenuItemFileSaveAs.setText("Save As...");\r
446             jMenuItemFileSaveAs.setMnemonic('a');\r
447             jMenuItemFileSaveAs.addActionListener(this);\r
448             jMenuItemFileSaveAs.setEnabled(false);\r
449             jMenuItemFileSaveAs.setVisible(false);\r
450         }\r
451         return jMenuItemFileSaveAs;\r
452     }\r
453 \r
454     /**\r
455      This method initializes jMenuItemModuleExit \r
456      \r
457      @return javax.swing.JMenuItem jMenuItemModuleExit\r
458      \r
459      **/\r
460     private JMenuItem getJMenuItemFileExit() {\r
461         if (jMenuItemFileExit == null) {\r
462             jMenuItemFileExit = new JMenuItem();\r
463             jMenuItemFileExit.setText("Exit");\r
464             jMenuItemFileExit.setMnemonic('x');\r
465             jMenuItemFileExit.addActionListener(this);\r
466         }\r
467         return jMenuItemFileExit;\r
468     }\r
469 \r
470     /**\r
471      This method initializes jMenuEdit \r
472      \r
473      @return javax.swing.JMenu jMenuEdit\r
474      \r
475      **/\r
476     private JMenu getJMenuEdit() {\r
477         if (jMenuEdit == null) {\r
478             //\r
479             // Set jMenuEdit's attributes\r
480             //\r
481             jMenuEdit = new JMenu();\r
482             jMenuEdit.setText("Edit");\r
483             jMenuEdit.setMnemonic('E');\r
484             jMenuEdit.setVisible(false);\r
485 \r
486             //\r
487             // Add sub menu items\r
488             //\r
489             jMenuEdit.add(getJMenuItemEditUndo());\r
490             jMenuEdit.add(getJMenuItemEditRedo());\r
491             //jMenuEdit.addSeparator();\r
492 \r
493             jMenuEdit.add(getJMenuItemEditCut());\r
494             jMenuEdit.add(getJMenuItemEditCopy());\r
495             jMenuEdit.add(getJMenuItemEditPaste());\r
496             jMenuEdit.add(getJMenuItemEditDelete());\r
497             //jMenuEdit.addSeparator();\r
498 \r
499             jMenuEdit.add(getJMenuItemEditSelectAll());\r
500             jMenuEdit.add(getJMenuEditFind());\r
501             jMenuEdit.add(getJMenuItemEditFindNext());\r
502             //jMenuEdit.addSeparator();\r
503         }\r
504         return jMenuEdit;\r
505     }\r
506 \r
507     /**\r
508      This method initializes jDesktopPane \r
509      \r
510      @return javax.swing.JDesktopPane jDesktopPane\r
511      \r
512      **/\r
513     private JDesktopPane getJDesktopPaneModule() {\r
514         if (jDesktopPaneModule == null) {\r
515             jDesktopPaneModule = new JDesktopPane();\r
516             jDesktopPaneModule\r
517                               .setBounds(new java.awt.Rectangle(DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_X,\r
518                                                                 DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_Y,\r
519                                                                 DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,\r
520                                                                 DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));\r
521             jDesktopPaneModule\r
522                               .setMinimumSize(new java.awt.Dimension(\r
523                                                                      DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,\r
524                                                                      DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));\r
525             jDesktopPaneModule.setDesktopManager(iDesktopManager);\r
526             jDesktopPaneModule.addComponentListener(this);\r
527         }\r
528         return jDesktopPaneModule;\r
529     }\r
530 \r
531     /**\r
532      This method initializes jDesktopPane \r
533      \r
534      @return javax.swing.JDesktopPane jDesktopPane\r
535      \r
536      **/\r
537     private JDesktopPane getJDesktopPanePackage() {\r
538         if (jDesktopPanePackage == null) {\r
539             jDesktopPanePackage = new JDesktopPane();\r
540             jDesktopPanePackage\r
541                                .setBounds(new java.awt.Rectangle(DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_X,\r
542                                                                  DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_Y,\r
543                                                                  DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,\r
544                                                                  DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));\r
545             jDesktopPanePackage\r
546                                .setMinimumSize(new java.awt.Dimension(\r
547                                                                       DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,\r
548                                                                       DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));\r
549             jDesktopPanePackage.setDesktopManager(iDesktopManager);\r
550             jDesktopPanePackage.addComponentListener(this);\r
551         }\r
552         return jDesktopPanePackage;\r
553     }\r
554 \r
555     /**\r
556      This method initializes jDesktopPane \r
557      \r
558      @return javax.swing.JDesktopPane jDesktopPane\r
559      \r
560      **/\r
561     private JDesktopPane getJDesktopPanePlatform() {\r
562         if (jDesktopPanePlatform == null) {\r
563             jDesktopPanePlatform = new JDesktopPane();\r
564             jDesktopPanePlatform\r
565                                 .setBounds(new java.awt.Rectangle(\r
566                                                                   DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_X,\r
567                                                                   DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_Y,\r
568                                                                   DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,\r
569                                                                   DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));\r
570             jDesktopPanePlatform\r
571                                 .setMinimumSize(new java.awt.Dimension(\r
572                                                                        DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,\r
573                                                                        DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));\r
574             jDesktopPanePlatform.setDesktopManager(iDesktopManager);\r
575             jDesktopPanePlatform.addComponentListener(this);\r
576         }\r
577         return jDesktopPanePlatform;\r
578     }\r
579 \r
580     /**\r
581      This method initializes jScrollPaneTree \r
582      \r
583      @return javax.swing.JScrollPane jScrollPaneTree\r
584      \r
585      **/\r
586     private JScrollPane getJScrollPaneTree() {\r
587         if (jScrollPaneTree == null) {\r
588             jScrollPaneTree = new JScrollPane();\r
589             jScrollPaneTree\r
590                            .setPreferredSize(new java.awt.Dimension(\r
591                                                                     DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH,\r
592                                                                     DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT));\r
593             jScrollPaneTree\r
594                            .setMinimumSize(new java.awt.Dimension(\r
595                                                                   DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH / 2,\r
596                                                                   DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT));\r
597             jScrollPaneTree.setViewportView(getITree());\r
598         }\r
599         return jScrollPaneTree;\r
600     }\r
601 \r
602     /**\r
603      This method initializes iTree \r
604      \r
605      @return org.tianocore.packaging.common.ui.ITree iTree\r
606      \r
607      **/\r
608     private ITree getITree() {\r
609         //\r
610         //Before open a real module, use an empty root node for the tree\r
611         //\r
612         makeEmptyTree();\r
613         return iTree;\r
614     }\r
615 \r
616     /**\r
617      This method initializes jMenuHelp \r
618      \r
619      @return javax.swing.JMenu jMenuHelp\r
620      \r
621      **/\r
622     private JMenu getJMenuHelp() {\r
623         if (jMenuHelp == null) {\r
624             //\r
625             // Set jMenuHelp's attributes\r
626             //\r
627             jMenuHelp = new JMenu();\r
628             jMenuHelp.setText("Help");\r
629 \r
630             //\r
631             // Add sub menu items\r
632             //\r
633             jMenuHelp.add(getJMenuItemHelpContents());\r
634             jMenuHelp.add(getJMenuItemHelpIndex());\r
635             jMenuHelp.add(getJMenuItemHelpSearch());\r
636 \r
637             jMenuHelp.add(getJMenuItemHelpAbout());\r
638         }\r
639         return jMenuHelp;\r
640     }\r
641 \r
642     /**\r
643      This method initializes jMenuItemHelpAbout \r
644      \r
645      @return javax.swing.JMenuItem jMenuItemHelpAbout\r
646      \r
647      **/\r
648     private JMenuItem getJMenuItemHelpAbout() {\r
649         if (jMenuItemHelpAbout == null) {\r
650             jMenuItemHelpAbout = new JMenuItem();\r
651             jMenuItemHelpAbout.setText("About...");\r
652             jMenuItemHelpAbout.addActionListener(this);\r
653         }\r
654         return jMenuItemHelpAbout;\r
655     }\r
656 \r
657     /**\r
658      This method initializes jMenuItemEditDelete \r
659      \r
660      @return javax.swing.JMenuItem jMenuItemEditDelete\r
661      \r
662      **/\r
663     private JMenuItem getJMenuItemEditDelete() {\r
664         if (jMenuItemEditDelete == null) {\r
665             jMenuItemEditDelete = new JMenuItem();\r
666             jMenuItemEditDelete.setText("Delete");\r
667             jMenuItemEditDelete.setMnemonic('D');\r
668             jMenuItemEditDelete.setVisible(false);\r
669             jMenuItemEditDelete.setEnabled(false);\r
670             jMenuItemEditDelete.addActionListener(this);\r
671             //\r
672             //Disabled first when no module is open\r
673             //\r
674             jMenuItemEditDelete.setEnabled(false);\r
675         }\r
676         return jMenuItemEditDelete;\r
677     }\r
678 \r
679     /**\r
680      This method initializes jMenuFileNew \r
681      \r
682      @return javax.swing.JMenuItem jMenuFileNew\r
683      \r
684      **/\r
685     private JMenuItem getJMenuItemFileNew() {\r
686         if (jMenuItemFileNew == null) {\r
687             jMenuItemFileNew = new JMenuItem();\r
688             jMenuItemFileNew.setText("New...");\r
689             jMenuItemFileNew.setMnemonic('N');\r
690             jMenuItemFileNew.addActionListener(this);\r
691         }\r
692         return jMenuItemFileNew;\r
693     }\r
694 \r
695     /**\r
696      This method initializes jMenuItemFileSave \r
697      \r
698      @return javax.swing.JMenuItem jMenuItemModuleSave\r
699      \r
700      **/\r
701     private JMenuItem getJMenuItemFileSave() {\r
702         if (jMenuItemFileSave == null) {\r
703             jMenuItemFileSave = new JMenuItem();\r
704             jMenuItemFileSave.setText("Save");\r
705             jMenuItemFileSave.setMnemonic('S');\r
706             jMenuItemFileSave.addActionListener(this);\r
707             jMenuItemFileSave.setEnabled(true);\r
708         }\r
709         return jMenuItemFileSave;\r
710     }\r
711 \r
712     /**\r
713      This method initializes jMenuItemModuleClose \r
714      \r
715      @return javax.swing.JMenuItem jMenuItemModuleClose\r
716      \r
717      **/\r
718     private JMenuItem getJMenuItemFileClose() {\r
719         if (jMenuItemFileClose == null) {\r
720             jMenuItemFileClose = new JMenuItem();\r
721             jMenuItemFileClose.setText("Close");\r
722             jMenuItemFileClose.setMnemonic('C');\r
723             jMenuItemFileClose.setEnabled(true);\r
724             jMenuItemFileClose.addActionListener(this);\r
725         }\r
726         return jMenuItemFileClose;\r
727     }\r
728 \r
729     /**\r
730      This method initializes jMenuTools\r
731      Reserved \r
732      \r
733      @return javax.swing.JMenu jMenuTools\r
734      \r
735      **/\r
736     private JMenu getJMenuTools() {\r
737         if (jMenuTools == null) {\r
738             //\r
739             // Set jMenuTools's attributes\r
740             //\r
741             jMenuTools = new JMenu();\r
742             jMenuTools.setText("Tools");\r
743             jMenuTools.setMnemonic('T');\r
744             jMenuTools.addMenuListener(this);\r
745 \r
746             //\r
747             // Add sub menu items\r
748             //\r
749             jMenuTools.add(getJMenuItemToolsToolChainConfiguration());\r
750             jMenuTools.addSeparator();\r
751 \r
752             jMenuTools.add(getJMenuItemToolsClone());\r
753             jMenuTools.add(getJMenuItemToolsCodeScan());\r
754         }\r
755         return jMenuTools;\r
756     }\r
757 \r
758     /**\r
759      This method initializes jMenuWindow \r
760      Reserved\r
761      \r
762      @return javax.swing.JMenu jMenuWindow\r
763      \r
764      **/\r
765     private JMenu getJMenuWindow() {\r
766         if (jMenuWindow == null) {\r
767             //\r
768             // Set jMenuWindow's attribute\r
769             //\r
770             jMenuWindow = new JMenu();\r
771             jMenuWindow.setText("Window");\r
772             jMenuWindow.setMnemonic('W');\r
773             jMenuWindow.setVisible(false);\r
774 \r
775             //\r
776             // Add sub menu items\r
777             //\r
778             jMenuWindow.add(getJMenuItemWindowDisplaySide());\r
779             jMenuWindow.add(getJMenuItemWindowDisplayTopBottom());\r
780             jMenuWindow.addSeparator();\r
781 \r
782             jMenuWindow.add(getJMenuItemWindowTabView());\r
783             jMenuWindow.addSeparator();\r
784 \r
785             jMenuWindow.add(getJMenuItemWindowSource());\r
786             jMenuWindow.add(getJMenuItemWindowXML());\r
787             jMenuWindow.addSeparator();\r
788 \r
789             jMenuWindow.add(getJMenuItemWindowPreferences());\r
790         }\r
791         return jMenuWindow;\r
792     }\r
793 \r
794     /**\r
795      This method initializes jPanelOperation\r
796      Reserved\r
797      \r
798      @return javax.swing.JPanel jPanelOperation\r
799      \r
800      **/\r
801     private JPanel getJPanelOperation() {\r
802         if (jPanelOperation == null) {\r
803             jPanelOperation = new JPanel();\r
804             jPanelOperation.setLayout(null);\r
805             jPanelOperation.setBounds(new java.awt.Rectangle(295, 520, 500, 25));\r
806             jPanelOperation.add(getJButtonOk(), null);\r
807             jPanelOperation.add(getJButtonCancel(), null);\r
808             jPanelOperation.setVisible(false);\r
809         }\r
810         return jPanelOperation;\r
811     }\r
812 \r
813     /**\r
814      This method initializes jButtonOk\r
815      Reserved\r
816      \r
817      @return javax.swing.JButton jButtonOk\r
818      \r
819      **/\r
820     private JButton getJButtonOk() {\r
821         if (jButtonOk == null) {\r
822             jButtonOk = new JButton();\r
823             jButtonOk.setBounds(new java.awt.Rectangle(395, 2, 90, 20));\r
824             jButtonOk.setText("Ok");\r
825             jButtonOk.setEnabled(false);\r
826             jButtonOk.addActionListener(this);\r
827         }\r
828         return jButtonOk;\r
829     }\r
830 \r
831     /**\r
832      This method initializes jButtonCancel\r
833      Reserved\r
834      \r
835      @return javax.swing.JButton jButtonCancel\r
836      \r
837      **/\r
838     private JButton getJButtonCancel() {\r
839         if (jButtonCancel == null) {\r
840             jButtonCancel = new JButton();\r
841             jButtonCancel.setBounds(new java.awt.Rectangle(395, 2, 90, 20));\r
842             jButtonCancel.setText("Cancel");\r
843             jButtonCancel.setEnabled(false);\r
844             jButtonCancel.addActionListener(this);\r
845             jButtonCancel.setVisible(false);\r
846         }\r
847         return jButtonCancel;\r
848     }\r
849 \r
850     /**\r
851      This method initializes jMenuItemFileOpen  \r
852      \r
853      @return javax.swing.JMenuItem jMenuItemFileOpen\r
854      \r
855      **/\r
856     private JMenuItem getJMenuItemFileOpen() {\r
857         if (jMenuItemFileOpen == null) {\r
858             jMenuItemFileOpen = new JMenuItem();\r
859             jMenuItemFileOpen.setText("Open...");\r
860             jMenuItemFileOpen.setMnemonic('O');\r
861             jMenuItemFileOpen.addActionListener(this);\r
862         }\r
863         return jMenuItemFileOpen;\r
864     }\r
865 \r
866     /**\r
867      This method initializes jMenuItemFileCloseAll      \r
868      \r
869      @return javax.swing.JMenuItem jMenuItemFileOpen\r
870      \r
871      **/\r
872     private JMenuItem getJMenuItemFileCloseAll() {\r
873         if (jMenuItemFileCloseAll == null) {\r
874             jMenuItemFileCloseAll = new JMenuItem();\r
875             jMenuItemFileCloseAll.setText("Close All");\r
876             jMenuItemFileCloseAll.setEnabled(true);\r
877             jMenuItemFileCloseAll.addActionListener(this);\r
878         }\r
879         return jMenuItemFileCloseAll;\r
880     }\r
881 \r
882     /**\r
883      This method initializes jMenuItemFileSaveAll       \r
884      \r
885      @return javax.swing.JMenuItem jMenuItemFileSaveAll\r
886      \r
887      **/\r
888     private JMenuItem getJMenuItemFileSaveAll() {\r
889         if (jMenuItemFileSaveAll == null) {\r
890             jMenuItemFileSaveAll = new JMenuItem();\r
891             jMenuItemFileSaveAll.setText("Save All");\r
892             jMenuItemFileSaveAll.setMnemonic('v');\r
893             jMenuItemFileSaveAll.setEnabled(true);\r
894             jMenuItemFileSaveAll.addActionListener(this);\r
895         }\r
896         return jMenuItemFileSaveAll;\r
897     }\r
898 \r
899     /**\r
900      This method initializes jMenuItemFilePageSetup     \r
901      \r
902      @return javax.swing.JMenuItem      \r
903      \r
904      **/\r
905     private JMenuItem getJMenuItemFilePageSetup() {\r
906         if (jMenuItemFilePageSetup == null) {\r
907             jMenuItemFilePageSetup = new JMenuItem();\r
908             jMenuItemFilePageSetup.setText("Page Setup");\r
909             jMenuItemFilePageSetup.setMnemonic('u');\r
910             jMenuItemFilePageSetup.setEnabled(false);\r
911             jMenuItemFilePageSetup.addActionListener(this);\r
912             jMenuItemFilePageSetup.setVisible(false);\r
913         }\r
914         return jMenuItemFilePageSetup;\r
915     }\r
916 \r
917     /**\r
918      This method initializes jMenuItemFilePrint \r
919      \r
920      @return javax.swing.JMenuItem      \r
921      \r
922      **/\r
923     private JMenuItem getJMenuItemFilePrint() {\r
924         if (jMenuItemFilePrint == null) {\r
925             jMenuItemFilePrint = new JMenuItem();\r
926             jMenuItemFilePrint.setText("Print");\r
927             jMenuItemFilePrint.setMnemonic('P');\r
928             jMenuItemFilePrint.setEnabled(false);\r
929             jMenuItemFilePrint.addActionListener(this);\r
930             jMenuItemFilePrint.setVisible(false);\r
931         }\r
932         return jMenuItemFilePrint;\r
933     }\r
934 \r
935     /**\r
936      This method initializes jMenuItemFileImport        \r
937      \r
938      @return javax.swing.JMenuItem      \r
939      \r
940      **/\r
941     private JMenuItem getJMenuItemFileImport() {\r
942         if (jMenuItemFileImport == null) {\r
943             jMenuItemFileImport = new JMenuItem();\r
944             jMenuItemFileImport.setText("Import");\r
945             jMenuItemFileImport.setMnemonic('I');\r
946             jMenuItemFileImport.setEnabled(false);\r
947             jMenuItemFileImport.addActionListener(this);\r
948             jMenuItemFileImport.setVisible(false);\r
949         }\r
950         return jMenuItemFileImport;\r
951     }\r
952 \r
953     /**\r
954      This method initializes jMenuItemFileProperties    \r
955      \r
956      @return javax.swing.JMenuItem      \r
957      \r
958      **/\r
959     private JMenuItem getJMenuItemFileProperties() {\r
960         if (jMenuItemFileProperties == null) {\r
961             jMenuItemFileProperties = new JMenuItem();\r
962             jMenuItemFileProperties.setText("Properties");\r
963             jMenuItemFileProperties.setMnemonic('t');\r
964             jMenuItemFileProperties.setEnabled(false);\r
965             jMenuItemFileProperties.addActionListener(this);\r
966             jMenuItemFileProperties.setVisible(false);\r
967         }\r
968         return jMenuItemFileProperties;\r
969     }\r
970 \r
971     /**\r
972      This method initializes jMenuFileRecentFiles       \r
973      \r
974      @return javax.swing.JMenu  \r
975      \r
976      **/\r
977     private JMenu getJMenuFileRecentFiles() {\r
978         if (jMenuFileRecentFiles == null) {\r
979             jMenuFileRecentFiles = new JMenu();\r
980             jMenuFileRecentFiles.setText("Recent Files");\r
981             jMenuFileRecentFiles.setMnemonic('F');\r
982             jMenuFileRecentFiles.setEnabled(false);\r
983             jMenuFileRecentFiles.addActionListener(this);\r
984             jMenuFileRecentFiles.setVisible(false);\r
985         }\r
986         return jMenuFileRecentFiles;\r
987     }\r
988 \r
989     /**\r
990      This method initializes jMenuItemEditUndo  \r
991      \r
992      @return javax.swing.JMenuItem\r
993      \r
994      **/\r
995     private JMenuItem getJMenuItemEditUndo() {\r
996         if (jMenuItemEditUndo == null) {\r
997             jMenuItemEditUndo = new JMenuItem();\r
998             jMenuItemEditUndo.setText("Undo");\r
999             jMenuItemEditUndo.setMnemonic('U');\r
1000             jMenuItemEditUndo.setEnabled(false);\r
1001             jMenuItemEditUndo.setVisible(false);\r
1002             jMenuItemEditUndo.addActionListener(this);\r
1003         }\r
1004         return jMenuItemEditUndo;\r
1005     }\r
1006 \r
1007     /**\r
1008      This method initializes jMenuItemEditRedo  \r
1009      \r
1010      @return javax.swing.JMenuItem      \r
1011      \r
1012      **/\r
1013     private JMenuItem getJMenuItemEditRedo() {\r
1014         if (jMenuItemEditRedo == null) {\r
1015             jMenuItemEditRedo = new JMenuItem();\r
1016             jMenuItemEditRedo.setText("Redo");\r
1017             jMenuItemEditRedo.setMnemonic('R');\r
1018             jMenuItemEditRedo.setEnabled(false);\r
1019             jMenuItemEditRedo.setVisible(false);\r
1020             jMenuItemEditRedo.addActionListener(this);\r
1021         }\r
1022         return jMenuItemEditRedo;\r
1023     }\r
1024 \r
1025     /**\r
1026      This method initializes jMenuItemEditCut   \r
1027      \r
1028      @return javax.swing.JMenuItem      \r
1029      \r
1030      **/\r
1031     private JMenuItem getJMenuItemEditCut() {\r
1032         if (jMenuItemEditCut == null) {\r
1033             jMenuItemEditCut = new JMenuItem();\r
1034             jMenuItemEditCut.setText("Cut");\r
1035             jMenuItemEditCut.setMnemonic('t');\r
1036             jMenuItemEditCut.setEnabled(false);\r
1037             jMenuItemEditCut.setVisible(false);\r
1038             jMenuItemEditCut.addActionListener(this);\r
1039         }\r
1040         return jMenuItemEditCut;\r
1041     }\r
1042 \r
1043     /**\r
1044      This method initializes jMenuItemEditCopy  \r
1045      \r
1046      @return javax.swing.JMenuItem      \r
1047      \r
1048      **/\r
1049     private JMenuItem getJMenuItemEditCopy() {\r
1050         if (jMenuItemEditCopy == null) {\r
1051             jMenuItemEditCopy = new JMenuItem();\r
1052             jMenuItemEditCopy.setText("Copy");\r
1053             jMenuItemEditCopy.setMnemonic('C');\r
1054             jMenuItemEditCopy.setEnabled(false);\r
1055             jMenuItemEditCopy.setVisible(false);\r
1056             jMenuItemEditCopy.addActionListener(this);\r
1057         }\r
1058         return jMenuItemEditCopy;\r
1059     }\r
1060 \r
1061     /**\r
1062      This method initializes jMenuItemEditPaste \r
1063      \r
1064      return javax.swing.JMenuItem       \r
1065      \r
1066      **/\r
1067     private JMenuItem getJMenuItemEditPaste() {\r
1068         if (jMenuItemEditPaste == null) {\r
1069             jMenuItemEditPaste = new JMenuItem();\r
1070             jMenuItemEditPaste.setText("Paste");\r
1071             jMenuItemEditPaste.setMnemonic('P');\r
1072             jMenuItemEditPaste.setEnabled(false);\r
1073             jMenuItemEditPaste.setVisible(false);\r
1074             jMenuItemEditPaste.addActionListener(this);\r
1075         }\r
1076         return jMenuItemEditPaste;\r
1077     }\r
1078 \r
1079     /**\r
1080      This method initializes jMenuItem  \r
1081      \r
1082      @return javax.swing.JMenuItem      \r
1083      \r
1084      **/\r
1085     private JMenuItem getJMenuItemEditSelectAll() {\r
1086         if (jMenuItemEditSelectAll == null) {\r
1087             jMenuItemEditSelectAll = new JMenuItem();\r
1088             jMenuItemEditSelectAll.setText("Select All");\r
1089             jMenuItemEditSelectAll.setMnemonic('A');\r
1090             jMenuItemEditSelectAll.setEnabled(false);\r
1091             jMenuItemEditSelectAll.setVisible(false);\r
1092             jMenuItemEditSelectAll.addActionListener(this);\r
1093         }\r
1094         return jMenuItemEditSelectAll;\r
1095     }\r
1096 \r
1097     /**\r
1098      This method initializes jMenuItemEditFindNext      \r
1099      \r
1100      @return javax.swing.JMenuItem      \r
1101      \r
1102      **/\r
1103     private JMenuItem getJMenuItemEditFindNext() {\r
1104         if (jMenuItemEditFindNext == null) {\r
1105             jMenuItemEditFindNext = new JMenuItem();\r
1106             jMenuItemEditFindNext.setText("Find Next");\r
1107             jMenuItemEditFindNext.setMnemonic('n');\r
1108             jMenuItemEditFindNext.setEnabled(false);\r
1109             jMenuItemEditFindNext.setVisible(false);\r
1110             jMenuItemEditFindNext.addActionListener(this);\r
1111         }\r
1112         return jMenuItemEditFindNext;\r
1113     }\r
1114 \r
1115     /**\r
1116      This method initializes jMenuView  \r
1117      \r
1118      @return javax.swing.JMenu  \r
1119      \r
1120      **/\r
1121     private JMenu getJMenuView() {\r
1122         if (jMenuView == null) {\r
1123             //\r
1124             // Set jMenuView's attributes\r
1125             //\r
1126             jMenuView = new JMenu();\r
1127             jMenuView.setText("View");\r
1128             jMenuView.setMnemonic('V');\r
1129             jMenuView.setVisible(false);\r
1130 \r
1131             //\r
1132             // Add sub menu items\r
1133             //\r
1134             jMenuView.add(getJMenuViewToolbars());\r
1135             jMenuView.add(getJMenuItemViewAdvanced());\r
1136             jMenuView.add(getJMenuItemViewStandard());\r
1137             jMenuView.add(getJMenuItemViewXML());\r
1138         }\r
1139         return jMenuView;\r
1140     }\r
1141 \r
1142     /**\r
1143      This method initializes jMenuViewToolbars  \r
1144      \r
1145      @return javax.swing.JMenu  \r
1146      \r
1147      **/\r
1148     private JMenu getJMenuViewToolbars() {\r
1149         if (jMenuViewToolbars == null) {\r
1150             jMenuViewToolbars = new JMenu();\r
1151             jMenuViewToolbars.setText("Toolbars");\r
1152             jMenuViewToolbars.setMnemonic('T');\r
1153 \r
1154             jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsFile());\r
1155             jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsEdit());\r
1156             jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsWindow());\r
1157         }\r
1158         return jMenuViewToolbars;\r
1159     }\r
1160 \r
1161     /**\r
1162      This method initializes jCheckBoxMenuItemViewToolbarsFile  \r
1163      \r
1164      @return javax.swing.JCheckBoxMenuItem      \r
1165      \r
1166      **/\r
1167     private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsFile() {\r
1168         if (jCheckBoxMenuItemViewToolbarsFile == null) {\r
1169             jCheckBoxMenuItemViewToolbarsFile = new JCheckBoxMenuItem();\r
1170             jCheckBoxMenuItemViewToolbarsFile.setText("File");\r
1171             jCheckBoxMenuItemViewToolbarsFile.setEnabled(false);\r
1172             jCheckBoxMenuItemViewToolbarsFile.addActionListener(this);\r
1173         }\r
1174         return jCheckBoxMenuItemViewToolbarsFile;\r
1175     }\r
1176 \r
1177     /**\r
1178      This method initializes jCheckBoxMenuItemViewToolbarsEdit  \r
1179      \r
1180      @return javax.swing.JCheckBoxMenuItem      \r
1181      \r
1182      **/\r
1183     private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsEdit() {\r
1184         if (jCheckBoxMenuItemViewToolbarsEdit == null) {\r
1185             jCheckBoxMenuItemViewToolbarsEdit = new JCheckBoxMenuItem();\r
1186             jCheckBoxMenuItemViewToolbarsEdit.setText("Edit");\r
1187             jCheckBoxMenuItemViewToolbarsEdit.setEnabled(false);\r
1188             jCheckBoxMenuItemViewToolbarsEdit.addActionListener(this);\r
1189         }\r
1190         return jCheckBoxMenuItemViewToolbarsEdit;\r
1191     }\r
1192 \r
1193     /**\r
1194      This method initializes jCheckBoxMenuItemViewToolbarsWindow        \r
1195      \r
1196      @return javax.swing.JCheckBoxMenuItem      \r
1197      \r
1198      **/\r
1199     private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsWindow() {\r
1200         if (jCheckBoxMenuItemViewToolbarsWindow == null) {\r
1201             jCheckBoxMenuItemViewToolbarsWindow = new JCheckBoxMenuItem();\r
1202             jCheckBoxMenuItemViewToolbarsWindow.setText("Window");\r
1203             jCheckBoxMenuItemViewToolbarsWindow.setEnabled(false);\r
1204             jCheckBoxMenuItemViewToolbarsWindow.addActionListener(this);\r
1205         }\r
1206         return jCheckBoxMenuItemViewToolbarsWindow;\r
1207     }\r
1208 \r
1209     /**\r
1210      This method initializes jMenuItemStandard  \r
1211      \r
1212      @return javax.swing.JMenuItem      \r
1213      \r
1214      **/\r
1215     private JMenuItem getJMenuItemViewStandard() {\r
1216         if (jMenuItemViewStandard == null) {\r
1217             jMenuItemViewStandard = new JMenuItem();\r
1218             jMenuItemViewStandard.setText("Standard");\r
1219             jMenuItemViewStandard.setMnemonic('S');\r
1220             jMenuItemViewStandard.setEnabled(false);\r
1221             jMenuItemViewStandard.addActionListener(this);\r
1222         }\r
1223         return jMenuItemViewStandard;\r
1224     }\r
1225 \r
1226     /**\r
1227      This method initializes jMenuItemAdvanced  \r
1228      \r
1229      @return javax.swing.JMenuItem      \r
1230      \r
1231      **/\r
1232     private JMenuItem getJMenuItemViewAdvanced() {\r
1233         if (jMenuItemViewAdvanced == null) {\r
1234             jMenuItemViewAdvanced = new JMenuItem();\r
1235             jMenuItemViewAdvanced.setText("Advanced");\r
1236             jMenuItemViewAdvanced.setMnemonic('A');\r
1237             jMenuItemViewAdvanced.setEnabled(false);\r
1238             jMenuItemViewAdvanced.addActionListener(this);\r
1239         }\r
1240         return jMenuItemViewAdvanced;\r
1241     }\r
1242 \r
1243     /**\r
1244      This method initializes jMenuProject       \r
1245      \r
1246      @return javax.swing.JMenu  \r
1247      \r
1248      **/\r
1249     private JMenu getJMenuProject() {\r
1250         if (jMenuProject == null) {\r
1251             //\r
1252             // Set jMenuProject's attributes\r
1253             //\r
1254             jMenuProject = new JMenu();\r
1255             jMenuProject.setText("Project");\r
1256             jMenuProject.setMnemonic('P');\r
1257 \r
1258             //\r
1259             // Add sub menu items\r
1260             //\r
1261             jMenuProject.add(getJMenuItemProjectAdmin());\r
1262 \r
1263             jMenuProject.add(getJMenuItemProjectChangeWorkspace());\r
1264             jMenuProject.addSeparator();\r
1265 \r
1266             jMenuProject.add(getJMenuItemProjectCreateFar());\r
1267             jMenuProject.add(getJMenuItemProjectInstallFar());\r
1268             jMenuProject.add(getJMenuItemProjectUpdateFar());\r
1269             jMenuProject.add(getJMenuItemProjectRemoveFar());\r
1270 \r
1271             jMenuProject.add(getJMenuProjectBuildTargets());\r
1272         }\r
1273         return jMenuProject;\r
1274     }\r
1275 \r
1276     /**\r
1277      This method initializes jMenuItemProjectAdmin      \r
1278      \r
1279      @return javax.swing.JMenuItem      \r
1280      \r
1281      **/\r
1282     private JMenuItem getJMenuItemProjectAdmin() {\r
1283         if (jMenuItemProjectAdmin == null) {\r
1284             jMenuItemProjectAdmin = new JMenuItem();\r
1285             jMenuItemProjectAdmin.setText("Admin...");\r
1286             jMenuItemProjectAdmin.setMnemonic('A');\r
1287             jMenuItemProjectAdmin.setEnabled(false);\r
1288             jMenuItemProjectAdmin.addActionListener(this);\r
1289             jMenuItemProjectAdmin.setVisible(false);\r
1290         }\r
1291         return jMenuItemProjectAdmin;\r
1292     }\r
1293 \r
1294     /**\r
1295      This method initializes jMenuItemProjectChangeWorkspace    \r
1296      \r
1297      @return javax.swing.JMenuItem      \r
1298      \r
1299      **/\r
1300     private JMenuItem getJMenuItemProjectChangeWorkspace() {\r
1301         if (jMenuItemProjectChangeWorkspace == null) {\r
1302             jMenuItemProjectChangeWorkspace = new JMenuItem();\r
1303             jMenuItemProjectChangeWorkspace.setText("Change WORKSPACE...");\r
1304             jMenuItemProjectChangeWorkspace.setMnemonic('W');\r
1305             jMenuItemProjectChangeWorkspace.setEnabled(true);\r
1306             jMenuItemProjectChangeWorkspace.addActionListener(this);\r
1307         }\r
1308         return jMenuItemProjectChangeWorkspace;\r
1309     }\r
1310 \r
1311     /**\r
1312      This method initializes jMenuProjectBuildTargets   \r
1313      \r
1314      @return javax.swing.JMenu  \r
1315      \r
1316      **/\r
1317     private JMenu getJMenuProjectBuildTargets() {\r
1318         if (jMenuProjectBuildTargets == null) {\r
1319             jMenuProjectBuildTargets = new JMenu();\r
1320             jMenuProjectBuildTargets.setText("Build Targets");\r
1321             jMenuProjectBuildTargets.setMnemonic('T');\r
1322             jMenuProjectBuildTargets.setVisible(false);\r
1323 \r
1324             jMenuProjectBuildTargets.add(getJCheckBoxMenuItemProjectBuildTargetsDebug());\r
1325             jMenuProjectBuildTargets.add(getJCheckBoxMenuItemProjectBuildTargetsRelease());\r
1326         }\r
1327         return jMenuProjectBuildTargets;\r
1328     }\r
1329 \r
1330     /**\r
1331      This method initializes jCheckBoxMenuItemProjectBuildTargetsDebug  \r
1332      \r
1333      @return javax.swing.JCheckBoxMenuItem      \r
1334      \r
1335      **/\r
1336     private JCheckBoxMenuItem getJCheckBoxMenuItemProjectBuildTargetsDebug() {\r
1337         if (jCheckBoxMenuItemProjectBuildTargetsDebug == null) {\r
1338             jCheckBoxMenuItemProjectBuildTargetsDebug = new JCheckBoxMenuItem();\r
1339             jCheckBoxMenuItemProjectBuildTargetsDebug.setText("Debug");\r
1340             jCheckBoxMenuItemProjectBuildTargetsDebug.setEnabled(false);\r
1341         }\r
1342         return jCheckBoxMenuItemProjectBuildTargetsDebug;\r
1343     }\r
1344 \r
1345     /**\r
1346      This method initializes jCheckBoxMenuItemProjectBuildTargetsRelease        \r
1347      \r
1348      @return javax.swing.JCheckBoxMenuItem      \r
1349      \r
1350      **/\r
1351     private JCheckBoxMenuItem getJCheckBoxMenuItemProjectBuildTargetsRelease() {\r
1352         if (jCheckBoxMenuItemProjectBuildTargetsRelease == null) {\r
1353             jCheckBoxMenuItemProjectBuildTargetsRelease = new JCheckBoxMenuItem();\r
1354             jCheckBoxMenuItemProjectBuildTargetsRelease.setText("Release");\r
1355             jCheckBoxMenuItemProjectBuildTargetsRelease.setEnabled(false);\r
1356         }\r
1357         return jCheckBoxMenuItemProjectBuildTargetsRelease;\r
1358     }\r
1359 \r
1360     /**\r
1361      This method initializes jMenuItemToolsToolChainConfiguration       \r
1362      \r
1363      @return javax.swing.JMenuItem      \r
1364      \r
1365      **/\r
1366     private JMenuItem getJMenuItemToolsToolChainConfiguration() {\r
1367         if (jMenuItemToolsToolChainConfiguration == null) {\r
1368             jMenuItemToolsToolChainConfiguration = new JMenuItem();\r
1369             jMenuItemToolsToolChainConfiguration.setText("Tool Chain Configuration...");\r
1370             jMenuItemToolsToolChainConfiguration.setMnemonic('C');\r
1371             jMenuItemToolsToolChainConfiguration.addActionListener(this);\r
1372         }\r
1373         return jMenuItemToolsToolChainConfiguration;\r
1374     }\r
1375 \r
1376     /**\r
1377      This method initializes jMenuItemToolsClone        \r
1378      \r
1379      @return javax.swing.JMenuItem      \r
1380      \r
1381      **/\r
1382     private JMenuItem getJMenuItemToolsClone() {\r
1383         if (jMenuItemToolsClone == null) {\r
1384             jMenuItemToolsClone = new JMenuItem();\r
1385             jMenuItemToolsClone.setText("Clone...");\r
1386             jMenuItemToolsClone.setMnemonic('l');\r
1387             jMenuItemToolsClone.setEnabled(true);\r
1388             jMenuItemToolsClone.addActionListener(this);\r
1389         }\r
1390         return jMenuItemToolsClone;\r
1391     }\r
1392 \r
1393     /**\r
1394      This method initializes jMenuItemToolsCodeScan     \r
1395      \r
1396      @return javax.swing.JMenuItem      \r
1397      \r
1398      **/\r
1399     private JMenuItem getJMenuItemToolsCodeScan() {\r
1400         if (jMenuItemToolsCodeScan == null) {\r
1401             jMenuItemToolsCodeScan = new JMenuItem();\r
1402             jMenuItemToolsCodeScan.setText("Code Scan...");\r
1403             jMenuItemToolsCodeScan.setMnemonic('S');\r
1404             jMenuItemToolsCodeScan.setEnabled(false);\r
1405             jMenuItemToolsCodeScan.addActionListener(this);\r
1406             jMenuItemToolsCodeScan.setVisible(false);\r
1407         }\r
1408         return jMenuItemToolsCodeScan;\r
1409     }\r
1410 \r
1411     /**\r
1412      This method initializes jMenuItemWindowSplitVertical       \r
1413      \r
1414      @return javax.swing.JMenuItem      \r
1415      \r
1416      **/\r
1417     private JMenuItem getJMenuItemWindowDisplaySide() {\r
1418         if (jMenuItemWindowDisplaySide == null) {\r
1419             jMenuItemWindowDisplaySide = new JMenuItem();\r
1420             jMenuItemWindowDisplaySide.setText("Display Side by Side");\r
1421             jMenuItemWindowDisplaySide.setMnemonic('S');\r
1422             jMenuItemWindowDisplaySide.setEnabled(false);\r
1423             jMenuItemWindowDisplaySide.addActionListener(this);\r
1424         }\r
1425         return jMenuItemWindowDisplaySide;\r
1426     }\r
1427 \r
1428     /**\r
1429      This method initializes jMenuItemWindowSplitHorizontal     \r
1430      \r
1431      @return javax.swing.JMenuItem      \r
1432      \r
1433      **/\r
1434     private JMenuItem getJMenuItemWindowDisplayTopBottom() {\r
1435         if (jMenuItemWindowDisplayTopBottom == null) {\r
1436             jMenuItemWindowDisplayTopBottom = new JMenuItem();\r
1437             jMenuItemWindowDisplayTopBottom.setText("Display Top and Bottom");\r
1438             jMenuItemWindowDisplayTopBottom.setMnemonic('B');\r
1439             jMenuItemWindowDisplayTopBottom.setEnabled(false);\r
1440             jMenuItemWindowDisplayTopBottom.addActionListener(this);\r
1441         }\r
1442         return jMenuItemWindowDisplayTopBottom;\r
1443     }\r
1444 \r
1445     /**\r
1446      This method initializes jMenuItemViewXML   \r
1447      \r
1448      @return javax.swing.JMenuItem      \r
1449      \r
1450      **/\r
1451     private JMenuItem getJMenuItemViewXML() {\r
1452         if (jMenuItemViewXML == null) {\r
1453             jMenuItemViewXML = new JMenuItem();\r
1454             jMenuItemViewXML.setText("XML");\r
1455             jMenuItemViewXML.setMnemonic('X');\r
1456             jMenuItemViewXML.setEnabled(false);\r
1457             jMenuItemViewXML.addActionListener(this);\r
1458         }\r
1459         return jMenuItemViewXML;\r
1460     }\r
1461 \r
1462     /**\r
1463      This method initializes jMenuItemWindowTabView     \r
1464      \r
1465      @return javax.swing.JMenuItem      \r
1466      \r
1467      **/\r
1468     private JMenuItem getJMenuItemWindowTabView() {\r
1469         if (jMenuItemWindowTabView == null) {\r
1470             jMenuItemWindowTabView = new JMenuItem();\r
1471             jMenuItemWindowTabView.setText("Tab View");\r
1472             jMenuItemWindowTabView.setMnemonic('T');\r
1473             jMenuItemWindowTabView.setEnabled(false);\r
1474             jMenuItemWindowTabView.addActionListener(this);\r
1475         }\r
1476         return jMenuItemWindowTabView;\r
1477     }\r
1478 \r
1479     /**\r
1480      This method initializes jMenuItemWindowSource      \r
1481      \r
1482      @return javax.swing.JMenuItem      \r
1483      \r
1484      **/\r
1485     private JMenuItem getJMenuItemWindowSource() {\r
1486         if (jMenuItemWindowSource == null) {\r
1487             jMenuItemWindowSource = new JMenuItem();\r
1488             jMenuItemWindowSource.setText("Source");\r
1489             jMenuItemWindowSource.setMnemonic('S');\r
1490             jMenuItemWindowSource.setEnabled(false);\r
1491             jMenuItemWindowSource.addActionListener(this);\r
1492         }\r
1493         return jMenuItemWindowSource;\r
1494     }\r
1495 \r
1496     /**\r
1497      This method initializes jMenuItemWindowXML \r
1498      \r
1499      @return javax.swing.JMenuItem      \r
1500      \r
1501      **/\r
1502     private JMenuItem getJMenuItemWindowXML() {\r
1503         if (jMenuItemWindowXML == null) {\r
1504             jMenuItemWindowXML = new JMenuItem();\r
1505             jMenuItemWindowXML.setText("XML");\r
1506             jMenuItemWindowXML.setMnemonic('X');\r
1507             jMenuItemWindowXML.setEnabled(false);\r
1508             jMenuItemWindowXML.addActionListener(this);\r
1509         }\r
1510         return jMenuItemWindowXML;\r
1511     }\r
1512 \r
1513     /**\r
1514      This method initializes jMenuItemWindowPreferences \r
1515      \r
1516      @return javax.swing.JMenuItem      \r
1517      \r
1518      **/\r
1519     private JMenuItem getJMenuItemWindowPreferences() {\r
1520         if (jMenuItemWindowPreferences == null) {\r
1521             jMenuItemWindowPreferences = new JMenuItem();\r
1522             jMenuItemWindowPreferences.setText("Preferences");\r
1523             jMenuItemWindowPreferences.setMnemonic('P');\r
1524             jMenuItemWindowPreferences.setEnabled(false);\r
1525             jMenuItemWindowPreferences.addActionListener(this);\r
1526         }\r
1527         return jMenuItemWindowPreferences;\r
1528     }\r
1529 \r
1530     /**\r
1531      This method initializes jMenuItemHelpContents      \r
1532      \r
1533      @return javax.swing.JMenuItem      \r
1534      \r
1535      **/\r
1536     private JMenuItem getJMenuItemHelpContents() {\r
1537         if (jMenuItemHelpContents == null) {\r
1538             jMenuItemHelpContents = new JMenuItem();\r
1539             jMenuItemHelpContents.setText("Contents");\r
1540             jMenuItemHelpContents.setMnemonic('C');\r
1541             jMenuItemHelpContents.setEnabled(false);\r
1542             jMenuItemHelpContents.addActionListener(this);\r
1543             jMenuItemHelpContents.setVisible(false);\r
1544         }\r
1545         return jMenuItemHelpContents;\r
1546     }\r
1547 \r
1548     /**\r
1549      This method initializes jMenuItemHelpIndex \r
1550      \r
1551      @return javax.swing.JMenuItem      \r
1552      \r
1553      **/\r
1554     private JMenuItem getJMenuItemHelpIndex() {\r
1555         if (jMenuItemHelpIndex == null) {\r
1556             jMenuItemHelpIndex = new JMenuItem();\r
1557             jMenuItemHelpIndex.setText("Index");\r
1558             jMenuItemHelpIndex.setMnemonic('I');\r
1559             jMenuItemHelpIndex.setEnabled(false);\r
1560             jMenuItemHelpIndex.addActionListener(this);\r
1561             jMenuItemHelpIndex.setVisible(false);\r
1562         }\r
1563         return jMenuItemHelpIndex;\r
1564     }\r
1565 \r
1566     /**\r
1567      This method initializes jMenuItemHelpSearch        \r
1568      \r
1569      @return javax.swing.JMenuItem      \r
1570      \r
1571      */\r
1572     private JMenuItem getJMenuItemHelpSearch() {\r
1573         if (jMenuItemHelpSearch == null) {\r
1574             jMenuItemHelpSearch = new JMenuItem();\r
1575             jMenuItemHelpSearch.setText("Search");\r
1576             jMenuItemHelpSearch.setMnemonic('S');\r
1577             jMenuItemHelpSearch.setEnabled(false);\r
1578             jMenuItemHelpSearch.addActionListener(this);\r
1579             jMenuItemHelpSearch.setVisible(false);\r
1580         }\r
1581         return jMenuItemHelpSearch;\r
1582     }\r
1583 \r
1584     /**\r
1585      * This method initializes jMenuItemToolsInstallPackage     \r
1586      *  \r
1587      * @return javax.swing.JMenuItem    \r
1588      */\r
1589     private JMenuItem getJMenuItemProjectInstallFar() {\r
1590         if (jMenuItemProjectInstallFar == null) {\r
1591             jMenuItemProjectInstallFar = new JMenuItem();\r
1592             jMenuItemProjectInstallFar.setText("Install FAR");\r
1593             jMenuItemProjectInstallFar.setMnemonic('I');\r
1594             jMenuItemProjectInstallFar.setEnabled(true);\r
1595             jMenuItemProjectInstallFar.addActionListener(this);\r
1596         }\r
1597         return jMenuItemProjectInstallFar;\r
1598     }\r
1599 \r
1600     /**\r
1601      * This method initializes jMenuItemToolsUpdatePackage      \r
1602      *  \r
1603      * @return javax.swing.JMenuItem    \r
1604      */\r
1605     private JMenuItem getJMenuItemProjectUpdateFar() {\r
1606         if (jMenuItemProjectUpdateFar == null) {\r
1607             jMenuItemProjectUpdateFar = new JMenuItem();\r
1608             jMenuItemProjectUpdateFar.setText("Update FAR");\r
1609             jMenuItemProjectUpdateFar.setMnemonic('U');\r
1610             jMenuItemProjectUpdateFar.setEnabled(true);\r
1611             jMenuItemProjectUpdateFar.addActionListener(this);\r
1612             jMenuItemProjectUpdateFar.setVisible(true);\r
1613         }\r
1614         return jMenuItemProjectUpdateFar;\r
1615     }\r
1616 \r
1617     /**\r
1618      * This method initializes jMenuItemRemovePackage   \r
1619      *  \r
1620      * @return javax.swing.JMenuItem    \r
1621      */\r
1622     private JMenuItem getJMenuItemProjectRemoveFar() {\r
1623         if (jMenuItemProjectRemoveFar == null) {\r
1624             jMenuItemProjectRemoveFar = new JMenuItem();\r
1625             jMenuItemProjectRemoveFar.setText("Remove FAR");\r
1626             jMenuItemProjectRemoveFar.setMnemonic('R');\r
1627             jMenuItemProjectRemoveFar.setEnabled(true);\r
1628             jMenuItemProjectRemoveFar.addActionListener(this);\r
1629         }\r
1630         return jMenuItemProjectRemoveFar;\r
1631     }\r
1632 \r
1633     /**\r
1634      * This method initializes jMenuItemProjectCreateFar        \r
1635      *  \r
1636      * @return javax.swing.JMenuItem    \r
1637      */\r
1638     private JMenuItem getJMenuItemProjectCreateFar() {\r
1639         if (jMenuItemProjectCreateFar == null) {\r
1640             jMenuItemProjectCreateFar = new JMenuItem();\r
1641             jMenuItemProjectCreateFar.setText("Create FAR");\r
1642             jMenuItemProjectCreateFar.setMnemonic('C');\r
1643             jMenuItemProjectCreateFar.addActionListener(this);\r
1644         }\r
1645         return jMenuItemProjectCreateFar;\r
1646     }\r
1647 \r
1648     /**\r
1649      * This method initializes jMenuEditFind    \r
1650      *  \r
1651      * @return javax.swing.JMenu        \r
1652      */\r
1653     private JMenu getJMenuEditFind() {\r
1654         if (jMenuEditFind == null) {\r
1655             jMenuEditFind = new JMenu();\r
1656             jMenuEditFind.setText("Find");\r
1657             jMenuEditFind.setMnemonic('F');\r
1658 \r
1659             jMenuEditFind.add(getJMenuItemEditFindPpi());\r
1660             jMenuEditFind.add(getJMenuItemEditFindProtocol());\r
1661             jMenuEditFind.add(getJMenuItemEditFindGuid());\r
1662             jMenuEditFind.add(getJMenuItemEditFindPcd());\r
1663             jMenuEditFind.addSeparator();\r
1664 \r
1665             jMenuEditFind.add(getJMenuItemEditFindLibraryClass());\r
1666             jMenuEditFind.add(getJMenuItemEditFindLibraryInstance());\r
1667         }\r
1668         return jMenuEditFind;\r
1669     }\r
1670 \r
1671     /**\r
1672      * This method initializes jMenuItemEditFindPcd     \r
1673      *  \r
1674      * @return javax.swing.JMenuItem    \r
1675      */\r
1676     private JMenuItem getJMenuItemEditFindPcd() {\r
1677         if (jMenuItemEditFindPcd == null) {\r
1678             jMenuItemEditFindPcd = new JMenuItem();\r
1679             jMenuItemEditFindPcd.setText("All PCD entries");\r
1680             jMenuItemEditFindPcd.setMnemonic('P');\r
1681             jMenuItemEditFindPcd.addActionListener(this);\r
1682         }\r
1683         return jMenuItemEditFindPcd;\r
1684     }\r
1685 \r
1686     /**\r
1687      * This method initializes jMenuItemEditFindLibraryClass    \r
1688      *  \r
1689      * @return javax.swing.JMenuItem    \r
1690      */\r
1691     private JMenuItem getJMenuItemEditFindLibraryClass() {\r
1692         if (jMenuItemEditFindLibraryClass == null) {\r
1693             jMenuItemEditFindLibraryClass = new JMenuItem();\r
1694             jMenuItemEditFindLibraryClass.setText("All Library Classes");\r
1695             jMenuItemEditFindLibraryClass.setMnemonic('C');\r
1696             jMenuItemEditFindLibraryClass.addActionListener(this);\r
1697         }\r
1698         return jMenuItemEditFindLibraryClass;\r
1699     }\r
1700 \r
1701     /**\r
1702      * This method initializes jMenuItemEditFindPpi     \r
1703      *  \r
1704      * @return javax.swing.JMenuItem    \r
1705      */\r
1706     private JMenuItem getJMenuItemEditFindPpi() {\r
1707         if (jMenuItemEditFindPpi == null) {\r
1708             jMenuItemEditFindPpi = new JMenuItem();\r
1709             jMenuItemEditFindPpi.setText("All PPIs");\r
1710             jMenuItemEditFindPpi.setMnemonic('I');\r
1711             jMenuItemEditFindPpi.addActionListener(this);\r
1712         }\r
1713         return jMenuItemEditFindPpi;\r
1714     }\r
1715 \r
1716     /**\r
1717      * This method initializes jMenuItemEditFindProtocol        \r
1718      *  \r
1719      * @return javax.swing.JMenuItem    \r
1720      */\r
1721     private JMenuItem getJMenuItemEditFindProtocol() {\r
1722         if (jMenuItemEditFindProtocol == null) {\r
1723             jMenuItemEditFindProtocol = new JMenuItem();\r
1724             jMenuItemEditFindProtocol.setText("All Protocols");\r
1725             jMenuItemEditFindProtocol.setMnemonic('r');\r
1726             jMenuItemEditFindProtocol.addActionListener(this);\r
1727         }\r
1728         return jMenuItemEditFindProtocol;\r
1729     }\r
1730 \r
1731     /**\r
1732      * This method initializes jMenuItemEditFindGuid    \r
1733      *  \r
1734      * @return javax.swing.JMenuItem    \r
1735      */\r
1736     private JMenuItem getJMenuItemEditFindGuid() {\r
1737         if (jMenuItemEditFindGuid == null) {\r
1738             jMenuItemEditFindGuid = new JMenuItem();\r
1739             jMenuItemEditFindGuid.setText("All GUIDs");\r
1740             jMenuItemEditFindGuid.setMnemonic('G');\r
1741             jMenuItemEditFindGuid.addActionListener(this);\r
1742         }\r
1743         return jMenuItemEditFindGuid;\r
1744     }\r
1745 \r
1746     /**\r
1747      * This method initializes jMenuItemEditFindLibraryInstance \r
1748      *  \r
1749      * @return javax.swing.JMenuItem    \r
1750      */\r
1751     private JMenuItem getJMenuItemEditFindLibraryInstance() {\r
1752         if (jMenuItemEditFindLibraryInstance == null) {\r
1753             jMenuItemEditFindLibraryInstance = new JMenuItem();\r
1754             jMenuItemEditFindLibraryInstance.setText("All Library Instances");\r
1755             jMenuItemEditFindLibraryInstance.setMnemonic('n');\r
1756             jMenuItemEditFindLibraryInstance.addActionListener(this);\r
1757         }\r
1758         return jMenuItemEditFindLibraryInstance;\r
1759     }\r
1760 \r
1761     /* (non-Javadoc)\r
1762      * @see org.tianocore.packaging.common.ui.IFrame#main(java.lang.String[])\r
1763      *\r
1764      * Main class, start the GUI\r
1765      * \r
1766      */\r
1767     public static void main(String[] args) {\r
1768         FrameworkWizardUI module = FrameworkWizardUI.getInstance();\r
1769         module.setVisible(true);\r
1770     }\r
1771 \r
1772     /**\r
1773      This is the default constructor\r
1774      \r
1775      **/\r
1776     public FrameworkWizardUI() {\r
1777         super();\r
1778         init();\r
1779     }\r
1780 \r
1781     /**\r
1782      This method initializes this\r
1783      \r
1784      \r
1785      **/\r
1786     private void init() {\r
1787         //\r
1788         // Set current workspace and check\r
1789         // Check if exists WORKSPACE\r
1790         // \r
1791         //\r
1792         Workspace.setCurrentWorkspace(System.getenv("WORKSPACE"));\r
1793         if (!Workspace.checkCurrentWorkspace()) {\r
1794             JOptionPane.showConfirmDialog(null, "Workspace is not setup correctly. Please setup first.", "Warning",\r
1795                                           JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE);\r
1796             this.dispose();\r
1797             System.exit(0);\r
1798         }\r
1799 \r
1800         //\r
1801         // Init Global Data\r
1802         //\r
1803         GlobalData.init();\r
1804 \r
1805         //\r
1806         // Init the frame\r
1807         //\r
1808         this.setSize(DataType.MAIN_FRAME_PREFERRED_SIZE_WIDTH, DataType.MAIN_FRAME_PREFERRED_SIZE_HEIGHT);\r
1809         this.setResizable(true);\r
1810         this.setJMenuBar(getjJMenuBar());\r
1811         this.setContentPane(getJContentPane());\r
1812         this.setTitle(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION + " " + "- ["\r
1813                       + Workspace.getCurrentWorkspace() + "]");\r
1814         this.setExitType(1);\r
1815 \r
1816         //\r
1817         // max the window\r
1818         //\r
1819         this.setExtendedState(JFrame.MAXIMIZED_BOTH);\r
1820     }\r
1821 \r
1822     /**\r
1823      This method initializes jContentPane\r
1824      \r
1825      @return javax.swing.JPanel jContentPane\r
1826      \r
1827      **/\r
1828     private JPanel getJContentPane() {\r
1829         if (jContentPane == null) {\r
1830             jContentPane = new JPanel();\r
1831             jContentPane.setLayout(null);\r
1832             jContentPane.add(getJPanelOperation(), null);\r
1833             jContentPane.add(getJSplitPane(), null);\r
1834         }\r
1835         return jContentPane;\r
1836     }\r
1837 \r
1838     /* (non-Javadoc)\r
1839      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r
1840      *\r
1841      * Override actionPerformed to listen all actions\r
1842      *\r
1843      */\r
1844     public void actionPerformed(ActionEvent arg0) {\r
1845         //\r
1846         // Operations of Menu\r
1847         //\r
1848         if (arg0.getSource() == this.jMenuItemFileNew) {\r
1849             this.fileNew();\r
1850         }\r
1851 \r
1852         if (arg0.getSource() == this.jMenuItemFileOpen) {\r
1853             this.open();\r
1854         }\r
1855 \r
1856         if (arg0.getSource() == this.jMenuItemFileClose) {\r
1857             this.close();\r
1858         }\r
1859 \r
1860         if (arg0.getSource() == this.jMenuItemFileCloseAll) {\r
1861             this.closeAll();\r
1862         }\r
1863 \r
1864         if (arg0.getSource() == this.jMenuItemFileSave) {\r
1865             this.save();\r
1866         }\r
1867 \r
1868         if (arg0.getSource() == this.jMenuItemFileSaveAs) {\r
1869             this.saveAs();\r
1870         }\r
1871 \r
1872         if (arg0.getSource() == this.jMenuItemFileSaveAll) {\r
1873             this.saveAll();\r
1874         }\r
1875 \r
1876         if (arg0.getSource() == this.jMenuItemFileExit) {\r
1877             this.exit();\r
1878         }\r
1879 \r
1880         if (arg0.getSource() == this.jMenuItemEditFindPpi) {\r
1881 //            this.findPpi();\r
1882         }\r
1883 \r
1884         if (arg0.getSource() == this.jMenuItemProjectChangeWorkspace) {\r
1885             this.changeWorkspace();\r
1886         }\r
1887 \r
1888         if (arg0.getSource() == this.jMenuItemProjectCreateFar) {\r
1889             this.createFar();\r
1890         }\r
1891 \r
1892         if (arg0.getSource() == this.jMenuItemProjectInstallFar) {\r
1893             this.installFar();\r
1894         }\r
1895 \r
1896         if (arg0.getSource() == this.jMenuItemProjectRemoveFar) {\r
1897             this.removeFar();\r
1898         }\r
1899 \r
1900         if (arg0.getSource() == this.jMenuItemProjectUpdateFar) {\r
1901             this.updateFar();\r
1902         }\r
1903 \r
1904         if (arg0.getSource() == this.jMenuItemToolsClone) {\r
1905             this.cloneItem();\r
1906         }\r
1907 \r
1908         if (arg0.getSource() == this.jMenuItemToolsToolChainConfiguration) {\r
1909             this.setupToolChainConfiguration();\r
1910         }\r
1911 \r
1912         if (arg0.getSource() == this.jMenuItemHelpAbout) {\r
1913             About a = new About(this, true);\r
1914             int result = a.showDialog();\r
1915             if (result == DataType.RETURN_TYPE_OK) {\r
1916                 a.dispose();\r
1917             }\r
1918         }\r
1919     }\r
1920 \r
1921     /**\r
1922      Create an empty tree if no file is open\r
1923      \r
1924      **/\r
1925     private void makeEmptyTree() {\r
1926         //\r
1927         // Make root\r
1928         //\r
1929         dmtnRoot = new IDefaultMutableTreeNode("WORKSPACE", IDefaultMutableTreeNode.WORKSPACE, -1);\r
1930 \r
1931         //\r
1932         // Make Module Description\r
1933         //\r
1934         dmtnModuleDescription = new IDefaultMutableTreeNode("ModuleDescription", IDefaultMutableTreeNode.MODULE, -1);\r
1935 \r
1936         //\r
1937         // First add package\r
1938         //\r
1939         if (GlobalData.vPackageList.size() > 0) {\r
1940             for (int index = 0; index < GlobalData.vPackageList.size(); index++) {\r
1941                 IDefaultMutableTreeNode dmtnModulePackage = null;\r
1942                 IDefaultMutableTreeNode dmtnModulePackageLibrary = null;\r
1943                 IDefaultMutableTreeNode dmtnModulePackageModule = null;\r
1944 \r
1945                 dmtnModulePackage = new IDefaultMutableTreeNode(GlobalData.vPackageList.elementAt(index).getName(),\r
1946                                                                 IDefaultMutableTreeNode.MODULE_PACKAGE, false,\r
1947                                                                 GlobalData.vPackageList.elementAt(index));\r
1948                 dmtnModulePackageLibrary = new IDefaultMutableTreeNode("Library",\r
1949                                                                        IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY,\r
1950                                                                        false, GlobalData.vPackageList.elementAt(index));\r
1951                 dmtnModulePackageModule = new IDefaultMutableTreeNode("Module",\r
1952                                                                       IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,\r
1953                                                                       false, GlobalData.vPackageList.elementAt(index));\r
1954                 //\r
1955                 // And then add each module in its package\r
1956                 //\r
1957                 Vector<ModuleIdentification> vModule = wt.getAllModules(GlobalData.vPackageList.elementAt(index));\r
1958                 for (int indexJ = 0; indexJ < vModule.size(); indexJ++) {\r
1959                     if (vModule.get(indexJ).isLibrary()) {\r
1960                         dmtnModulePackageLibrary.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),\r
1961                                                                                  IDefaultMutableTreeNode.MODULE, false,\r
1962                                                                                  vModule.get(indexJ)));\r
1963                     } else {\r
1964                         dmtnModulePackageModule.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),\r
1965                                                                                 IDefaultMutableTreeNode.MODULE, false,\r
1966                                                                                 vModule.get(indexJ)));\r
1967                     }\r
1968                 }\r
1969                 if (dmtnModulePackageModule.getChildCount() > 0) {\r
1970                     dmtnModulePackage.add(dmtnModulePackageModule);\r
1971                 }\r
1972                 if (dmtnModulePackageLibrary.getChildCount() > 0) {\r
1973                     dmtnModulePackage.add(dmtnModulePackageLibrary);\r
1974                 }\r
1975 \r
1976                 dmtnModuleDescription.add(dmtnModulePackage);\r
1977             }\r
1978         }\r
1979 \r
1980         //\r
1981         // Make Package Description\r
1982         //\r
1983         dmtnPackageDescription = new IDefaultMutableTreeNode("PackageDescription", IDefaultMutableTreeNode.PACKAGE, -1);\r
1984         if (GlobalData.vPackageList.size() > 0) {\r
1985             for (int index = 0; index < GlobalData.vPackageList.size(); index++) {\r
1986                 dmtnPackageDescription.add(new IDefaultMutableTreeNode(GlobalData.vPackageList.elementAt(index)\r
1987                                                                                               .getName(),\r
1988                                                                        IDefaultMutableTreeNode.PACKAGE, false,\r
1989                                                                        GlobalData.vPackageList.elementAt(index)));\r
1990             }\r
1991         }\r
1992 \r
1993         //\r
1994         // Make Platform Description\r
1995         //\r
1996         dmtnPlatformDescription = new IDefaultMutableTreeNode("PlatformDescription", IDefaultMutableTreeNode.PLATFORM,\r
1997                                                               -1);\r
1998         if (GlobalData.vPlatformList.size() > 0) {\r
1999             for (int index = 0; index < GlobalData.vPlatformList.size(); index++) {\r
2000                 dmtnPlatformDescription.add(new IDefaultMutableTreeNode(GlobalData.vPlatformList.elementAt(index)\r
2001                                                                                                 .getName(),\r
2002                                                                         IDefaultMutableTreeNode.PLATFORM, false,\r
2003                                                                         GlobalData.vPlatformList.elementAt(index)));\r
2004             }\r
2005         }\r
2006 \r
2007         //\r
2008         // Add sub nodes to root node\r
2009         //\r
2010         dmtnRoot.add(dmtnModuleDescription);\r
2011         dmtnRoot.add(dmtnPackageDescription);\r
2012         dmtnRoot.add(dmtnPlatformDescription);\r
2013         iTree = new ITree(dmtnRoot);\r
2014         iTree.addMouseListener(this);\r
2015         jScrollPaneTree.setViewportView(iTree);\r
2016     }\r
2017 \r
2018     /* (non-Javadoc)\r
2019      * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)\r
2020      *\r
2021      * Override windowClosing to popup warning message to confirm quit\r
2022      * \r
2023      */\r
2024     public void windowClosing(WindowEvent arg0) {\r
2025         this.exit();\r
2026     }\r
2027 \r
2028     /* (non-Javadoc)\r
2029      * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)\r
2030      * \r
2031      * Override mouseClicked to check if need display popup menu\r
2032      * \r
2033      */\r
2034     public void mouseClicked(MouseEvent arg0) {\r
2035         if (arg0.getButton() == MouseEvent.BUTTON1) {\r
2036         }\r
2037         if (arg0.getButton() == MouseEvent.BUTTON3) {\r
2038         }\r
2039         //\r
2040         // When double click\r
2041         //\r
2042         if (arg0.getClickCount() == 2) {\r
2043             doubleClickModuleTreeNode();\r
2044         }\r
2045     }\r
2046 \r
2047     public void mouseEntered(MouseEvent arg0) {\r
2048         // TODO Auto-generated method stub\r
2049     }\r
2050 \r
2051     public void mouseExited(MouseEvent arg0) {\r
2052         // TODO Auto-generated method stub\r
2053     }\r
2054 \r
2055     public void mousePressed(MouseEvent arg0) {\r
2056         // TODO Auto-generated method stub\r
2057     }\r
2058 \r
2059     public void mouseReleased(MouseEvent arg0) {\r
2060         // TODO Auto-generated method stub\r
2061     }\r
2062 \r
2063     /**\r
2064      Remove all Internal Frame of Module Desktop Pane\r
2065      \r
2066      **/\r
2067     private void cleanDesktopPaneModule() {\r
2068         if (jDesktopPaneModule != null) {\r
2069             JInternalFrame[] iif = this.jDesktopPaneModule.getAllFrames();\r
2070             for (int index = 0; index < iif.length; index++) {\r
2071                 iif[index].dispose();\r
2072             }\r
2073         }\r
2074     }\r
2075 \r
2076     /**\r
2077      Remove all Internal Frame of package Desktop Pane\r
2078      \r
2079      **/\r
2080     private void cleanDesktopPanePackage() {\r
2081         if (jDesktopPanePlatform != null) {\r
2082             JInternalFrame[] iif = this.jDesktopPanePackage.getAllFrames();\r
2083             for (int index = 0; index < iif.length; index++) {\r
2084                 iif[index].dispose();\r
2085             }\r
2086         }\r
2087     }\r
2088 \r
2089     /**\r
2090      Remove all Internal Frame of platform Desktop Pane\r
2091      \r
2092      **/\r
2093     private void cleanDesktopPanePlatform() {\r
2094         if (jDesktopPanePlatform != null) {\r
2095             JInternalFrame[] iif = this.jDesktopPanePlatform.getAllFrames();\r
2096             for (int index = 0; index < iif.length; index++) {\r
2097                 iif[index].dispose();\r
2098             }\r
2099         }\r
2100     }\r
2101 \r
2102     /**\r
2103      Remove all Internal Frame of all Desktop Panes\r
2104      \r
2105      **/\r
2106     private void cleanDesktopPane() {\r
2107         cleanDesktopPaneModule();\r
2108         cleanDesktopPanePackage();\r
2109         cleanDesktopPanePlatform();\r
2110     }\r
2111 \r
2112     /**\r
2113      Set file filter as input ext\r
2114      \r
2115      @param ext\r
2116      @return\r
2117      \r
2118      **/\r
2119     private int getNewFilePath(String ext) {\r
2120         JFileChooser fc = new JFileChooser(Workspace.getCurrentWorkspace());\r
2121         fc.setAcceptAllFileFilterUsed(false);\r
2122         fc.addChoosableFileFilter(new IFileFilter(ext));\r
2123         return fc.showSaveDialog(new JPanel());\r
2124     }\r
2125 \r
2126     /**\r
2127      Add a module to tree\r
2128      \r
2129      @param mid The module node to be added\r
2130      \r
2131      **/\r
2132     private void addModuleToTree(ModuleIdentification mid) {\r
2133         //\r
2134         // Add new MsaHeader node to the tree\r
2135         //\r
2136         IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(mid.getName(), IDefaultMutableTreeNode.MODULE, true,\r
2137                                                                    mid);\r
2138         //\r
2139         // First find the module belongs to which package\r
2140         //\r
2141         IDefaultMutableTreeNode packageNode = iTree.getNodeById(dmtnModuleDescription, mid.getPackageId(),\r
2142                                                                 IDefaultMutableTreeNode.MODULE_PACKAGE);\r
2143         //\r
2144         // To check if has module node or library node\r
2145         //\r
2146         IDefaultMutableTreeNode parentModuleNode = null;\r
2147         IDefaultMutableTreeNode parentLibraryNode = null;\r
2148         boolean hasModule = false;\r
2149         boolean hasLibrary = false;\r
2150         for (int index = 0; index < packageNode.getChildCount(); index++) {\r
2151             IDefaultMutableTreeNode iNode = (IDefaultMutableTreeNode) packageNode.getChildAt(index);\r
2152             if (iNode.getCategory() == IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY) {\r
2153                 hasLibrary = true;\r
2154                 parentLibraryNode = iNode;\r
2155             }\r
2156             if (iNode.getCategory() == IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE) {\r
2157                 hasModule = true;\r
2158                 parentModuleNode = iNode;\r
2159             }\r
2160         }\r
2161 \r
2162         //\r
2163         // If is a module\r
2164         //\r
2165         if (!mid.isLibrary()) {\r
2166             //\r
2167             // Create parent node first if has no parent node\r
2168             //\r
2169             if (!hasModule) {\r
2170                 parentModuleNode = new IDefaultMutableTreeNode("Module", IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,\r
2171                                                                false, mid.getPackageId());\r
2172                 iTree.addNode(packageNode, parentModuleNode);\r
2173             }\r
2174 \r
2175             iTree.addNode(parentModuleNode, node);\r
2176         }\r
2177 \r
2178         //\r
2179         // If is a Library\r
2180         //\r
2181         if (mid.isLibrary()) {\r
2182             //\r
2183             // Create parent node first if has no parent node\r
2184             //\r
2185             if (!hasLibrary) {\r
2186                 parentLibraryNode = new IDefaultMutableTreeNode("Library",\r
2187                                                                 IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY, false,\r
2188                                                                 mid.getPackageId());\r
2189                 iTree.addNode(packageNode, parentLibraryNode);\r
2190             }\r
2191 \r
2192             iTree.addNode(parentLibraryNode, node);\r
2193         }\r
2194     }\r
2195 \r
2196     /**\r
2197      Open Module\r
2198 \r
2199      @param path input file path\r
2200      \r
2201      **/\r
2202     private void openModule(String path) {\r
2203         ModuleIdentification id = GlobalData.openingModuleList.getIdByPath(path);\r
2204         if (id == null) {\r
2205             //\r
2206             // The module is not in existing packages\r
2207             //\r
2208             Log.wrn("Open Module", "The module hasn't been added to any package of current workspace!");\r
2209             return;\r
2210         }\r
2211 \r
2212         //\r
2213         // Make the node selected\r
2214         //\r
2215         iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id,\r
2216                                                                      IDefaultMutableTreeNode.MODULE)));\r
2217         //\r
2218         // Update opening Module list information\r
2219         //\r
2220         if (!GlobalData.openingModuleList.getModuleOpen(id)) {\r
2221             //\r
2222             // Insert sub node of module\r
2223             //\r
2224             insertModuleTreeNode(id);\r
2225             iTree.getSelectNode().setOpening(true);\r
2226 \r
2227             //\r
2228             // Update opening module list\r
2229             //\r
2230             GlobalData.openingModuleList.setModuleOpen(id, true);\r
2231             GlobalData.openingModuleList.setTreePathById(id, iTree.getSelectionPath());\r
2232         }\r
2233         //\r
2234         // Select msa header node and show it in editor panel\r
2235         //\r
2236         iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id,\r
2237                                                                      IDefaultMutableTreeNode.MSA_HEADER)));\r
2238         showModuleElement(IDefaultMutableTreeNode.MSA_HEADER, GlobalData.openingModuleList.getOpeningModuleById(id));\r
2239         this.currentOpeningModuleIndex = GlobalData.openingModuleList.findIndexOfListById(id);\r
2240     }\r
2241 \r
2242     /**\r
2243      Open Package\r
2244 \r
2245      @param path input file path\r
2246      \r
2247      **/\r
2248     private void openPackage(String path) {\r
2249         PackageIdentification id = GlobalData.openingPackageList.getIdByPath(path);\r
2250         if (id == null) {\r
2251             //\r
2252             // The package is not in current workspace\r
2253             //\r
2254             Log.wrn("Open Package", "The package hasn't been added to current workspace!");\r
2255             return;\r
2256         }\r
2257 \r
2258         //\r
2259         // Make the node selected\r
2260         //\r
2261         iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPackageDescription, id,\r
2262                                                                      IDefaultMutableTreeNode.PACKAGE)));\r
2263         //\r
2264         // Update opening package list information\r
2265         //\r
2266         if (!GlobalData.openingPackageList.getPackageOpen(id)) {\r
2267             //\r
2268             // Insert sub node of module\r
2269             //\r
2270             insertPackageTreeNode(id);\r
2271             iTree.getSelectNode().setOpening(true);\r
2272 \r
2273             //\r
2274             // Update opening module list\r
2275             //\r
2276             GlobalData.openingPackageList.setPackageOpen(id, true);\r
2277             GlobalData.openingPackageList.setTreePathById(id, iTree.getSelectionPath());\r
2278         }\r
2279         //\r
2280         // Show spd header in editor panel\r
2281         //\r
2282         iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPackageDescription, id,\r
2283                                                                      IDefaultMutableTreeNode.SPD_HEADER)));\r
2284         showPackageElement(IDefaultMutableTreeNode.SPD_HEADER, GlobalData.openingPackageList.getOpeningPackageById(id));\r
2285         this.currentOpeningPackageIndex = GlobalData.openingPackageList.findIndexOfListById(id);\r
2286     }\r
2287 \r
2288     /**\r
2289      Open Package\r
2290 \r
2291      @param path input file path\r
2292      \r
2293      **/\r
2294     private void openPlatform(String path) {\r
2295         PlatformIdentification id = GlobalData.openingPlatformList.getIdByPath(path);\r
2296         if (id == null) {\r
2297             //\r
2298             // The platform is not in current workspace\r
2299             //\r
2300             Log.wrn("Open Platform", "The platform hasn't been added to current workspace!");\r
2301             return;\r
2302         }\r
2303 \r
2304         //\r
2305         // Make the node selected\r
2306         //\r
2307         iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPlatformDescription, id,\r
2308                                                                      IDefaultMutableTreeNode.PLATFORM)));\r
2309         //\r
2310         // Update opening package list information\r
2311         //\r
2312         if (!GlobalData.openingPlatformList.getPlatformOpen(id)) {\r
2313             //\r
2314             // Insert sub node of module\r
2315             //\r
2316             insertPlatformTreeNode(id);\r
2317             iTree.getSelectNode().setOpening(true);\r
2318 \r
2319             //\r
2320             // Update opening module list\r
2321             //\r
2322             GlobalData.openingPlatformList.setPlatformOpen(id, true);\r
2323             GlobalData.openingPlatformList.setTreePathById(id, iTree.getSelectionPath());\r
2324         }\r
2325         //\r
2326         // Show fpd header in editor panel\r
2327         //\r
2328         iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPlatformDescription, id,\r
2329                                                                      IDefaultMutableTreeNode.FPD_PLATFORMHEADER)));\r
2330         showPlatformElement(IDefaultMutableTreeNode.FPD_PLATFORMHEADER,\r
2331                             GlobalData.openingPlatformList.getOpeningPlatformById(id));\r
2332         this.currentOpeningPlatformIndex = GlobalData.openingPlatformList.findIndexOfListById(id);\r
2333     }\r
2334 \r
2335     /**\r
2336      Save module \r
2337      \r
2338      **/\r
2339     private void saveModule(int index) {\r
2340         OpeningModuleType omt = GlobalData.openingModuleList.getOpeningModuleByIndex(index);\r
2341         if (omt.isNew()) {\r
2342             if (getNewFilePath(DataType.MODULE_SURFACE_AREA_EXT) != JFileChooser.APPROVE_OPTION) {\r
2343                 return;\r
2344             }\r
2345         }\r
2346         try {\r
2347             SaveFile.saveMsaFile(omt.getId().getPath(), omt.getXmlMsa());\r
2348             GlobalData.openingModuleList.setNew(omt.getId(), false);\r
2349             GlobalData.openingModuleList.setModuleSaved(omt.getId(), true);\r
2350         } catch (Exception e) {\r
2351             Log.wrn("Save Module", e.getMessage());\r
2352             Log.err("Save Module", e.getMessage());\r
2353         }\r
2354     }\r
2355 \r
2356     /**\r
2357      Save package \r
2358      \r
2359      **/\r
2360     private void savePackage(int index) {\r
2361         OpeningPackageType opt = GlobalData.openingPackageList.getOpeningPackageByIndex(index);\r
2362         if (opt.isNew()) {\r
2363             if (getNewFilePath(DataType.PACKAGE_SURFACE_AREA_EXT) != JFileChooser.APPROVE_OPTION) {\r
2364                 return;\r
2365             }\r
2366         }\r
2367         try {\r
2368             SaveFile.saveSpdFile(opt.getId().getPath(), opt.getXmlSpd());\r
2369             GlobalData.openingPackageList.setNew(opt.getId(), false);\r
2370             GlobalData.openingPackageList.setPackageSaved(opt.getId(), true);\r
2371         } catch (Exception e) {\r
2372             Log.wrn("Save Package", e.getMessage());\r
2373             Log.err("Save Package", e.getMessage());\r
2374         }\r
2375     }\r
2376 \r
2377     /**\r
2378      Save platform \r
2379      \r
2380      **/\r
2381     private void savePlatform(int index) {\r
2382         OpeningPlatformType opt = GlobalData.openingPlatformList.getOpeningPlatformByIndex(index);\r
2383         if (opt.isNew()) {\r
2384             if (getNewFilePath(DataType.PACKAGE_SURFACE_AREA_EXT) != JFileChooser.APPROVE_OPTION) {\r
2385                 return;\r
2386             }\r
2387         }\r
2388         try {\r
2389             SaveFile.saveFpdFile(opt.getId().getPath(), opt.getXmlFpd());\r
2390             GlobalData.openingPlatformList.setNew(opt.getId(), false);\r
2391             GlobalData.openingPlatformList.setPlatformSaved(opt.getId(), true);\r
2392         } catch (Exception e) {\r
2393             Log.wrn("Save Package", e.getMessage());\r
2394             Log.err("Save Package", e.getMessage());\r
2395         }\r
2396     }\r
2397 \r
2398     public void componentResized(ComponentEvent arg0) {\r
2399         if (this.jSplitPane != null) {\r
2400             this.jSplitPane.setSize(this.getWidth() - DataType.MAIN_FRAME_WIDTH_SPACING,\r
2401                                     this.getHeight() - DataType.MAIN_FRAME_HEIGHT_SPACING);\r
2402             this.jSplitPane.validate();\r
2403             resizeDesktopPanel();\r
2404         }\r
2405     }\r
2406 \r
2407     /**\r
2408      Resize JDesktopPanel\r
2409      \r
2410      */\r
2411     private void resizeDesktopPanel() {\r
2412         resizeDesktopPanel(this.jDesktopPaneModule);\r
2413         resizeDesktopPanel(this.jDesktopPanePackage);\r
2414         resizeDesktopPanel(this.jDesktopPanePlatform);\r
2415     }\r
2416 \r
2417     /**\r
2418      Resize JDesktopPanel\r
2419      \r
2420      */\r
2421     private void resizeDesktopPanel(JDesktopPane jdk) {\r
2422         JInternalFrame[] iif = jdk.getAllFrames();\r
2423         for (int index = 0; index < iif.length; index++) {\r
2424             iif[index].setSize(jdk.getWidth(), jdk.getHeight());\r
2425         }\r
2426     }\r
2427 \r
2428     private void insertModuleTreeNode(Identification id) {\r
2429         iTree.addNode(new IDefaultMutableTreeNode("Module Header", IDefaultMutableTreeNode.MSA_HEADER, true, id));\r
2430         iTree.addNode(new IDefaultMutableTreeNode("Source Files", IDefaultMutableTreeNode.MSA_SOURCEFILES, true, id));\r
2431         iTree.addNode(new IDefaultMutableTreeNode("Library Class Definitions",\r
2432                                                   IDefaultMutableTreeNode.MSA_LIBRARYCLASSDEFINITIONS, true, id));\r
2433         iTree.addNode(new IDefaultMutableTreeNode("Package Dependencies",\r
2434                                                   IDefaultMutableTreeNode.MSA_PACKAGEDEPENDENCIES, true, id));\r
2435         iTree.addNode(new IDefaultMutableTreeNode("Protocols", IDefaultMutableTreeNode.MSA_PROTOCOLS, true, id));\r
2436         iTree.addNode(new IDefaultMutableTreeNode("Events", IDefaultMutableTreeNode.MSA_EVENTS, true, id));\r
2437         iTree.addNode(new IDefaultMutableTreeNode("Hobs", IDefaultMutableTreeNode.MSA_HOBS, true, id));\r
2438         iTree.addNode(new IDefaultMutableTreeNode("Ppis", IDefaultMutableTreeNode.MSA_PPIS, true, id));\r
2439         iTree.addNode(new IDefaultMutableTreeNode("Variables", IDefaultMutableTreeNode.MSA_VARIABLES, true, id));\r
2440         iTree.addNode(new IDefaultMutableTreeNode("Boot Modes", IDefaultMutableTreeNode.MSA_BOOTMODES, true, id));\r
2441         iTree.addNode(new IDefaultMutableTreeNode("System Tables", IDefaultMutableTreeNode.MSA_SYSTEMTABLES, true, id));\r
2442         iTree.addNode(new IDefaultMutableTreeNode("Data Hubs", IDefaultMutableTreeNode.MSA_DATAHUBS, true, id));\r
2443         iTree.addNode(new IDefaultMutableTreeNode("Hii Packages", IDefaultMutableTreeNode.MSA_HIIPACKAGES, true, id));\r
2444         iTree.addNode(new IDefaultMutableTreeNode("Guids", IDefaultMutableTreeNode.MSA_GUIDS, true, id));\r
2445         iTree.addNode(new IDefaultMutableTreeNode("Externs", IDefaultMutableTreeNode.MSA_EXTERNS, true, id));\r
2446         iTree.addNode(new IDefaultMutableTreeNode("PcdCoded", IDefaultMutableTreeNode.MSA_PCDS, true, id));\r
2447     }\r
2448 \r
2449     private void insertPackageTreeNode(Identification id) {\r
2450         iTree.addNode(new IDefaultMutableTreeNode("Package Header", IDefaultMutableTreeNode.SPD_HEADER, true, id));\r
2451         iTree.addNode(new IDefaultMutableTreeNode("Library Class Declarations",\r
2452                                                   IDefaultMutableTreeNode.SPD_LIBRARYCLASSDECLARATIONS, true, id));\r
2453         iTree.addNode(new IDefaultMutableTreeNode("Msa Files", IDefaultMutableTreeNode.SPD_MSAFILES, false, id));\r
2454         iTree.addNode(new IDefaultMutableTreeNode("Package Includes", IDefaultMutableTreeNode.SPD_PACKAGEHEADERS, true,\r
2455                                                   id));\r
2456         iTree.addNode(new IDefaultMutableTreeNode("Guid Declarations", IDefaultMutableTreeNode.SPD_GUIDDECLARATIONS,\r
2457                                                   true, id));\r
2458         iTree.addNode(new IDefaultMutableTreeNode("Protocol Declarations",\r
2459                                                   IDefaultMutableTreeNode.SPD_PROTOCOLDECLARATIONS, true, id));\r
2460         iTree.addNode(new IDefaultMutableTreeNode("Ppi Declarations", IDefaultMutableTreeNode.SPD_PPIDECLARATIONS,\r
2461                                                   true, id));\r
2462         iTree.addNode(new IDefaultMutableTreeNode("Pcd Declarations", IDefaultMutableTreeNode.SPD_PCDDECLARATIONS,\r
2463                                                   true, id));\r
2464     }\r
2465 \r
2466     private void insertPlatformTreeNode(Identification id) {\r
2467         iTree.addNode(new IDefaultMutableTreeNode("Platform Header", IDefaultMutableTreeNode.FPD_PLATFORMHEADER, true,\r
2468                                                   id));\r
2469         iTree.addNode(new IDefaultMutableTreeNode("Platform Definitions",\r
2470                                                   IDefaultMutableTreeNode.FPD_PLATFORMDEFINITIONS, true, id));\r
2471         iTree.addNode(new IDefaultMutableTreeNode("Flash", IDefaultMutableTreeNode.FPD_FLASH, true, id));\r
2472         iTree.addNode(new IDefaultMutableTreeNode("Framework Modules", IDefaultMutableTreeNode.FPD_FRAMEWORKMODULES,\r
2473                                                   true, id));\r
2474         iTree.addNode(new IDefaultMutableTreeNode("Pcd Dynamic Build Declarations",\r
2475                                                   IDefaultMutableTreeNode.FPD_PCDDYNAMICBUILDDECLARATIONS, true, id));\r
2476         iTree.addNode(new IDefaultMutableTreeNode("Build Options", IDefaultMutableTreeNode.FPD_BUILDOPTIONS, true, id));\r
2477     }\r
2478 \r
2479     /**\r
2480      Operate when double click a tree node\r
2481      \r
2482      **/\r
2483     private void doubleClickModuleTreeNode() {\r
2484         Identification id = null;\r
2485         int intCategory = -1;\r
2486         String path = null;\r
2487         boolean isOpen = false;\r
2488         try {\r
2489             id = iTree.getSelectNode().getId();\r
2490             intCategory = iTree.getSelectCategory();\r
2491             isOpen = iTree.getSelectNode().isOpening();\r
2492 \r
2493             if (!isOpen) {\r
2494                 //              \r
2495                 // If the node is not opened yet\r
2496                 // Insert top level elements first\r
2497                 //\r
2498                 if (intCategory == IDefaultMutableTreeNode.MODULE) {\r
2499 \r
2500                     if (intCategory == IDefaultMutableTreeNode.MODULE) {\r
2501                         path = iTree.getSelectNode().getId().getPath();\r
2502                     }\r
2503                     if (intCategory == IDefaultMutableTreeNode.PACKAGE) {\r
2504                         path = iTree.getSelectNode().getId().getPath();\r
2505                     }\r
2506                     openModule(path);\r
2507                     return;\r
2508                 }\r
2509                 if (intCategory == IDefaultMutableTreeNode.PACKAGE) {\r
2510                     path = iTree.getSelectNode().getId().getPath();\r
2511                     openPackage(path);\r
2512                     return;\r
2513                 }\r
2514                 if (intCategory == IDefaultMutableTreeNode.PLATFORM) {\r
2515                     path = iTree.getSelectNode().getId().getPath();\r
2516                     openPlatform(path);\r
2517                     return;\r
2518                 }\r
2519             }\r
2520 \r
2521             //\r
2522             // Show editor panel\r
2523             //\r
2524             if (intCategory >= IDefaultMutableTreeNode.MSA_HEADER && intCategory < IDefaultMutableTreeNode.SPD_HEADER) {\r
2525                 showModuleElement(intCategory,\r
2526                                   GlobalData.openingModuleList.getOpeningModuleById(new ModuleIdentification(id)));\r
2527                 this.currentOpeningModuleIndex = GlobalData.openingModuleList\r
2528                                                                              .findIndexOfListById(new ModuleIdentification(\r
2529                                                                                                                            id));\r
2530             }\r
2531             if (intCategory >= IDefaultMutableTreeNode.SPD_HEADER\r
2532                 && intCategory < IDefaultMutableTreeNode.FPD_PLATFORMHEADER) {\r
2533                 showPackageElement(intCategory,\r
2534                                    GlobalData.openingPackageList.getOpeningPackageById(new PackageIdentification(id)));\r
2535                 this.currentOpeningPackageIndex = GlobalData.openingPackageList\r
2536                                                                                .findIndexOfListById(new PackageIdentification(\r
2537                                                                                                                               id));\r
2538             }\r
2539             if (intCategory >= IDefaultMutableTreeNode.FPD_PLATFORMHEADER) {\r
2540                 showPlatformElement(\r
2541                                     intCategory,\r
2542                                     GlobalData.openingPlatformList\r
2543                                                                   .getOpeningPlatformById(new PlatformIdentification(id)));\r
2544                 this.currentOpeningPlatformIndex = GlobalData.openingPlatformList\r
2545                                                                                  .findIndexOfListById(new PlatformIdentification(\r
2546                                                                                                                                  id));\r
2547             }\r
2548         } catch (RuntimeException e) {\r
2549             Log.err("double click category: " + intCategory);\r
2550             Log.err("double click id path: " + id);\r
2551             Log.err("double click exception: " + e.getMessage());\r
2552         }\r
2553     }\r
2554 \r
2555     /**\r
2556      Show content of editor panel via selected element\r
2557      \r
2558      @param elementType\r
2559      @param fpd\r
2560      \r
2561      **/\r
2562     private void showPlatformElement(int elementType, OpeningPlatformType fpd) {\r
2563         this.cleanDesktopPanePlatform();\r
2564 \r
2565         switch (elementType) {\r
2566         case IDefaultMutableTreeNode.FPD_PLATFORMDEFINITIONS:\r
2567             FpdPlatformDefs frmFpdPlatformDefs = new FpdPlatformDefs(fpd);\r
2568             getJDesktopPanePlatform().add(frmFpdPlatformDefs, 1);\r
2569             break;\r
2570         case IDefaultMutableTreeNode.FPD_PLATFORMHEADER:\r
2571             FpdHeader frmFpdHeader = new FpdHeader(fpd);\r
2572             getJDesktopPanePlatform().add(frmFpdHeader, 1);\r
2573             break;\r
2574         case IDefaultMutableTreeNode.FPD_FLASH:\r
2575             FpdFlash frmFpdFlash = new FpdFlash(fpd);\r
2576             getJDesktopPanePlatform().add(frmFpdFlash, 1);\r
2577             break;\r
2578         case IDefaultMutableTreeNode.FPD_FRAMEWORKMODULES:\r
2579             FpdFrameworkModules frmFpdFrameworkModules = new FpdFrameworkModules(fpd);\r
2580             getJDesktopPanePlatform().add(frmFpdFrameworkModules, 1);\r
2581             break;\r
2582         case IDefaultMutableTreeNode.FPD_PCDDYNAMICBUILDDECLARATIONS:\r
2583             FpdDynamicPcdBuildDefinitions frmFpdDynamicPcdBuildDefinitions = new FpdDynamicPcdBuildDefinitions(fpd);\r
2584             getJDesktopPanePlatform().add(frmFpdDynamicPcdBuildDefinitions, 1);\r
2585             break;\r
2586         case IDefaultMutableTreeNode.FPD_BUILDOPTIONS:\r
2587             FpdBuildOptions frmFpdBuildOptions = new FpdBuildOptions(fpd);\r
2588             getJDesktopPanePlatform().add(frmFpdBuildOptions, 1);\r
2589             break;\r
2590         }\r
2591         this.jTabbedPaneEditor.setSelectedIndex(2);\r
2592         resizeDesktopPanel();\r
2593     }\r
2594 \r
2595     /**\r
2596      Show content of editor panel via selected element\r
2597      \r
2598      @param elementType\r
2599      @param spd\r
2600      \r
2601      */\r
2602     private void showPackageElement(int elementType, OpeningPackageType spd) {\r
2603         this.cleanDesktopPanePackage();\r
2604         Tools.dirForNewSpd = spd.getId().getPath();\r
2605         switch (elementType) {\r
2606         case IDefaultMutableTreeNode.SPD_HEADER:\r
2607             SpdHeader frmSpdHeader = new SpdHeader(spd);\r
2608             getJDesktopPanePackage().add(frmSpdHeader, 1);\r
2609             break;\r
2610         case IDefaultMutableTreeNode.SPD_LIBRARYCLASSDECLARATIONS:\r
2611             SpdLibClassDecls frmSlcd = new SpdLibClassDecls(spd);\r
2612             getJDesktopPanePackage().add(frmSlcd, 1);\r
2613             break;\r
2614         case IDefaultMutableTreeNode.SPD_MSAFILES:\r
2615             SpdMsaFiles frmSmf = new SpdMsaFiles(spd);\r
2616             getJDesktopPanePackage().add(frmSmf, 1);\r
2617             break;\r
2618         case IDefaultMutableTreeNode.SPD_PACKAGEHEADERS:\r
2619             SpdPackageHeaders frmSph = new SpdPackageHeaders(spd);\r
2620             getJDesktopPanePackage().add(frmSph, 1);\r
2621             break;\r
2622         case IDefaultMutableTreeNode.SPD_GUIDDECLARATIONS:\r
2623             SpdGuidDecls frmSgd = new SpdGuidDecls(spd);\r
2624             getJDesktopPanePackage().add(frmSgd, 1);\r
2625             break;\r
2626         case IDefaultMutableTreeNode.SPD_PROTOCOLDECLARATIONS:\r
2627             SpdProtocolDecls frmSprod = new SpdProtocolDecls(spd);\r
2628             getJDesktopPanePackage().add(frmSprod, 1);\r
2629             break;\r
2630         case IDefaultMutableTreeNode.SPD_PPIDECLARATIONS:\r
2631             SpdPpiDecls frmSppid = new SpdPpiDecls(spd);\r
2632             getJDesktopPanePackage().add(frmSppid, 1);\r
2633             break;\r
2634         case IDefaultMutableTreeNode.SPD_PCDDECLARATIONS:\r
2635             SpdPcdDefs frmSpcdd = new SpdPcdDefs(spd);\r
2636             getJDesktopPanePackage().add(frmSpcdd, 1);\r
2637             break;\r
2638         }\r
2639         this.jTabbedPaneEditor.setSelectedIndex(1);\r
2640         resizeDesktopPanel();\r
2641     }\r
2642 \r
2643     /**\r
2644      Show content of editor panel via selected element\r
2645      \r
2646      @param elementType\r
2647      @param msa\r
2648      \r
2649      */\r
2650     private void showModuleElement(int elementType, OpeningModuleType msa) {\r
2651         this.cleanDesktopPaneModule();\r
2652         switch (elementType) {\r
2653         case IDefaultMutableTreeNode.MSA_HEADER:\r
2654             MsaHeader frmMsaHeader = new MsaHeader(msa);\r
2655             getJDesktopPaneModule().add(frmMsaHeader, 1);\r
2656             break;\r
2657         case IDefaultMutableTreeNode.MSA_LIBRARYCLASSDEFINITIONS:\r
2658             ModuleLibraryClassDefinitions frmMlcd = new ModuleLibraryClassDefinitions(msa);\r
2659             getJDesktopPaneModule().add(frmMlcd, 1);\r
2660             break;\r
2661         case IDefaultMutableTreeNode.MSA_PACKAGEDEPENDENCIES:\r
2662             ModulePackageDependencies frmMpd = new ModulePackageDependencies(msa);\r
2663             getJDesktopPaneModule().add(frmMpd, 1);\r
2664             break;\r
2665         case IDefaultMutableTreeNode.MSA_SOURCEFILES:\r
2666             ModuleSourceFiles frmMsf = new ModuleSourceFiles(msa);\r
2667             getJDesktopPaneModule().add(frmMsf, 1);\r
2668             break;\r
2669         case IDefaultMutableTreeNode.MSA_PROTOCOLS:\r
2670             ModuleProtocols frmMp = new ModuleProtocols(msa);\r
2671             getJDesktopPaneModule().add(frmMp, 1);\r
2672             break;\r
2673         case IDefaultMutableTreeNode.MSA_EVENTS:\r
2674             ModuleEvents frmMe = new ModuleEvents(msa);\r
2675             getJDesktopPaneModule().add(frmMe, 1);\r
2676             break;\r
2677         case IDefaultMutableTreeNode.MSA_HOBS:\r
2678             ModuleHobs frmMh = new ModuleHobs(msa);\r
2679             getJDesktopPaneModule().add(frmMh, 1);\r
2680             break;\r
2681         case IDefaultMutableTreeNode.MSA_PPIS:\r
2682             ModulePpis frmMpp = new ModulePpis(msa);\r
2683             getJDesktopPaneModule().add(frmMpp, 1);\r
2684             break;\r
2685         case IDefaultMutableTreeNode.MSA_VARIABLES:\r
2686             ModuleVariables frmMv = new ModuleVariables(msa);\r
2687             getJDesktopPaneModule().add(frmMv, 1);\r
2688             break;\r
2689         case IDefaultMutableTreeNode.MSA_BOOTMODES:\r
2690             ModuleBootModes frmMbm = new ModuleBootModes(msa);\r
2691             getJDesktopPaneModule().add(frmMbm, 1);\r
2692             break;\r
2693         case IDefaultMutableTreeNode.MSA_SYSTEMTABLES:\r
2694             ModuleSystemTables frmMst = new ModuleSystemTables(msa);\r
2695             getJDesktopPaneModule().add(frmMst, 1);\r
2696             break;\r
2697         case IDefaultMutableTreeNode.MSA_DATAHUBS:\r
2698             ModuleDataHubs frmMdh = new ModuleDataHubs(msa);\r
2699             getJDesktopPaneModule().add(frmMdh, 1);\r
2700             break;\r
2701         case IDefaultMutableTreeNode.MSA_HIIPACKAGES:\r
2702             ModuleHiiPackages frmMf = new ModuleHiiPackages(msa);\r
2703             getJDesktopPaneModule().add(frmMf, 1);\r
2704             break;\r
2705         case IDefaultMutableTreeNode.MSA_GUIDS:\r
2706             ModuleGuids frmGuid = new ModuleGuids(msa);\r
2707             getJDesktopPaneModule().add(frmGuid, 1);\r
2708             break;\r
2709         case IDefaultMutableTreeNode.MSA_EXTERNS:\r
2710             ModuleExterns frmMex = new ModuleExterns(msa);\r
2711             getJDesktopPaneModule().add(frmMex, 1);\r
2712             break;\r
2713         case IDefaultMutableTreeNode.MSA_PCDS:\r
2714             ModulePCDs frmPcd = new ModulePCDs(msa);\r
2715             getJDesktopPaneModule().add(frmPcd, 1);\r
2716             break;\r
2717         }\r
2718         this.jTabbedPaneEditor.setSelectedIndex(0);\r
2719         resizeDesktopPanel();\r
2720     }\r
2721 \r
2722     //\r
2723     // Define operations of menu\r
2724     //\r
2725     /**\r
2726      New a file\r
2727      \r
2728      **/\r
2729     private void fileNew() {\r
2730         int result = -1;\r
2731         //\r
2732         // Selece new file type\r
2733         //\r
2734         NewFileChooser nfc = new NewFileChooser(this, true);\r
2735         result = nfc.showDialog();\r
2736 \r
2737         if (result == DataType.RETURN_TYPE_CANCEL) {\r
2738             nfc.dispose();\r
2739             return;\r
2740         } else if (result == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {\r
2741             //\r
2742             // To new a module\r
2743             //\r
2744             SelectModuleBelong smb = new SelectModuleBelong(this, true, result);\r
2745             result = smb.showDialog();\r
2746 \r
2747             if (result == DataType.RETURN_TYPE_CANCEL) {\r
2748                 nfc.dispose();\r
2749                 smb.dispose();\r
2750                 return;\r
2751             } else if (result == DataType.RETURN_TYPE_OK) {\r
2752                 ModuleIdentification mid = smb.getMid();\r
2753                 if (mid != null) {\r
2754                     //\r
2755                     // Update package of workspace first\r
2756                     //\r
2757                     PackageSurfaceAreaDocument.PackageSurfaceArea psa = null;\r
2758                     if (GlobalData.openingPackageList.existsPackage(mid.getPackageId())) {\r
2759                         psa = GlobalData.openingPackageList.getPackageSurfaceAreaFromId(mid.getPackageId());\r
2760                     }\r
2761                     try {\r
2762                         wt.addModuleToPackage(mid, psa);\r
2763                     } catch (IOException e) {\r
2764                         Log.wrn("Upddate MsaFiles of Package", e.getMessage());\r