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