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