3 The main GUI for module editor.
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 package org
.tianocore
.frameworkwizard
;
18 import java
.awt
.event
.ActionEvent
;
19 import java
.awt
.event
.ComponentEvent
;
20 import java
.awt
.event
.ComponentListener
;
21 import java
.awt
.event
.MouseEvent
;
22 import java
.awt
.event
.MouseListener
;
23 import java
.awt
.event
.WindowEvent
;
24 import java
.io
.IOException
;
25 import java
.util
.Vector
;
27 import javax
.swing
.JButton
;
28 import javax
.swing
.JCheckBoxMenuItem
;
29 import javax
.swing
.JDesktopPane
;
30 import javax
.swing
.JFileChooser
;
31 import javax
.swing
.JFrame
;
32 import javax
.swing
.JInternalFrame
;
33 import javax
.swing
.JMenu
;
34 import javax
.swing
.JMenuBar
;
35 import javax
.swing
.JMenuItem
;
36 import javax
.swing
.JOptionPane
;
37 import javax
.swing
.JPanel
;
38 import javax
.swing
.JScrollPane
;
39 import javax
.swing
.JSplitPane
;
40 import javax
.swing
.JTabbedPane
;
41 import javax
.swing
.event
.MenuEvent
;
42 import javax
.swing
.event
.MenuListener
;
43 import javax
.swing
.event
.TreeSelectionEvent
;
44 import javax
.swing
.event
.TreeSelectionListener
;
46 import org
.apache
.xmlbeans
.XmlException
;
47 import org
.tianocore
.ModuleSurfaceAreaDocument
;
48 import org
.tianocore
.PackageSurfaceAreaDocument
;
49 import org
.tianocore
.PlatformSurfaceAreaDocument
;
50 import org
.tianocore
.frameworkwizard
.common
.DataType
;
51 import org
.tianocore
.frameworkwizard
.common
.IFileFilter
;
52 import org
.tianocore
.frameworkwizard
.common
.Log
;
53 import org
.tianocore
.frameworkwizard
.common
.SaveFile
;
54 import org
.tianocore
.frameworkwizard
.common
.Tools
;
55 import org
.tianocore
.frameworkwizard
.common
.Identifications
.Identification
;
56 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpenFile
;
57 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningModuleList
;
58 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningModuleType
;
59 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPackageList
;
60 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPackageType
;
61 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPlatformList
;
62 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPlatformType
;
63 import org
.tianocore
.frameworkwizard
.common
.ui
.IDefaultMutableTreeNode
;
64 import org
.tianocore
.frameworkwizard
.common
.ui
.IDesktopManager
;
65 import org
.tianocore
.frameworkwizard
.common
.ui
.IFrame
;
66 import org
.tianocore
.frameworkwizard
.common
.ui
.ITree
;
67 import org
.tianocore
.frameworkwizard
.far
.createui
.CreateStepOne
;
68 import org
.tianocore
.frameworkwizard
.far
.deleteui
.DeleteStepOne
;
69 import org
.tianocore
.frameworkwizard
.far
.installui
.InstallStepOne
;
70 import org
.tianocore
.frameworkwizard
.far
.updateui
.UpdateStepOne
;
71 import org
.tianocore
.frameworkwizard
.module
.Identifications
.ModuleIdentification
;
72 import org
.tianocore
.frameworkwizard
.module
.ui
.ModuleBootModes
;
73 import org
.tianocore
.frameworkwizard
.module
.ui
.ModuleDataHubs
;
74 import org
.tianocore
.frameworkwizard
.module
.ui
.ModuleDefinitions
;
75 import org
.tianocore
.frameworkwizard
.module
.ui
.ModuleEvents
;
76 import org
.tianocore
.frameworkwizard
.module
.ui
.ModuleExterns
;
77 import org
.tianocore
.frameworkwizard
.module
.ui
.ModuleGuids
;
78 import org
.tianocore
.frameworkwizard
.module
.ui
.ModuleHiiPackages
;
79 import org
.tianocore
.frameworkwizard
.module
.ui
.ModuleHobs
;
80 import org
.tianocore
.frameworkwizard
.module
.ui
.ModuleLibraryClassDefinitions
;
81 import org
.tianocore
.frameworkwizard
.module
.ui
.ModulePCDs
;
82 import org
.tianocore
.frameworkwizard
.module
.ui
.ModulePackageDependencies
;
83 import org
.tianocore
.frameworkwizard
.module
.ui
.ModulePpis
;
84 import org
.tianocore
.frameworkwizard
.module
.ui
.ModuleProtocols
;
85 import org
.tianocore
.frameworkwizard
.module
.ui
.ModuleSourceFiles
;
86 import org
.tianocore
.frameworkwizard
.module
.ui
.ModuleSystemTables
;
87 import org
.tianocore
.frameworkwizard
.module
.ui
.ModuleVariables
;
88 import org
.tianocore
.frameworkwizard
.module
.ui
.MsaHeader
;
89 import org
.tianocore
.frameworkwizard
.packaging
.PackageIdentification
;
90 import org
.tianocore
.frameworkwizard
.packaging
.ui
.SpdGuidDecls
;
91 import org
.tianocore
.frameworkwizard
.packaging
.ui
.SpdHeader
;
92 import org
.tianocore
.frameworkwizard
.packaging
.ui
.SpdLibClassDecls
;
93 import org
.tianocore
.frameworkwizard
.packaging
.ui
.SpdMsaFiles
;
94 import org
.tianocore
.frameworkwizard
.packaging
.ui
.SpdPackageDefinitions
;
95 import org
.tianocore
.frameworkwizard
.packaging
.ui
.SpdPackageHeaders
;
96 import org
.tianocore
.frameworkwizard
.packaging
.ui
.SpdPcdDefs
;
97 import org
.tianocore
.frameworkwizard
.packaging
.ui
.SpdPpiDecls
;
98 import org
.tianocore
.frameworkwizard
.packaging
.ui
.SpdProtocolDecls
;
99 import org
.tianocore
.frameworkwizard
.platform
.PlatformIdentification
;
100 import org
.tianocore
.frameworkwizard
.platform
.ui
.FpdBuildOptions
;
101 import org
.tianocore
.frameworkwizard
.platform
.ui
.FpdDynamicPcdBuildDefinitions
;
102 import org
.tianocore
.frameworkwizard
.platform
.ui
.FpdFlash
;
103 import org
.tianocore
.frameworkwizard
.platform
.ui
.FpdFrameworkModules
;
104 import org
.tianocore
.frameworkwizard
.platform
.ui
.FpdHeader
;
105 import org
.tianocore
.frameworkwizard
.platform
.ui
.FpdPlatformDefs
;
106 import org
.tianocore
.frameworkwizard
.workspace
.Workspace
;
107 import org
.tianocore
.frameworkwizard
.workspace
.WorkspaceTools
;
108 import org
.tianocore
.frameworkwizard
.workspace
.ui
.SwitchWorkspace
;
111 The class is used to show main GUI of ModuleEditor
112 It extends IFrame implements MouseListener, TreeSelectionListener
115 public class FrameworkWizardUI
extends IFrame
implements MouseListener
, TreeSelectionListener
, ComponentListener
,
118 /// Define class Serial Version UID
120 private static final long serialVersionUID
= -7103240960573031772L;
123 // To save information of all files
125 private Vector
<ModuleIdentification
> vModuleList
= new Vector
<ModuleIdentification
>();
127 private Vector
<PackageIdentification
> vPackageList
= new Vector
<PackageIdentification
>();
129 private Vector
<PlatformIdentification
> vPlatformList
= new Vector
<PlatformIdentification
>();
131 private OpeningModuleList openingModuleList
= new OpeningModuleList();
133 private OpeningPackageList openingPackageList
= new OpeningPackageList();
135 private OpeningPlatformList openingPlatformList
= new OpeningPlatformList();
137 private int currentOpeningModuleIndex
= -1;
139 private int currentOpeningPackageIndex
= -1;
141 private int currentOpeningPlatformIndex
= -1;
143 private IDefaultMutableTreeNode dmtnRoot
= null;
145 private IDefaultMutableTreeNode dmtnModuleDescription
= null;
147 private IDefaultMutableTreeNode dmtnPackageDescription
= null;
149 private IDefaultMutableTreeNode dmtnPlatformDescription
= null;
151 private JPanel jContentPane
= null;
153 private JMenuBar jMenuBar
= null;
155 private JMenu jMenuFile
= null;
157 private JMenuItem jMenuItemFileNew
= null;
159 private JMenuItem jMenuItemFileSaveAs
= null;
161 private JMenuItem jMenuItemFileExit
= null;
163 private JMenu jMenuEdit
= null;
165 private JDesktopPane jDesktopPaneModule
= null;
167 private JDesktopPane jDesktopPanePackage
= null;
169 private JDesktopPane jDesktopPanePlatform
= null;
171 private JTabbedPane jTabbedPaneTree
= null;
173 private JTabbedPane jTabbedPaneEditor
= null;
175 private IDesktopManager iDesktopManager
= new IDesktopManager();
177 private JScrollPane jScrollPaneTree
= null;
179 private ITree iTree
= null;
181 private JMenu jMenuHelp
= null;
183 private JMenuItem jMenuItemHelpAbout
= null;
185 private JMenuItem jMenuItemEditDelete
= null;
187 private WorkspaceTools wt
= new WorkspaceTools();
189 private JMenuItem jMenuItemFileSave
= null;
191 private JMenuItem jMenuItemFileClose
= null;
193 private JMenu jMenuTools
= null;
195 private JMenu jMenuWindow
= null;
197 private JPanel jPanelOperation
= null;
199 private JButton jButtonOk
= null;
201 private JButton jButtonCancel
= null;
203 private JMenuItem jMenuItemFileOpen
= null;
205 private JMenuItem jMenuItemFileCloseAll
= null;
207 private JMenuItem jMenuItemFileSaveAll
= null;
209 private JMenuItem jMenuItemFilePageSetup
= null;
211 private JMenuItem jMenuItemFilePrint
= null;
213 private JMenuItem jMenuItemFileImport
= null;
215 private JMenuItem jMenuItemFileProperties
= null;
217 private JMenu jMenuFileRecentFiles
= null;
219 private JSplitPane jSplitPane
= null;
221 private JMenuItem jMenuItemEditUndo
= null;
223 private JMenuItem jMenuItemEditRedo
= null;
225 private JMenuItem jMenuItemEditCut
= null;
227 private JMenuItem jMenuItemEditCopy
= null;
229 private JMenuItem jMenuItemEditPaste
= null;
231 private JMenuItem jMenuItemEditSelectAll
= null;
233 private JMenuItem jMenuItemEditFind
= null;
235 private JMenuItem jMenuItemEditFindNext
= null;
237 private JMenu jMenuView
= null;
239 private JMenu jMenuViewToolbars
= null;
241 private JCheckBoxMenuItem jCheckBoxMenuItemViewToolbarsFile
= null;
243 private JCheckBoxMenuItem jCheckBoxMenuItemViewToolbarsEdit
= null;
245 private JCheckBoxMenuItem jCheckBoxMenuItemViewToolbarsWindow
= null;
247 private JMenuItem jMenuItemViewStandard
= null;
249 private JMenuItem jMenuItemViewAdvanced
= null;
251 private JMenu jMenuProject
= null;
253 private JMenuItem jMenuItemProjectAdmin
= null;
255 private JMenuItem jMenuItemProjectChangeWorkspace
= null;
257 private JMenu jMenuProjectBuildTargets
= null;
259 private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsDebug
= null;
261 private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsRelease
= null;
263 private JMenuItem jMenuItemToolsToolChainConfiguration
= null;
265 private JMenuItem jMenuItemToolsClone
= null;
267 private JMenuItem jMenuItemToolsCodeScan
= null;
269 private JMenuItem jMenuItemWindowDisplaySide
= null;
271 private JMenuItem jMenuItemWindowDisplayTopBottom
= null;
273 private JMenuItem jMenuItemViewXML
= null;
275 private JMenuItem jMenuItemWindowTabView
= null;
277 private JMenuItem jMenuItemWindowSource
= null;
279 private JMenuItem jMenuItemWindowXML
= null;
281 private JMenuItem jMenuItemWindowPreferences
= null;
283 private JMenuItem jMenuItemHelpContents
= null;
285 private JMenuItem jMenuItemHelpIndex
= null;
287 private JMenuItem jMenuItemHelpSearch
= null;
289 private JMenuItem jMenuItemProjectInstallFar
= null;
291 private JMenuItem jMenuItemProjectUpdateFar
= null;
293 private JMenuItem jMenuItemProjectRemoveFar
= null;
295 //private JToolBar jToolBarFile = null;
297 //private JToolBar jToolBarEdit = null;
299 //private JToolBar jToolBarWindow = null;
301 private static FrameworkWizardUI fwui
= null;
303 private JMenuItem jMenuItemProjectCreateFar
= null;
305 public static FrameworkWizardUI
getInstance() {
307 fwui
= new FrameworkWizardUI();
313 This method initializes jMenuBar
315 @return javax.swing.JMenuBar Main menu bar for the entire GUI
318 private JMenuBar
getjJMenuBar() {
319 if (jMenuBar
== null) {
320 jMenuBar
= new JMenuBar();
321 jMenuBar
.setPreferredSize(new java
.awt
.Dimension(0, 18));
322 jMenuBar
.add(getJMenuFile());
323 jMenuBar
.add(getJMenuEdit());
324 jMenuBar
.add(getJMenuView());
325 jMenuBar
.add(getJMenuProject());
326 jMenuBar
.add(getJMenuTools());
327 jMenuBar
.add(getJMenuWindow());
328 jMenuBar
.add(getJMenuHelp());
334 This method initializes jSplitPane
336 @return javax.swing.JSplitPane
339 private JSplitPane
getJSplitPane() {
340 if (jSplitPane
== null) {
341 jSplitPane
= new JSplitPane(JSplitPane
.HORIZONTAL_SPLIT
, getJTabbedPaneTree(), getJTabbedPaneEditor());
342 jSplitPane
.setBounds(new java
.awt
.Rectangle(0, 1, DataType
.MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_WIDTH
,
343 DataType
.MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_HEIGHT
));
344 jSplitPane
.addComponentListener(this);
350 This method initializes jTabbedPaneEditor
352 @return javax.swing.JTabbedPane
355 private JTabbedPane
getJTabbedPaneEditor() {
356 if (jTabbedPaneEditor
== null) {
357 jTabbedPaneEditor
= new JTabbedPane();
358 jTabbedPaneEditor
.setBounds(new java
.awt
.Rectangle(DataType
.MAIN_FRAME_EDITOR_PANEL_LOCATION_X
,
359 DataType
.MAIN_FRAME_EDITOR_PANEL_LOCATION_Y
,
360 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH
,
361 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT
));
363 .setMinimumSize(new java
.awt
.Dimension(
364 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH
,
365 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT
));
366 //jTabbedPaneEditor.addChangeListener(this);
367 jTabbedPaneEditor
.addTab("Module", null, getJDesktopPaneModule(), null);
368 jTabbedPaneEditor
.addTab("Package", null, getJDesktopPanePackage(), null);
369 jTabbedPaneEditor
.addTab("Platform", null, getJDesktopPanePlatform(), null);
371 return jTabbedPaneEditor
;
375 This method initializes jTabbedPaneTree
377 @return javax.swing.JTabbedPane
380 private JTabbedPane
getJTabbedPaneTree() {
381 if (jTabbedPaneTree
== null) {
382 jTabbedPaneTree
= new JTabbedPane();
384 .setPreferredSize(new java
.awt
.Dimension(
385 DataType
.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH
,
386 DataType
.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT
));
388 .setMinimumSize(new java
.awt
.Dimension(DataType
.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH
,
389 DataType
.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT
));
390 jTabbedPaneTree
.addTab("Workspace Explorer", null, getJScrollPaneTree(), null);
392 return jTabbedPaneTree
;
396 This method initializes jMenuFile
398 @return javax.swing.JMenu jMenuModule
401 private JMenu
getJMenuFile() {
402 if (jMenuFile
== null) {
403 jMenuFile
= new JMenu();
404 jMenuFile
.setText("File");
405 jMenuFile
.setMnemonic('F');
406 jMenuFile
.add(getJMenuItemFileNew());
407 jMenuFile
.add(getJMenuItemFileOpen());
408 jMenuFile
.add(getJMenuItemFileClose());
409 jMenuFile
.add(getJMenuItemFileCloseAll());
410 jMenuFile
.addSeparator();
411 jMenuFile
.add(getJMenuFileRecentFiles());
412 //jMenuFile.addSeparator();
413 jMenuFile
.add(getJMenuItemFileSave());
414 jMenuFile
.add(getJMenuItemFileSaveAs());
415 jMenuFile
.add(getJMenuItemFileSaveAll());
416 jMenuFile
.addSeparator();
417 jMenuFile
.add(getJMenuItemFilePageSetup());
418 jMenuFile
.add(getJMenuItemFilePrint());
419 //jMenuFile.addSeparator();
420 jMenuFile
.add(getJMenuItemFileImport());
421 //jMenuFile.addSeparator();
422 jMenuFile
.add(getJMenuItemFileProperties());
423 //jMenuFile.addSeparator();
424 jMenuFile
.add(getJMenuItemFileExit());
425 jMenuFile
.addMenuListener(this);
431 This method initializes jMenuItemFileSaveAs
433 @return javax.swing.JMenuItem jMenuItemFileSaveAs
436 private JMenuItem
getJMenuItemFileSaveAs() {
437 if (jMenuItemFileSaveAs
== null) {
438 jMenuItemFileSaveAs
= new JMenuItem();
439 jMenuItemFileSaveAs
.setText("Save As...");
440 jMenuItemFileSaveAs
.setMnemonic('a');
441 jMenuItemFileSaveAs
.addActionListener(this);
442 jMenuItemFileSaveAs
.setEnabled(false);
443 jMenuItemFileSaveAs
.setVisible(false);
445 return jMenuItemFileSaveAs
;
449 This method initializes jMenuItemModuleExit
451 @return javax.swing.JMenuItem jMenuItemModuleExit
454 private JMenuItem
getJMenuItemFileExit() {
455 if (jMenuItemFileExit
== null) {
456 jMenuItemFileExit
= new JMenuItem();
457 jMenuItemFileExit
.setText("Exit");
458 jMenuItemFileExit
.setMnemonic('x');
459 jMenuItemFileExit
.addActionListener(this);
461 return jMenuItemFileExit
;
465 This method initializes jMenuEdit
467 @return javax.swing.JMenu jMenuEdit
470 private JMenu
getJMenuEdit() {
471 if (jMenuEdit
== null) {
472 jMenuEdit
= new JMenu();
473 jMenuEdit
.setText("Edit");
474 jMenuEdit
.setMnemonic('E');
475 jMenuEdit
.add(getJMenuItemEditUndo());
476 jMenuEdit
.add(getJMenuItemEditRedo());
477 jMenuEdit
.addSeparator();
478 jMenuEdit
.add(getJMenuItemEditCut());
479 jMenuEdit
.add(getJMenuItemEditCopy());
480 jMenuEdit
.add(getJMenuItemEditPaste());
481 jMenuEdit
.add(getJMenuItemEditDelete());
482 jMenuEdit
.addSeparator();
483 jMenuEdit
.add(getJMenuItemEditSelectAll());
484 jMenuEdit
.add(getJMenuItemEditFind());
485 jMenuEdit
.add(getJMenuItemEditFindNext());
486 jMenuEdit
.addSeparator();
487 jMenuEdit
.setVisible(false);
493 This method initializes jDesktopPane
495 @return javax.swing.JDesktopPane jDesktopPane
498 private JDesktopPane
getJDesktopPaneModule() {
499 if (jDesktopPaneModule
== null) {
500 jDesktopPaneModule
= new JDesktopPane();
502 .setBounds(new java
.awt
.Rectangle(DataType
.MAIN_FRAME_EDITOR_PANEL_LOCATION_X
,
503 DataType
.MAIN_FRAME_EDITOR_PANEL_LOCATION_Y
,
504 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH
,
505 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT
));
507 .setMinimumSize(new java
.awt
.Dimension(
508 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH
,
509 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT
));
510 jDesktopPaneModule
.setDesktopManager(iDesktopManager
);
511 jDesktopPaneModule
.addComponentListener(this);
513 return jDesktopPaneModule
;
517 This method initializes jDesktopPane
519 @return javax.swing.JDesktopPane jDesktopPane
522 private JDesktopPane
getJDesktopPanePackage() {
523 if (jDesktopPanePackage
== null) {
524 jDesktopPanePackage
= new JDesktopPane();
526 .setBounds(new java
.awt
.Rectangle(DataType
.MAIN_FRAME_EDITOR_PANEL_LOCATION_X
,
527 DataType
.MAIN_FRAME_EDITOR_PANEL_LOCATION_Y
,
528 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH
,
529 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT
));
531 .setMinimumSize(new java
.awt
.Dimension(
532 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH
,
533 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT
));
534 jDesktopPanePackage
.setDesktopManager(iDesktopManager
);
535 jDesktopPanePackage
.addComponentListener(this);
537 return jDesktopPanePackage
;
541 This method initializes jDesktopPane
543 @return javax.swing.JDesktopPane jDesktopPane
546 private JDesktopPane
getJDesktopPanePlatform() {
547 if (jDesktopPanePlatform
== null) {
548 jDesktopPanePlatform
= new JDesktopPane();
550 .setBounds(new java
.awt
.Rectangle(
551 DataType
.MAIN_FRAME_EDITOR_PANEL_LOCATION_X
,
552 DataType
.MAIN_FRAME_EDITOR_PANEL_LOCATION_Y
,
553 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH
,
554 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT
));
556 .setMinimumSize(new java
.awt
.Dimension(
557 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH
,
558 DataType
.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT
));
559 jDesktopPanePlatform
.setDesktopManager(iDesktopManager
);
560 jDesktopPanePlatform
.addComponentListener(this);
562 return jDesktopPanePlatform
;
566 This method initializes jScrollPaneTree
568 @return javax.swing.JScrollPane jScrollPaneTree
571 private JScrollPane
getJScrollPaneTree() {
572 if (jScrollPaneTree
== null) {
573 jScrollPaneTree
= new JScrollPane();
574 //jScrollPaneTree.setBounds(new java.awt.Rectangle(0, 1, 290, 545));
576 .setPreferredSize(new java
.awt
.Dimension(
577 DataType
.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH
,
578 DataType
.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT
));
580 .setMinimumSize(new java
.awt
.Dimension(
581 DataType
.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH
/ 2,
582 DataType
.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT
));
583 jScrollPaneTree
.setViewportView(getITree());
585 return jScrollPaneTree
;
589 This method initializes iTree
591 @return org.tianocore.packaging.common.ui.ITree iTree
594 private ITree
getITree() {
596 //Before open a real module, use an empty root node for the tree
603 This method initializes jMenuHelp
605 @return javax.swing.JMenu jMenuHelp
608 private JMenu
getJMenuHelp() {
609 if (jMenuHelp
== null) {
610 jMenuHelp
= new JMenu();
611 jMenuHelp
.setText("Help");
612 jMenuHelp
.add(getJMenuItemHelpContents());
613 jMenuHelp
.add(getJMenuItemHelpIndex());
614 jMenuHelp
.add(getJMenuItemHelpSearch());
615 //jMenuHelp.addSeparator();
616 jMenuHelp
.add(getJMenuItemHelpAbout());
622 This method initializes jMenuItemHelpAbout
624 @return javax.swing.JMenuItem jMenuItemHelpAbout
627 private JMenuItem
getJMenuItemHelpAbout() {
628 if (jMenuItemHelpAbout
== null) {
629 jMenuItemHelpAbout
= new JMenuItem();
630 jMenuItemHelpAbout
.setText("About...");
631 jMenuItemHelpAbout
.addActionListener(this);
633 return jMenuItemHelpAbout
;
637 This method initializes jMenuItemEditDelete
639 @return javax.swing.JMenuItem jMenuItemEditDelete
642 private JMenuItem
getJMenuItemEditDelete() {
643 if (jMenuItemEditDelete
== null) {
644 jMenuItemEditDelete
= new JMenuItem();
645 jMenuItemEditDelete
.setText("Delete");
646 jMenuItemEditDelete
.setMnemonic('D');
647 jMenuItemEditDelete
.addActionListener(this);
649 //Disabled when no module is open
651 jMenuItemEditDelete
.setEnabled(false);
653 return jMenuItemEditDelete
;
657 // This method initializes jPopupMenu
659 // @return javax.swing.JPopupMenu jPopupMenu
662 // private JPopupMenu getJPopupMenu() {
663 // if (jPopupMenu == null) {
664 // jPopupMenu = new JPopupMenu();
666 // //Add menu items of popup menu
668 // jPopupMenu.add(getJMenuItemPopupAdd());
669 // jPopupMenu.add(getJMenuItemPopupUpdate());
670 // jPopupMenu.add(getJMenuItemPopupDelete());
671 // jPopupMenu.setBorder(new BevelBorder(BevelBorder.RAISED));
672 // jPopupMenu.addMouseListener(this);
674 // return jPopupMenu;
678 // This method initializes jMenuItemPopupAdd
680 // @return javax.swing.JMenuItem jMenuItemPopupAdd
683 // private JMenuItem getJMenuItemPopupAdd() {
684 // if (jMenuItemPopupAdd == null) {
685 // jMenuItemPopupAdd = new JMenuItem();
686 // jMenuItemPopupAdd.setText("Add");
687 // jMenuItemPopupAdd.addActionListener(this);
688 // jMenuItemPopupAdd.setEnabled(false);
690 // return jMenuItemPopupAdd;
694 // This method initializes jMenuItemPopupUpdate
696 // @return javax.swing.JMenuItem jMenuItemPopupUpdate
699 // private JMenuItem getJMenuItemPopupUpdate() {
700 // if (jMenuItemPopupUpdate == null) {
701 // jMenuItemPopupUpdate = new JMenuItem();
702 // jMenuItemPopupUpdate.setText("Update");
703 // jMenuItemPopupUpdate.addActionListener(this);
704 // jMenuItemPopupUpdate.setEnabled(false);
706 // return jMenuItemPopupUpdate;
710 // This method initializes jMenuItemPopupDelete
712 // @return javax.swing.JMenuItem jMenuItemPopupDelete
715 // private JMenuItem getJMenuItemPopupDelete() {
716 // if (jMenuItemPopupDelete == null) {
717 // jMenuItemPopupDelete = new JMenuItem();
718 // jMenuItemPopupDelete.setText("Delete");
719 // jMenuItemPopupDelete.addActionListener(this);
720 // jMenuItemPopupDelete.setEnabled(false);
722 // return jMenuItemPopupDelete;
726 This method initializes jMenuFileNew
728 @return javax.swing.JMenuItem jMenuFileNew
731 private JMenuItem
getJMenuItemFileNew() {
732 if (jMenuItemFileNew
== null) {
733 jMenuItemFileNew
= new JMenuItem();
734 jMenuItemFileNew
.setText("New...");
735 jMenuItemFileNew
.setMnemonic('N');
736 jMenuItemFileNew
.addActionListener(this);
738 return jMenuItemFileNew
;
742 This method initializes jMenuItemFileSave
744 @return javax.swing.JMenuItem jMenuItemModuleSave
747 private JMenuItem
getJMenuItemFileSave() {
748 if (jMenuItemFileSave
== null) {
749 jMenuItemFileSave
= new JMenuItem();
750 jMenuItemFileSave
.setText("Save");
751 jMenuItemFileSave
.setMnemonic('S');
752 jMenuItemFileSave
.addActionListener(this);
753 jMenuItemFileSave
.setEnabled(true);
755 return jMenuItemFileSave
;
759 This method initializes jMenuItemModuleClose
761 @return javax.swing.JMenuItem jMenuItemModuleClose
764 private JMenuItem
getJMenuItemFileClose() {
765 if (jMenuItemFileClose
== null) {
766 jMenuItemFileClose
= new JMenuItem();
767 jMenuItemFileClose
.setText("Close");
768 jMenuItemFileClose
.setMnemonic('C');
769 jMenuItemFileClose
.setEnabled(true);
770 jMenuItemFileClose
.addActionListener(this);
772 return jMenuItemFileClose
;
776 This method initializes jMenuTools
779 @return javax.swing.JMenu jMenuTools
782 private JMenu
getJMenuTools() {
783 if (jMenuTools
== null) {
784 jMenuTools
= new JMenu();
785 jMenuTools
.setText("Tools");
786 jMenuTools
.setMnemonic('T');
787 jMenuTools
.add(getJMenuItemToolsToolChainConfiguration());
788 jMenuTools
.addSeparator();
789 jMenuTools
.add(getJMenuItemToolsClone());
790 //jMenuTools.addSeparator();
791 jMenuTools
.add(getJMenuItemToolsCodeScan());
792 jMenuTools
.addMenuListener(this);
798 This method initializes jMenuWindow
801 @return javax.swing.JMenu jMenuWindow
804 private JMenu
getJMenuWindow() {
805 if (jMenuWindow
== null) {
806 jMenuWindow
= new JMenu();
807 jMenuWindow
.setText("Window");
808 jMenuWindow
.setMnemonic('W');
809 jMenuWindow
.add(getJMenuItemWindowDisplaySide());
810 jMenuWindow
.add(getJMenuItemWindowDisplayTopBottom());
811 jMenuWindow
.addSeparator();
812 jMenuWindow
.add(getJMenuItemWindowTabView());
813 jMenuWindow
.addSeparator();
814 jMenuWindow
.add(getJMenuItemWindowSource());
815 jMenuWindow
.add(getJMenuItemWindowXML());
816 jMenuWindow
.addSeparator();
817 jMenuWindow
.add(getJMenuItemWindowPreferences());
818 jMenuWindow
.setVisible(false);
824 This method initializes jPanelOperation
826 @return javax.swing.JPanel jPanelOperation
829 private JPanel
getJPanelOperation() {
830 if (jPanelOperation
== null) {
831 jPanelOperation
= new JPanel();
832 jPanelOperation
.setLayout(null);
833 jPanelOperation
.setBounds(new java
.awt
.Rectangle(295, 520, 500, 25));
834 jPanelOperation
.add(getJButtonOk(), null);
835 jPanelOperation
.add(getJButtonCancel(), null);
836 jPanelOperation
.setVisible(false);
838 return jPanelOperation
;
842 This method initializes jButtonOk
844 @return javax.swing.JButton jButtonOk
847 private JButton
getJButtonOk() {
848 if (jButtonOk
== null) {
849 jButtonOk
= new JButton();
850 jButtonOk
.setBounds(new java
.awt
.Rectangle(395, 2, 90, 20));
851 jButtonOk
.setText("Ok");
852 jButtonOk
.setEnabled(false);
853 jButtonOk
.addActionListener(this);
859 This method initializes jButtonCancel
861 @return javax.swing.JButton jButtonCancel
864 private JButton
getJButtonCancel() {
865 if (jButtonCancel
== null) {
866 jButtonCancel
= new JButton();
867 jButtonCancel
.setBounds(new java
.awt
.Rectangle(395, 2, 90, 20));
868 jButtonCancel
.setText("Cancel");
869 jButtonCancel
.setEnabled(false);
870 jButtonCancel
.addActionListener(this);
871 jButtonCancel
.setVisible(false);
873 return jButtonCancel
;
877 This method initializes jMenuItemFileOpen
879 @return javax.swing.JMenuItem jMenuItemFileOpen
881 private JMenuItem
getJMenuItemFileOpen() {
882 if (jMenuItemFileOpen
== null) {
883 jMenuItemFileOpen
= new JMenuItem();
884 jMenuItemFileOpen
.setText("Open...");
885 jMenuItemFileOpen
.setMnemonic('O');
886 jMenuItemFileOpen
.addActionListener(this);
888 return jMenuItemFileOpen
;
892 This method initializes jMenuItemFileCloseAll
894 @return javax.swing.JMenuItem jMenuItemFileOpen
896 private JMenuItem
getJMenuItemFileCloseAll() {
897 if (jMenuItemFileCloseAll
== null) {
898 jMenuItemFileCloseAll
= new JMenuItem();
899 jMenuItemFileCloseAll
.setText("Close All");
900 jMenuItemFileCloseAll
.setEnabled(true);
901 jMenuItemFileCloseAll
.addActionListener(this);
903 return jMenuItemFileCloseAll
;
907 This method initializes jMenuItemFileSaveAll
909 @return javax.swing.JMenuItem jMenuItemFileSaveAll
911 private JMenuItem
getJMenuItemFileSaveAll() {
912 if (jMenuItemFileSaveAll
== null) {
913 jMenuItemFileSaveAll
= new JMenuItem();
914 jMenuItemFileSaveAll
.setText("Save All");
915 jMenuItemFileSaveAll
.setMnemonic('v');
916 jMenuItemFileSaveAll
.setEnabled(true);
917 jMenuItemFileSaveAll
.addActionListener(this);
919 return jMenuItemFileSaveAll
;
923 This method initializes jMenuItemFilePageSetup
925 @return javax.swing.JMenuItem
927 private JMenuItem
getJMenuItemFilePageSetup() {
928 if (jMenuItemFilePageSetup
== null) {
929 jMenuItemFilePageSetup
= new JMenuItem();
930 jMenuItemFilePageSetup
.setText("Page Setup");
931 jMenuItemFilePageSetup
.setMnemonic('u');
932 jMenuItemFilePageSetup
.setEnabled(false);
933 jMenuItemFilePageSetup
.addActionListener(this);
934 jMenuItemFilePageSetup
.setVisible(false);
936 return jMenuItemFilePageSetup
;
940 This method initializes jMenuItemFilePrint
942 @return javax.swing.JMenuItem
944 private JMenuItem
getJMenuItemFilePrint() {
945 if (jMenuItemFilePrint
== null) {
946 jMenuItemFilePrint
= new JMenuItem();
947 jMenuItemFilePrint
.setText("Print");
948 jMenuItemFilePrint
.setMnemonic('P');
949 jMenuItemFilePrint
.setEnabled(false);
950 jMenuItemFilePrint
.addActionListener(this);
951 jMenuItemFilePrint
.setVisible(false);
953 return jMenuItemFilePrint
;
957 This method initializes jMenuItemFileImport
959 @return javax.swing.JMenuItem
961 private JMenuItem
getJMenuItemFileImport() {
962 if (jMenuItemFileImport
== null) {
963 jMenuItemFileImport
= new JMenuItem();
964 jMenuItemFileImport
.setText("Import");
965 jMenuItemFileImport
.setMnemonic('I');
966 jMenuItemFileImport
.setEnabled(false);
967 jMenuItemFileImport
.addActionListener(this);
968 jMenuItemFileImport
.setVisible(false);
970 return jMenuItemFileImport
;
974 * This method initializes jMenuItemFileProperties
976 * @return javax.swing.JMenuItem
978 private JMenuItem
getJMenuItemFileProperties() {
979 if (jMenuItemFileProperties
== null) {
980 jMenuItemFileProperties
= new JMenuItem();
981 jMenuItemFileProperties
.setText("Properties");
982 jMenuItemFileProperties
.setMnemonic('t');
983 jMenuItemFileProperties
.setEnabled(false);
984 jMenuItemFileProperties
.addActionListener(this);
985 jMenuItemFileProperties
.setVisible(false);
987 return jMenuItemFileProperties
;
991 * This method initializes jMenuFileRecentFiles
993 * @return javax.swing.JMenu
995 private JMenu
getJMenuFileRecentFiles() {
996 if (jMenuFileRecentFiles
== null) {
997 jMenuFileRecentFiles
= new JMenu();
998 jMenuFileRecentFiles
.setText("Recent Files");
999 jMenuFileRecentFiles
.setMnemonic('F');
1000 jMenuFileRecentFiles
.setEnabled(false);
1001 jMenuFileRecentFiles
.addActionListener(this);
1002 jMenuFileRecentFiles
.setVisible(false);
1004 return jMenuFileRecentFiles
;
1008 This method initializes jMenuItemEditUndo
1010 @return javax.swing.JMenuItem
1012 private JMenuItem
getJMenuItemEditUndo() {
1013 if (jMenuItemEditUndo
== null) {
1014 jMenuItemEditUndo
= new JMenuItem();
1015 jMenuItemEditUndo
.setText("Undo");
1016 jMenuItemEditUndo
.setMnemonic('U');
1017 jMenuItemEditUndo
.setEnabled(false);
1018 jMenuItemEditUndo
.addActionListener(this);
1020 return jMenuItemEditUndo
;
1024 This method initializes jMenuItemEditRedo
1026 @return javax.swing.JMenuItem
1028 private JMenuItem
getJMenuItemEditRedo() {
1029 if (jMenuItemEditRedo
== null) {
1030 jMenuItemEditRedo
= new JMenuItem();
1031 jMenuItemEditRedo
.setText("Redo");
1032 jMenuItemEditRedo
.setMnemonic('R');
1033 jMenuItemEditRedo
.setEnabled(false);
1034 jMenuItemEditRedo
.addActionListener(this);
1036 return jMenuItemEditRedo
;
1040 This method initializes jMenuItemEditCut
1042 @return javax.swing.JMenuItem
1044 private JMenuItem
getJMenuItemEditCut() {
1045 if (jMenuItemEditCut
== null) {
1046 jMenuItemEditCut
= new JMenuItem();
1047 jMenuItemEditCut
.setText("Cut");
1048 jMenuItemEditCut
.setMnemonic('t');
1049 jMenuItemEditCut
.setEnabled(false);
1050 jMenuItemEditCut
.addActionListener(this);
1052 return jMenuItemEditCut
;
1056 This method initializes jMenuItemEditCopy
1058 @return javax.swing.JMenuItem
1060 private JMenuItem
getJMenuItemEditCopy() {
1061 if (jMenuItemEditCopy
== null) {
1062 jMenuItemEditCopy
= new JMenuItem();
1063 jMenuItemEditCopy
.setText("Copy");
1064 jMenuItemEditCopy
.setMnemonic('C');
1065 jMenuItemEditCopy
.setEnabled(false);
1066 jMenuItemEditCopy
.addActionListener(this);
1068 return jMenuItemEditCopy
;
1072 This method initializes jMenuItemEditPaste
1074 return javax.swing.JMenuItem
1076 private JMenuItem
getJMenuItemEditPaste() {
1077 if (jMenuItemEditPaste
== null) {
1078 jMenuItemEditPaste
= new JMenuItem();
1079 jMenuItemEditPaste
.setText("Paste");
1080 jMenuItemEditPaste
.setMnemonic('P');
1081 jMenuItemEditPaste
.setEnabled(false);
1082 jMenuItemEditPaste
.addActionListener(this);
1084 return jMenuItemEditPaste
;
1088 This method initializes jMenuItem
1090 @return javax.swing.JMenuItem
1092 private JMenuItem
getJMenuItemEditSelectAll() {
1093 if (jMenuItemEditSelectAll
== null) {
1094 jMenuItemEditSelectAll
= new JMenuItem();
1095 jMenuItemEditSelectAll
.setText("Select All");
1096 jMenuItemEditSelectAll
.setMnemonic('A');
1097 jMenuItemEditSelectAll
.setEnabled(false);
1098 jMenuItemEditSelectAll
.addActionListener(this);
1100 return jMenuItemEditSelectAll
;
1104 This method initializes jMenuItemEditFind
1106 @return javax.swing.JMenuItem
1108 private JMenuItem
getJMenuItemEditFind() {
1109 if (jMenuItemEditFind
== null) {
1110 jMenuItemEditFind
= new JMenuItem();
1111 jMenuItemEditFind
.setText("Find");
1112 jMenuItemEditFind
.setMnemonic('F');
1113 jMenuItemEditFind
.setEnabled(false);
1114 jMenuItemEditFind
.addActionListener(this);
1116 return jMenuItemEditFind
;
1120 This method initializes jMenuItemEditFindNext
1122 @return javax.swing.JMenuItem
1125 private JMenuItem
getJMenuItemEditFindNext() {
1126 if (jMenuItemEditFindNext
== null) {
1127 jMenuItemEditFindNext
= new JMenuItem();
1128 jMenuItemEditFindNext
.setText("Find Next");
1129 jMenuItemEditFindNext
.setMnemonic('n');
1130 jMenuItemEditFindNext
.setEnabled(false);
1131 jMenuItemEditFindNext
.addActionListener(this);
1133 return jMenuItemEditFindNext
;
1137 This method initializes jMenuView
1139 @return javax.swing.JMenu
1142 private JMenu
getJMenuView() {
1143 if (jMenuView
== null) {
1144 jMenuView
= new JMenu();
1145 jMenuView
.setText("View");
1146 jMenuView
.setMnemonic('V');
1147 jMenuView
.add(getJMenuViewToolbars());
1148 jMenuView
.add(getJMenuItemViewAdvanced());
1149 jMenuView
.add(getJMenuItemViewStandard());
1150 jMenuView
.add(getJMenuItemViewXML());
1151 jMenuView
.setVisible(false);
1157 This method initializes jMenuViewToolbars
1159 @return javax.swing.JMenu
1162 private JMenu
getJMenuViewToolbars() {
1163 if (jMenuViewToolbars
== null) {
1164 jMenuViewToolbars
= new JMenu();
1165 jMenuViewToolbars
.setText("Toolbars");
1166 jMenuViewToolbars
.setMnemonic('T');
1167 jMenuViewToolbars
.add(getJCheckBoxMenuItemViewToolbarsFile());
1168 jMenuViewToolbars
.add(getJCheckBoxMenuItemViewToolbarsEdit());
1169 jMenuViewToolbars
.add(getJCheckBoxMenuItemViewToolbarsWindow());
1171 return jMenuViewToolbars
;
1175 This method initializes jCheckBoxMenuItemViewToolbarsFile
1177 @return javax.swing.JCheckBoxMenuItem
1180 private JCheckBoxMenuItem
getJCheckBoxMenuItemViewToolbarsFile() {
1181 if (jCheckBoxMenuItemViewToolbarsFile
== null) {
1182 jCheckBoxMenuItemViewToolbarsFile
= new JCheckBoxMenuItem();
1183 jCheckBoxMenuItemViewToolbarsFile
.setText("File");
1184 jCheckBoxMenuItemViewToolbarsFile
.setEnabled(false);
1185 jCheckBoxMenuItemViewToolbarsFile
.addActionListener(this);
1187 return jCheckBoxMenuItemViewToolbarsFile
;
1191 This method initializes jCheckBoxMenuItemViewToolbarsEdit
1193 @return javax.swing.JCheckBoxMenuItem
1196 private JCheckBoxMenuItem
getJCheckBoxMenuItemViewToolbarsEdit() {
1197 if (jCheckBoxMenuItemViewToolbarsEdit
== null) {
1198 jCheckBoxMenuItemViewToolbarsEdit
= new JCheckBoxMenuItem();
1199 jCheckBoxMenuItemViewToolbarsEdit
.setText("Edit");
1200 jCheckBoxMenuItemViewToolbarsEdit
.setEnabled(false);
1201 jCheckBoxMenuItemViewToolbarsEdit
.addActionListener(this);
1203 return jCheckBoxMenuItemViewToolbarsEdit
;
1207 This method initializes jCheckBoxMenuItemViewToolbarsWindow
1209 @return javax.swing.JCheckBoxMenuItem
1212 private JCheckBoxMenuItem
getJCheckBoxMenuItemViewToolbarsWindow() {
1213 if (jCheckBoxMenuItemViewToolbarsWindow
== null) {
1214 jCheckBoxMenuItemViewToolbarsWindow
= new JCheckBoxMenuItem();
1215 jCheckBoxMenuItemViewToolbarsWindow
.setText("Window");
1216 jCheckBoxMenuItemViewToolbarsWindow
.setEnabled(false);
1217 jCheckBoxMenuItemViewToolbarsWindow
.addActionListener(this);
1219 return jCheckBoxMenuItemViewToolbarsWindow
;
1223 This method initializes jMenuItemStandard
1225 @return javax.swing.JMenuItem
1228 private JMenuItem
getJMenuItemViewStandard() {
1229 if (jMenuItemViewStandard
== null) {
1230 jMenuItemViewStandard
= new JMenuItem();
1231 jMenuItemViewStandard
.setText("Standard");
1232 jMenuItemViewStandard
.setMnemonic('S');
1233 jMenuItemViewStandard
.setEnabled(false);
1234 jMenuItemViewStandard
.addActionListener(this);
1236 return jMenuItemViewStandard
;
1240 This method initializes jMenuItemAdvanced
1242 @return javax.swing.JMenuItem
1245 private JMenuItem
getJMenuItemViewAdvanced() {
1246 if (jMenuItemViewAdvanced
== null) {
1247 jMenuItemViewAdvanced
= new JMenuItem();
1248 jMenuItemViewAdvanced
.setText("Advanced");
1249 jMenuItemViewAdvanced
.setMnemonic('A');
1250 jMenuItemViewAdvanced
.setEnabled(false);
1251 jMenuItemViewAdvanced
.addActionListener(this);
1253 return jMenuItemViewAdvanced
;
1257 This method initializes jMenuProject
1259 @return javax.swing.JMenu
1262 private JMenu
getJMenuProject() {
1263 if (jMenuProject
== null) {
1264 jMenuProject
= new JMenu();
1265 jMenuProject
.setText("Project");
1266 jMenuProject
.setMnemonic('P');
1267 jMenuProject
.add(getJMenuItemProjectAdmin());
1268 //jMenuProject.addSeparator();
1269 jMenuProject
.add(getJMenuItemProjectChangeWorkspace());
1270 jMenuProject
.addSeparator();
1271 jMenuProject
.add(getJMenuItemProjectCreateFar());
1272 jMenuProject
.add(getJMenuItemProjectInstallFar());
1273 jMenuProject
.add(getJMenuItemProjectUpdateFar());
1274 jMenuProject
.add(getJMenuItemProjectRemoveFar());
1275 //jMenuProject.addSeparator();
1276 jMenuProject
.add(getJMenuProjectBuildTargets());
1278 return jMenuProject
;
1282 This method initializes jMenuItemProjectAdmin
1284 @return javax.swing.JMenuItem
1287 private JMenuItem
getJMenuItemProjectAdmin() {
1288 if (jMenuItemProjectAdmin
== null) {
1289 jMenuItemProjectAdmin
= new JMenuItem();
1290 jMenuItemProjectAdmin
.setText("Admin...");
1291 jMenuItemProjectAdmin
.setMnemonic('A');
1292 jMenuItemProjectAdmin
.setEnabled(false);
1293 jMenuItemProjectAdmin
.addActionListener(this);
1294 jMenuItemProjectAdmin
.setVisible(false);
1296 return jMenuItemProjectAdmin
;
1300 This method initializes jMenuItemProjectChangeWorkspace
1302 @return javax.swing.JMenuItem
1305 private JMenuItem
getJMenuItemProjectChangeWorkspace() {
1306 if (jMenuItemProjectChangeWorkspace
== null) {
1307 jMenuItemProjectChangeWorkspace
= new JMenuItem();
1308 jMenuItemProjectChangeWorkspace
.setText("Change WORKSPACE...");
1309 jMenuItemProjectChangeWorkspace
.setMnemonic('W');
1310 jMenuItemProjectChangeWorkspace
.setEnabled(true);
1311 jMenuItemProjectChangeWorkspace
.addActionListener(this);
1313 return jMenuItemProjectChangeWorkspace
;
1317 This method initializes jMenuProjectBuildTargets
1319 @return javax.swing.JMenu
1322 private JMenu
getJMenuProjectBuildTargets() {
1323 if (jMenuProjectBuildTargets
== null) {
1324 jMenuProjectBuildTargets
= new JMenu();
1325 jMenuProjectBuildTargets
.setText("Build Targets");
1326 jMenuProjectBuildTargets
.setMnemonic('T');
1327 jMenuProjectBuildTargets
.add(getJCheckBoxMenuItemProjectBuildTargetsDebug());
1328 jMenuProjectBuildTargets
.add(getJCheckBoxMenuItemProjectBuildTargetsRelease());
1329 jMenuProjectBuildTargets
.setVisible(false);
1331 return jMenuProjectBuildTargets
;
1335 This method initializes jCheckBoxMenuItemProjectBuildTargetsDebug
1337 @return javax.swing.JCheckBoxMenuItem
1340 private JCheckBoxMenuItem
getJCheckBoxMenuItemProjectBuildTargetsDebug() {
1341 if (jCheckBoxMenuItemProjectBuildTargetsDebug
== null) {
1342 jCheckBoxMenuItemProjectBuildTargetsDebug
= new JCheckBoxMenuItem();
1343 jCheckBoxMenuItemProjectBuildTargetsDebug
.setText("Debug");
1344 jCheckBoxMenuItemProjectBuildTargetsDebug
.setEnabled(false);
1346 return jCheckBoxMenuItemProjectBuildTargetsDebug
;
1350 This method initializes jCheckBoxMenuItemProjectBuildTargetsRelease
1352 @return javax.swing.JCheckBoxMenuItem
1355 private JCheckBoxMenuItem
getJCheckBoxMenuItemProjectBuildTargetsRelease() {
1356 if (jCheckBoxMenuItemProjectBuildTargetsRelease
== null) {
1357 jCheckBoxMenuItemProjectBuildTargetsRelease
= new JCheckBoxMenuItem();
1358 jCheckBoxMenuItemProjectBuildTargetsRelease
.setText("Release");
1359 jCheckBoxMenuItemProjectBuildTargetsRelease
.setEnabled(false);
1361 return jCheckBoxMenuItemProjectBuildTargetsRelease
;
1365 This method initializes jMenuItemToolsToolChainConfiguration
1367 @return javax.swing.JMenuItem
1370 private JMenuItem
getJMenuItemToolsToolChainConfiguration() {
1371 if (jMenuItemToolsToolChainConfiguration
== null) {
1372 jMenuItemToolsToolChainConfiguration
= new JMenuItem();
1373 jMenuItemToolsToolChainConfiguration
.setText("Tool Chain Configuration...");
1374 jMenuItemToolsToolChainConfiguration
.setMnemonic('C');
1375 jMenuItemToolsToolChainConfiguration
.addActionListener(this);
1377 return jMenuItemToolsToolChainConfiguration
;
1381 This method initializes jMenuItemToolsClone
1383 @return javax.swing.JMenuItem
1386 private JMenuItem
getJMenuItemToolsClone() {
1387 if (jMenuItemToolsClone
== null) {
1388 jMenuItemToolsClone
= new JMenuItem();
1389 jMenuItemToolsClone
.setText("Clone...");
1390 jMenuItemToolsClone
.setMnemonic('l');
1391 jMenuItemToolsClone
.setEnabled(true);
1392 jMenuItemToolsClone
.addActionListener(this);
1394 return jMenuItemToolsClone
;
1398 This method initializes jMenuItemToolsCodeScan
1400 @return javax.swing.JMenuItem
1403 private JMenuItem
getJMenuItemToolsCodeScan() {
1404 if (jMenuItemToolsCodeScan
== null) {
1405 jMenuItemToolsCodeScan
= new JMenuItem();
1406 jMenuItemToolsCodeScan
.setText("Code Scan...");
1407 jMenuItemToolsCodeScan
.setMnemonic('S');
1408 jMenuItemToolsCodeScan
.setEnabled(false);
1409 jMenuItemToolsCodeScan
.addActionListener(this);
1410 jMenuItemToolsCodeScan
.setVisible(false);
1412 return jMenuItemToolsCodeScan
;
1416 This method initializes jMenuItemWindowSplitVertical
1418 @return javax.swing.JMenuItem
1421 private JMenuItem
getJMenuItemWindowDisplaySide() {
1422 if (jMenuItemWindowDisplaySide
== null) {
1423 jMenuItemWindowDisplaySide
= new JMenuItem();
1424 jMenuItemWindowDisplaySide
.setText("Display Side by Side");
1425 jMenuItemWindowDisplaySide
.setMnemonic('S');
1426 jMenuItemWindowDisplaySide
.setEnabled(false);
1427 jMenuItemWindowDisplaySide
.addActionListener(this);
1429 return jMenuItemWindowDisplaySide
;
1433 This method initializes jMenuItemWindowSplitHorizontal
1435 @return javax.swing.JMenuItem
1438 private JMenuItem
getJMenuItemWindowDisplayTopBottom() {
1439 if (jMenuItemWindowDisplayTopBottom
== null) {
1440 jMenuItemWindowDisplayTopBottom
= new JMenuItem();
1441 jMenuItemWindowDisplayTopBottom
.setText("Display Top and Bottom");
1442 jMenuItemWindowDisplayTopBottom
.setMnemonic('B');
1443 jMenuItemWindowDisplayTopBottom
.setEnabled(false);
1444 jMenuItemWindowDisplayTopBottom
.addActionListener(this);
1446 return jMenuItemWindowDisplayTopBottom
;
1450 This method initializes jMenuItemViewXML
1452 @return javax.swing.JMenuItem
1455 private JMenuItem
getJMenuItemViewXML() {
1456 if (jMenuItemViewXML
== null) {
1457 jMenuItemViewXML
= new JMenuItem();
1458 jMenuItemViewXML
.setText("XML");
1459 jMenuItemViewXML
.setMnemonic('X');
1460 jMenuItemViewXML
.setEnabled(false);
1461 jMenuItemViewXML
.addActionListener(this);
1463 return jMenuItemViewXML
;
1467 This method initializes jMenuItemWindowTabView
1469 @return javax.swing.JMenuItem
1472 private JMenuItem
getJMenuItemWindowTabView() {
1473 if (jMenuItemWindowTabView
== null) {
1474 jMenuItemWindowTabView
= new JMenuItem();
1475 jMenuItemWindowTabView
.setText("Tab View");
1476 jMenuItemWindowTabView
.setMnemonic('T');
1477 jMenuItemWindowTabView
.setEnabled(false);
1478 jMenuItemWindowTabView
.addActionListener(this);
1480 return jMenuItemWindowTabView
;
1484 This method initializes jMenuItemWindowSource
1486 @return javax.swing.JMenuItem
1489 private JMenuItem
getJMenuItemWindowSource() {
1490 if (jMenuItemWindowSource
== null) {
1491 jMenuItemWindowSource
= new JMenuItem();
1492 jMenuItemWindowSource
.setText("Source");
1493 jMenuItemWindowSource
.setMnemonic('S');
1494 jMenuItemWindowSource
.setEnabled(false);
1495 jMenuItemWindowSource
.addActionListener(this);
1497 return jMenuItemWindowSource
;
1501 This method initializes jMenuItemWindowXML
1503 @return javax.swing.JMenuItem
1506 private JMenuItem
getJMenuItemWindowXML() {
1507 if (jMenuItemWindowXML
== null) {
1508 jMenuItemWindowXML
= new JMenuItem();
1509 jMenuItemWindowXML
.setText("XML");
1510 jMenuItemWindowXML
.setMnemonic('X');
1511 jMenuItemWindowXML
.setEnabled(false);
1512 jMenuItemWindowXML
.addActionListener(this);
1514 return jMenuItemWindowXML
;
1518 This method initializes jMenuItemWindowPreferences
1520 @return javax.swing.JMenuItem
1523 private JMenuItem
getJMenuItemWindowPreferences() {
1524 if (jMenuItemWindowPreferences
== null) {
1525 jMenuItemWindowPreferences
= new JMenuItem();
1526 jMenuItemWindowPreferences
.setText("Preferences");
1527 jMenuItemWindowPreferences
.setMnemonic('P');
1528 jMenuItemWindowPreferences
.setEnabled(false);
1529 jMenuItemWindowPreferences
.addActionListener(this);
1531 return jMenuItemWindowPreferences
;
1535 This method initializes jMenuItemHelpContents
1537 @return javax.swing.JMenuItem
1540 private JMenuItem
getJMenuItemHelpContents() {
1541 if (jMenuItemHelpContents
== null) {
1542 jMenuItemHelpContents
= new JMenuItem();
1543 jMenuItemHelpContents
.setText("Contents");
1544 jMenuItemHelpContents
.setMnemonic('C');
1545 jMenuItemHelpContents
.setEnabled(false);
1546 jMenuItemHelpContents
.addActionListener(this);
1547 jMenuItemHelpContents
.setVisible(false);
1549 return jMenuItemHelpContents
;
1553 This method initializes jMenuItemHelpIndex
1555 @return javax.swing.JMenuItem
1558 private JMenuItem
getJMenuItemHelpIndex() {
1559 if (jMenuItemHelpIndex
== null) {
1560 jMenuItemHelpIndex
= new JMenuItem();
1561 jMenuItemHelpIndex
.setText("Index");
1562 jMenuItemHelpIndex
.setMnemonic('I');
1563 jMenuItemHelpIndex
.setEnabled(false);
1564 jMenuItemHelpIndex
.addActionListener(this);
1565 jMenuItemHelpIndex
.setVisible(false);
1567 return jMenuItemHelpIndex
;
1571 This method initializes jMenuItemHelpSearch
1573 @return javax.swing.JMenuItem
1576 private JMenuItem
getJMenuItemHelpSearch() {
1577 if (jMenuItemHelpSearch
== null) {
1578 jMenuItemHelpSearch
= new JMenuItem();
1579 jMenuItemHelpSearch
.setText("Search");
1580 jMenuItemHelpSearch
.setMnemonic('S');
1581 jMenuItemHelpSearch
.setEnabled(false);
1582 jMenuItemHelpSearch
.addActionListener(this);
1583 jMenuItemHelpSearch
.setVisible(false);
1585 return jMenuItemHelpSearch
;
1589 * This method initializes jToolBar
1591 * @return javax.swing.JToolBar
1593 // private JToolBar getJToolBarFile() {
1594 // if (jToolBarFile == null) {
1595 // jToolBarFile = new JToolBar();
1596 // jToolBarFile.setFloatable(false);
1598 // return jToolBarFile;
1601 * This method initializes jToolBarEdit
1603 * @return javax.swing.JToolBar
1605 // private JToolBar getJToolBarEdit() {
1606 // if (jToolBarEdit == null) {
1607 // jToolBarEdit = new JToolBar();
1608 // jToolBarEdit.setFloatable(false);
1610 // return jToolBarEdit;
1613 * This method initializes jMenuItemToolsInstallPackage
1615 * @return javax.swing.JMenuItem
1617 private JMenuItem
getJMenuItemProjectInstallFar() {
1618 if (jMenuItemProjectInstallFar
== null) {
1619 jMenuItemProjectInstallFar
= new JMenuItem();
1620 jMenuItemProjectInstallFar
.setText("Install FAR");
1621 jMenuItemProjectInstallFar
.setMnemonic('I');
1622 jMenuItemProjectInstallFar
.setEnabled(true);
1623 jMenuItemProjectInstallFar
.addActionListener(this);
1625 return jMenuItemProjectInstallFar
;
1629 * This method initializes jMenuItemToolsUpdatePackage
1631 * @return javax.swing.JMenuItem
1633 private JMenuItem
getJMenuItemProjectUpdateFar() {
1634 if (jMenuItemProjectUpdateFar
== null) {
1635 jMenuItemProjectUpdateFar
= new JMenuItem();
1636 jMenuItemProjectUpdateFar
.setText("Update FAR");
1637 jMenuItemProjectUpdateFar
.setMnemonic('U');
1638 jMenuItemProjectUpdateFar
.setEnabled(true);
1639 jMenuItemProjectUpdateFar
.addActionListener(this);
1641 return jMenuItemProjectUpdateFar
;
1645 * This method initializes jMenuItemRemovePackage
1647 * @return javax.swing.JMenuItem
1649 private JMenuItem
getJMenuItemProjectRemoveFar() {
1650 if (jMenuItemProjectRemoveFar
== null) {
1651 jMenuItemProjectRemoveFar
= new JMenuItem();
1652 jMenuItemProjectRemoveFar
.setText("Remove FAR");
1653 jMenuItemProjectRemoveFar
.setMnemonic('R');
1654 jMenuItemProjectRemoveFar
.setEnabled(true);
1655 jMenuItemProjectRemoveFar
.addActionListener(this);
1657 return jMenuItemProjectRemoveFar
;
1661 * This method initializes jMenuItemProjectCreateFar
1663 * @return javax.swing.JMenuItem
1665 private JMenuItem
getJMenuItemProjectCreateFar() {
1666 if (jMenuItemProjectCreateFar
== null) {
1667 jMenuItemProjectCreateFar
= new JMenuItem();
1668 jMenuItemProjectCreateFar
.setText("Create FAR");
1669 jMenuItemProjectCreateFar
.setMnemonic('C');
1670 jMenuItemProjectCreateFar
.addActionListener(this);
1672 return jMenuItemProjectCreateFar
;
1676 * @see org.tianocore.packaging.common.ui.IFrame#main(java.lang.String[])
1678 * Main class, start the GUI
1681 public static void main(String
[] args
) {
1682 FrameworkWizardUI module
= FrameworkWizardUI
.getInstance();
1683 module
.setVisible(true);
1687 This is the default constructor
1690 public FrameworkWizardUI() {
1696 This method initializes this
1700 private void init() {
1702 // Set current workspace and check
1703 // Check if exists WORKSPACE
1706 Workspace
.setCurrentWorkspace(System
.getenv("WORKSPACE"));
1707 if (!Workspace
.checkCurrentWorkspace()) {
1708 JOptionPane
.showConfirmDialog(null, "Workspace is not setup correctly. Please setup first.", "Warning",
1709 JOptionPane
.DEFAULT_OPTION
, JOptionPane
.WARNING_MESSAGE
);
1714 this.setSize(DataType
.MAIN_FRAME_PREFERRED_SIZE_WIDTH
, DataType
.MAIN_FRAME_PREFERRED_SIZE_HEIGHT
);
1715 this.setResizable(true);
1716 this.setJMenuBar(getjJMenuBar());
1717 this.addComponentListener(this);
1718 this.getCompontentsFromFrameworkDatabase();
1719 this.setContentPane(getJContentPane());
1720 this.setTitle(DataType
.PROJECT_NAME
+ " " + DataType
.PROJECT_VERSION
+ " " + "- ["
1721 + Workspace
.getCurrentWorkspace() + "]");
1722 this.setExitType(1);
1727 this.setExtendedState(JFrame
.MAXIMIZED_BOTH
);
1731 This method initializes jContentPane
1733 @return javax.swing.JPanel jContentPane
1736 private JPanel
getJContentPane() {
1737 if (jContentPane
== null) {
1738 jContentPane
= new JPanel();
1739 jContentPane
.setLayout(null);
1740 jContentPane
.add(getJPanelOperation(), null);
1741 jContentPane
.add(getJSplitPane(), null);
1743 return jContentPane
;
1747 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
1749 * Override actionPerformed to listen all actions
1752 public void actionPerformed(ActionEvent arg0
) {
1754 // Operations of Menu
1756 if (arg0
.getSource() == jMenuItemFileNew
) {
1760 if (arg0
.getSource() == jMenuItemFileOpen
) {
1764 if (arg0
.getSource() == jMenuItemFileClose
) {
1768 if (arg0
.getSource() == jMenuItemFileCloseAll
) {
1772 if (arg0
.getSource() == jMenuItemFileSave
) {
1776 if (arg0
.getSource() == jMenuItemFileSaveAs
) {
1780 if (arg0
.getSource() == jMenuItemFileSaveAll
) {
1784 if (arg0
.getSource() == jMenuItemFileExit
) {
1788 if (arg0
.getSource() == jMenuItemProjectChangeWorkspace
) {
1792 if (arg0
.getSource() == jMenuItemProjectCreateFar
) {
1793 CreateStepOne cso
= new CreateStepOne(this, true);
1794 int result
= cso
.showDialog();
1795 if (result
== DataType
.RETURN_TYPE_OK
) {
1801 if (arg0
.getSource() == jMenuItemProjectInstallFar
) {
1802 InstallStepOne iso
= new InstallStepOne(this, true);
1803 int result
= iso
.showDialog();
1804 if (result
== DataType
.RETURN_TYPE_OK
) {
1810 if (arg0
.getSource() == jMenuItemProjectRemoveFar
) {
1811 DeleteStepOne dso
= new DeleteStepOne(this, true);
1812 int result
= dso
.showDialog();
1813 if (result
== DataType
.RETURN_TYPE_OK
) {
1819 if (arg0
.getSource() == jMenuItemProjectUpdateFar
) {
1820 UpdateStepOne uso
= new UpdateStepOne(this, true);
1821 int result
= uso
.showDialog();
1822 if (result
== DataType
.RETURN_TYPE_OK
) {
1828 if (arg0
.getSource() == jMenuItemToolsClone
) {
1832 if (arg0
.getSource() == jMenuItemToolsToolChainConfiguration
) {
1833 setupToolChainConfiguration();
1836 if (arg0
.getSource() == jMenuItemHelpAbout
) {
1837 About a
= new About(this, true);
1838 int result
= a
.showDialog();
1839 if (result
== DataType
.RETURN_TYPE_OK
) {
1846 Create an empty tree if no file is open
1849 private void makeEmptyTree() {
1851 dmtnRoot
= new IDefaultMutableTreeNode("WORKSPACE", IDefaultMutableTreeNode
.WORKSPACE
, -1);
1853 // Make Module Description
1854 dmtnModuleDescription
= new IDefaultMutableTreeNode("ModuleDescription", IDefaultMutableTreeNode
.MODULE
, -1);
1857 // First add package
1859 if (this.vPackageList
.size() > 0) {
1860 for (int index
= 0; index
< this.vPackageList
.size(); index
++) {
1861 IDefaultMutableTreeNode dmtnModulePackage
= null;
1862 IDefaultMutableTreeNode dmtnModulePackageLibrary
= null;
1863 IDefaultMutableTreeNode dmtnModulePackageModule
= null;
1865 dmtnModulePackage
= new IDefaultMutableTreeNode(this.vPackageList
.elementAt(index
).getName(),
1866 IDefaultMutableTreeNode
.MODULE_PACKAGE
, false,
1867 this.vPackageList
.elementAt(index
));
1868 dmtnModulePackageLibrary
= new IDefaultMutableTreeNode("Library",
1869 IDefaultMutableTreeNode
.MODULE_PACKAGE_LIBRARY
,
1870 false, this.vPackageList
.elementAt(index
));
1871 dmtnModulePackageModule
= new IDefaultMutableTreeNode("Module",
1872 IDefaultMutableTreeNode
.MODULE_PACKAGE_MODULE
,
1873 false, this.vPackageList
.elementAt(index
));
1875 Vector
<ModuleIdentification
> vModule
= wt
.getAllModules(this.vPackageList
.elementAt(index
));
1876 for (int indexJ
= 0; indexJ
< vModule
.size(); indexJ
++) {
1877 if (vModule
.get(indexJ
).isLibrary()) {
1878 dmtnModulePackageLibrary
.add(new IDefaultMutableTreeNode(vModule
.get(indexJ
).getName(),
1879 IDefaultMutableTreeNode
.MSA_HEADER
,
1880 false, vModule
.get(indexJ
)));
1882 dmtnModulePackageModule
.add(new IDefaultMutableTreeNode(vModule
.get(indexJ
).getName(),
1883 IDefaultMutableTreeNode
.MSA_HEADER
,
1884 false, vModule
.get(indexJ
)));
1887 if (dmtnModulePackageModule
.getChildCount() > 0) {
1888 dmtnModulePackage
.add(dmtnModulePackageModule
);
1890 if (dmtnModulePackageLibrary
.getChildCount() > 0) {
1891 dmtnModulePackage
.add(dmtnModulePackageLibrary
);
1894 dmtnModuleDescription
.add(dmtnModulePackage
);
1898 // if (this.vModuleList.size() > 0) {
1899 // for (int index = 0; index < this.vModuleList.size(); index++) {
1900 // dmtnModuleDescription.add(new IDefaultMutableTreeNode(this.vModuleList.elementAt(index).getName(),
1901 // IDefaultMutableTreeNode.MSA_HEADER, false,
1902 // this.vModuleList.elementAt(index)));
1906 // Make Package Description
1907 dmtnPackageDescription
= new IDefaultMutableTreeNode("PackageDescription", IDefaultMutableTreeNode
.PACKAGE
, -1);
1908 if (this.vPackageList
.size() > 0) {
1909 for (int index
= 0; index
< this.vPackageList
.size(); index
++) {
1910 dmtnPackageDescription
.add(new IDefaultMutableTreeNode(this.vPackageList
.elementAt(index
).getName(),
1911 IDefaultMutableTreeNode
.SPD_HEADER
, false,
1912 this.vPackageList
.elementAt(index
)));
1916 // Make Platform Description
1917 dmtnPlatformDescription
= new IDefaultMutableTreeNode("PlatformDescription", IDefaultMutableTreeNode
.PLATFORM
,
1919 if (this.vPlatformList
.size() > 0) {
1920 for (int index
= 0; index
< this.vPlatformList
.size(); index
++) {
1921 dmtnPlatformDescription
.add(new IDefaultMutableTreeNode(this.vPlatformList
.elementAt(index
).getName(),
1922 IDefaultMutableTreeNode
.FPD_PLATFORMHEADER
,
1923 false, this.vPlatformList
.elementAt(index
)));
1927 dmtnRoot
.add(dmtnModuleDescription
);
1928 dmtnRoot
.add(dmtnPackageDescription
);
1929 dmtnRoot
.add(dmtnPlatformDescription
);
1930 iTree
= new ITree(dmtnRoot
);
1931 iTree
.addMouseListener(this);
1932 jScrollPaneTree
.setViewportView(iTree
);
1936 * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)
1938 * Override windowClosing to popup warning message to confirm quit
1941 public void windowClosing(WindowEvent arg0
) {
1946 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
1948 * Override mouseClicked to check if need display popup menu
1951 public void mouseClicked(MouseEvent arg0
) {
1952 if (arg0
.getButton() == MouseEvent
.BUTTON1
) {
1954 if (arg0
.getButton() == MouseEvent
.BUTTON3
) {
1957 // When double click
1959 if (arg0
.getClickCount() == 2) {
1960 doubleClickModuleTreeNode();
1964 public void mouseEntered(MouseEvent arg0
) {
1965 // TODO Auto-generated method stub
1968 public void mouseExited(MouseEvent arg0
) {
1969 // TODO Auto-generated method stub
1972 public void mousePressed(MouseEvent arg0
) {
1973 // TODO Auto-generated method stub
1976 public void mouseReleased(MouseEvent arg0
) {
1977 // TODO Auto-generated method stub
1981 Remove all Internal Frame of Module Desktop Pane
1984 private void cleanDesktopPaneModule() {
1985 if (jDesktopPaneModule
!= null) {
1986 JInternalFrame
[] iif
= this.jDesktopPaneModule
.getAllFrames();
1987 for (int index
= 0; index
< iif
.length
; index
++) {
1988 iif
[index
].dispose();
1994 Remove all Internal Frame of package Desktop Pane
1997 private void cleanDesktopPanePackage() {
1998 if (jDesktopPanePlatform
!= null) {
1999 JInternalFrame
[] iif
= this.jDesktopPanePackage
.getAllFrames();
2000 for (int index
= 0; index
< iif
.length
; index
++) {
2001 iif
[index
].dispose();
2007 Remove all Internal Frame of platform Desktop Pane
2010 private void cleanDesktopPanePlatform() {
2011 if (jDesktopPanePlatform
!= null) {
2012 JInternalFrame
[] iif
= this.jDesktopPanePlatform
.getAllFrames();
2013 for (int index
= 0; index
< iif
.length
; index
++) {
2014 iif
[index
].dispose();
2020 Remove all Internal Frame of all Desktop Panes
2023 private void cleanDesktopPane() {
2024 cleanDesktopPaneModule();
2025 cleanDesktopPanePackage();
2026 cleanDesktopPanePlatform();
2030 Set file filter as input ext
2036 private int getNewFilePath(String ext
) {
2037 JFileChooser fc
= new JFileChooser(Workspace
.getCurrentWorkspace());
2038 fc
.setAcceptAllFileFilterUsed(false);
2039 fc
.addChoosableFileFilter(new IFileFilter(ext
));
2040 return fc
.showSaveDialog(new JPanel());
2046 @param path input file path
2049 private void openModule(String path
, ModuleIdentification moduleId
) {
2050 ModuleSurfaceAreaDocument
.ModuleSurfaceArea msa
= null;
2052 msa
= OpenFile
.openMsaFile(path
);
2053 } catch (IOException e
) {
2054 Log
.err("Open Module Surface Area " + path
, e
.getMessage());
2056 } catch (XmlException e
) {
2057 Log
.err("Open Module Surface Area " + path
, e
.getMessage());
2059 } catch (Exception e
) {
2060 Log
.err("Open Module Surface Area " + path
, "Invalid file type");
2063 Identification id
= new Identification(msa
.getMsaHeader().getModuleName(), msa
.getMsaHeader().getGuidValue(),
2064 msa
.getMsaHeader().getVersion(), path
);
2066 // Generate module id
2068 PackageIdentification pid
= wt
.getPackageIdByModuleId(id
);
2071 // To judge if the module existed in vModuleList
2072 // If not, add it to vModuleList
2074 boolean isFind
= false;
2075 for (int index
= 0; index
< vModuleList
.size(); index
++) {
2076 if (vModuleList
.elementAt(index
).equals(id
)) {
2082 ModuleIdentification mid
= new ModuleIdentification(id
, pid
, moduleId
.isLibrary());
2083 vModuleList
.addElement(mid
);
2085 // Add new MsaHeader node to the tree
2087 IDefaultMutableTreeNode node
= new IDefaultMutableTreeNode(mid
.getName(),
2088 IDefaultMutableTreeNode
.MSA_HEADER
, true,
2091 // First find the module belongs to which package
2093 IDefaultMutableTreeNode packageNode
= iTree
.getNodeById(dmtnModuleDescription
, mid
.getPackageId(),
2094 IDefaultMutableTreeNode
.MODULE_PACKAGE
);
2096 // To check if has module node or library node
2098 IDefaultMutableTreeNode parentModuleNode
= null;
2099 IDefaultMutableTreeNode parentLibraryNode
= null;
2100 boolean hasModule
= false;
2101 boolean hasLibrary
= false;
2102 for (int index
= 0; index
< packageNode
.getChildCount(); index
++) {
2103 IDefaultMutableTreeNode iNode
= (IDefaultMutableTreeNode
) packageNode
.getChildAt(index
);
2104 if (iNode
.getCategory() == IDefaultMutableTreeNode
.MODULE_PACKAGE_LIBRARY
) {
2106 parentLibraryNode
= iNode
;
2108 if (iNode
.getCategory() == IDefaultMutableTreeNode
.MODULE_PACKAGE_MODULE
) {
2110 parentModuleNode
= iNode
;
2117 if (!mid
.isLibrary()) {
2119 // Create parent node first if has no parent node
2122 parentModuleNode
= new IDefaultMutableTreeNode("Module",
2123 IDefaultMutableTreeNode
.MODULE_PACKAGE_MODULE
,
2124 false, mid
.getPackageId());
2125 iTree
.addNode(packageNode
, parentModuleNode
);
2128 iTree
.addNode(parentModuleNode
, node
);
2134 if (mid
.isLibrary()) {
2136 // Create parent node first if has no parent node
2139 parentLibraryNode
= new IDefaultMutableTreeNode("Library",
2140 IDefaultMutableTreeNode
.MODULE_PACKAGE_LIBRARY
,
2141 false, mid
.getPackageId());
2142 iTree
.addNode(packageNode
, parentLibraryNode
);
2145 iTree
.addNode(parentLibraryNode
, node
);
2150 // The module is not in existing packages
2152 Log
.err("The module hasn't been added to any package of current workspace!");
2157 // Make the node selected
2159 iTree
.setSelectionPath(iTree
.getPathOfNode(iTree
.getNodeById(this.dmtnModuleDescription
, id
,
2160 IDefaultMutableTreeNode
.MSA_HEADER
)));
2162 // Update opening Module list information
2164 if (!openingModuleList
.existsModule(id
)) {
2166 // Insert sub node of module
2168 insertModuleTreeNode(id
);
2169 iTree
.getSelectNode().setOpening(true);
2172 // Update opening module list
2174 openingModuleList
.insertToOpeningModuleList(id
, msa
);
2175 openingModuleList
.setTreePathById(id
, iTree
.getSelectionPath());
2178 // Show msa header in editor panel
2180 showModuleElement(IDefaultMutableTreeNode
.MSA_HEADER
, openingModuleList
.getOpeningModuleById(id
));
2181 this.currentOpeningModuleIndex
= openingModuleList
.findIndexOfListById(id
);
2187 @param path input file path
2190 private void openModule(String path
) {
2191 ModuleSurfaceAreaDocument
.ModuleSurfaceArea msa
= null;
2193 msa
= OpenFile
.openMsaFile(path
);
2194 } catch (IOException e
) {
2195 Log
.err("Open Module Surface Area " + path
, e
.getMessage());
2197 } catch (XmlException e
) {
2198 Log
.err("Open Module Surface Area " + path
, e
.getMessage());
2200 } catch (Exception e
) {
2201 Log
.err("Open Module Surface Area " + path
, "Invalid file type");
2204 Identification id
= new Identification(msa
.getMsaHeader().getModuleName(), msa
.getMsaHeader().getGuidValue(),
2205 msa
.getMsaHeader().getVersion(), path
);
2207 // Generate module id
2209 PackageIdentification pid
= wt
.getPackageIdByModuleId(id
);
2212 // To judge if the module existed in vModuleList
2213 // If not, add it to vModuleList
2215 boolean isFind
= false;
2216 for (int index
= 0; index
< vModuleList
.size(); index
++) {
2217 if (vModuleList
.elementAt(index
).equals(id
)) {
2223 ModuleIdentification mid
= new ModuleIdentification(id
, pid
);
2224 vModuleList
.addElement(mid
);
2226 // Add new MsaHeader node to the tree
2228 IDefaultMutableTreeNode node
= new IDefaultMutableTreeNode(mid
.getName(),
2229 IDefaultMutableTreeNode
.MSA_HEADER
, true,
2232 // First find the module belongs to which package
2234 IDefaultMutableTreeNode packageNode
= iTree
.getNodeById(dmtnModuleDescription
, mid
.getPackageId(),
2235 IDefaultMutableTreeNode
.MODULE_PACKAGE
);
2237 // To check if has module node or library node
2239 IDefaultMutableTreeNode parentModuleNode
= null;
2240 IDefaultMutableTreeNode parentLibraryNode
= null;
2241 boolean hasModule
= false;
2242 boolean hasLibrary
= false;
2243 for (int index
= 0; index
< packageNode
.getChildCount(); index
++) {
2244 IDefaultMutableTreeNode iNode
= (IDefaultMutableTreeNode
) packageNode
.getChildAt(index
);
2245 if (iNode
.getCategory() == IDefaultMutableTreeNode
.MODULE_PACKAGE_LIBRARY
) {
2247 parentLibraryNode
= iNode
;
2249 if (iNode
.getCategory() == IDefaultMutableTreeNode
.MODULE_PACKAGE_MODULE
) {
2251 parentModuleNode
= iNode
;
2258 if (!mid
.isLibrary()) {
2260 // Create parent node first if has no parent node
2263 parentModuleNode
= new IDefaultMutableTreeNode("Module",
2264 IDefaultMutableTreeNode
.MODULE_PACKAGE_MODULE
,
2265 false, mid
.getPackageId());
2266 iTree
.addNode(packageNode
, parentModuleNode
);
2269 iTree
.addNode(parentModuleNode
, node
);
2275 if (mid
.isLibrary()) {
2277 // Create parent node first if has no parent node
2280 parentLibraryNode
= new IDefaultMutableTreeNode("Library",
2281 IDefaultMutableTreeNode
.MODULE_PACKAGE_LIBRARY
,
2282 false, mid
.getPackageId());
2283 iTree
.addNode(packageNode
, parentLibraryNode
);
2286 iTree
.addNode(parentLibraryNode
, node
);
2291 // The module is not in existing packages
2293 Log
.err("The module hasn't been added to any package of current workspace!");
2298 // Make the node selected
2300 iTree
.setSelectionPath(iTree
.getPathOfNode(iTree
.getNodeById(this.dmtnModuleDescription
, id
,
2301 IDefaultMutableTreeNode
.MSA_HEADER
)));
2303 // Update opening Module list information
2305 if (!openingModuleList
.existsModule(id
)) {
2307 // Insert sub node of module
2309 insertModuleTreeNode(id
);
2310 iTree
.getSelectNode().setOpening(true);
2313 // Update opening module list
2315 openingModuleList
.insertToOpeningModuleList(id
, msa
);
2316 openingModuleList
.setTreePathById(id
, iTree
.getSelectionPath());
2319 // Show msa header in editor panel
2321 showModuleElement(IDefaultMutableTreeNode
.MSA_HEADER
, openingModuleList
.getOpeningModuleById(id
));
2322 this.currentOpeningModuleIndex
= openingModuleList
.findIndexOfListById(id
);
2328 @param path input file path
2331 private void openPackage(String path
) {
2332 PackageSurfaceAreaDocument
.PackageSurfaceArea spd
= null;
2334 spd
= OpenFile
.openSpdFile(path
);
2335 } catch (IOException e
) {
2336 Log
.err("Open Package Surface Area " + path
, e
.getMessage());
2338 } catch (XmlException e
) {
2339 Log
.err("Open Package Surface Area " + path
, e
.getMessage());
2341 } catch (Exception e
) {
2342 Log
.err("Open Package Surface Area " + path
, "Invalid file type");
2345 Identification id
= new Identification(spd
.getSpdHeader().getPackageName(), spd
.getSpdHeader().getGuidValue(),
2346 spd
.getSpdHeader().getVersion(), path
);
2348 // To judge if the package existed in vPackageList
2349 // If not, add it to vPackageList
2351 boolean isFind
= false;
2352 for (int index
= 0; index
< vPackageList
.size(); index
++) {
2353 if (vPackageList
.elementAt(index
).equals(id
)) {
2360 // The module is not in existing packages
2362 Log
.err("The package hasn't been added to current workspace!");
2367 // Make the node selected
2369 iTree
.setSelectionPath(iTree
.getPathOfNode(iTree
.getNodeById(this.dmtnPackageDescription
, id
,
2370 IDefaultMutableTreeNode
.SPD_HEADER
)));
2372 // Update opening package list information
2374 if (!openingPackageList
.existsPackage(id
)) {
2376 // Insert sub node of module
2378 insertPackageTreeNode(id
);
2379 iTree
.getSelectNode().setOpening(true);
2382 // Update opening module list
2384 openingPackageList
.insertToOpeningPackageList(id
, spd
);
2385 openingPackageList
.setTreePathById(id
, iTree
.getSelectionPath());
2388 // Show spd header in editor panel
2390 showPackageElement(IDefaultMutableTreeNode
.SPD_HEADER
, openingPackageList
.getOpeningPackageById(id
));
2391 this.currentOpeningPackageIndex
= openingPackageList
.findIndexOfListById(id
);
2397 @param path input file path
2400 private void openPlatform(String path
) {
2401 PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
= null;
2403 fpd
= OpenFile
.openFpdFile(path
);
2404 } catch (IOException e
) {
2405 Log
.err("Open Platform Surface Area " + path
, e
.getMessage());
2407 } catch (XmlException e
) {
2408 Log
.err("Open Platform Surface Area " + path
, e
.getMessage());
2410 } catch (Exception e
) {
2411 Log
.err("Open Platform Surface Area " + path
, "Invalid file type");
2414 Identification id
= new Identification(fpd
.getPlatformHeader().getPlatformName(), fpd
.getPlatformHeader()
2416 fpd
.getPlatformHeader().getVersion(), path
);
2418 // To judge if the platform existed in vPlatformList
2419 // If not, add it to vPlatformList
2421 boolean isFind
= false;
2422 for (int index
= 0; index
< vPlatformList
.size(); index
++) {
2423 if (vPlatformList
.elementAt(index
).equals(id
)) {
2430 // The module is not in existing packages
2432 Log
.err("The platform hasn't been added to current workspace!");
2437 // Make the node selected
2439 iTree
.setSelectionPath(iTree
.getPathOfNode(iTree
.getNodeById(this.dmtnPlatformDescription
, id
,
2440 IDefaultMutableTreeNode
.FPD_PLATFORMHEADER
)));
2442 // Update opening package list information
2444 if (!openingPlatformList
.existsPlatform(id
)) {
2446 // Insert sub node of module
2448 insertPlatformTreeNode(id
);
2449 iTree
.getSelectNode().setOpening(true);
2452 // Update opening module list
2454 openingPlatformList
.insertToOpeningPlatformList(id
, fpd
);
2455 openingPlatformList
.setTreePathById(id
, iTree
.getSelectionPath());
2458 // Show fpd header in editor panel
2460 showPlatformElement(IDefaultMutableTreeNode
.FPD_PLATFORMHEADER
, openingPlatformList
.getOpeningPlatformById(id
));
2461 this.currentOpeningPlatformIndex
= openingPlatformList
.findIndexOfListById(id
);
2468 private void saveModule(int index
) {
2469 OpeningModuleType omt
= openingModuleList
.getOpeningModuleByIndex(index
);
2471 if (getNewFilePath(DataType
.MODULE_SURFACE_AREA_EXT
) != JFileChooser
.APPROVE_OPTION
) {
2476 SaveFile
.saveMsaFile(omt
.getId().getPath(), omt
.getXmlMsa());
2477 openingModuleList
.setNew(omt
.getId(), false);
2478 openingModuleList
.setModuleSaved(omt
.getId(), true);
2479 } catch (Exception e
) {
2480 Log
.err("Save Module", e
.getMessage());
2488 private void savePackage(int index
) {
2489 OpeningPackageType opt
= openingPackageList
.getOpeningPackageByIndex(index
);
2491 if (getNewFilePath(DataType
.PACKAGE_SURFACE_AREA_EXT
) != JFileChooser
.APPROVE_OPTION
) {
2496 SaveFile
.saveSpdFile(opt
.getId().getPath(), opt
.getXmlSpd());
2497 openingPackageList
.setNew(opt
.getId(), false);
2498 openingPackageList
.setPackageSaved(opt
.getId(), true);
2499 } catch (Exception e
) {
2500 Log
.err("Save Package", e
.getMessage());
2508 private void savePlatform(int index
) {
2509 OpeningPlatformType opt
= openingPlatformList
.getOpeningPlatformByIndex(index
);
2511 if (getNewFilePath(DataType
.PACKAGE_SURFACE_AREA_EXT
) != JFileChooser
.APPROVE_OPTION
) {
2516 SaveFile
.saveFpdFile(opt
.getId().getPath(), opt
.getXmlFpd());
2517 openingPlatformList
.setNew(opt
.getId(), false);
2518 openingPlatformList
.setPlatformSaved(opt
.getId(), true);
2519 } catch (Exception e
) {
2520 Log
.err("Save Package", e
.getMessage());
2524 public void componentHidden(ComponentEvent arg0
) {
2525 // TODO Auto-generated method stub
2529 public void componentMoved(ComponentEvent arg0
) {
2530 // TODO Auto-generated method stub
2534 public void componentResized(ComponentEvent arg0
) {
2535 this.jSplitPane
.setSize(this.getWidth() - DataType
.MAIN_FRAME_WIDTH_SPACING
,
2536 this.getHeight() - DataType
.MAIN_FRAME_HEIGHT_SPACING
);
2537 this.jSplitPane
.validate();
2538 resizeDesktopPanel();
2541 public void componentShown(ComponentEvent arg0
) {
2542 // TODO Auto-generated method stub
2547 Resize JDesktopPanel
2550 private void resizeDesktopPanel() {
2551 resizeDesktopPanel(this.jDesktopPaneModule
);
2552 resizeDesktopPanel(this.jDesktopPanePackage
);
2553 resizeDesktopPanel(this.jDesktopPanePlatform
);
2557 Resize JDesktopPanel
2560 private void resizeDesktopPanel(JDesktopPane jdk
) {
2561 JInternalFrame
[] iif
= jdk
.getAllFrames();
2562 for (int index
= 0; index
< iif
.length
; index
++) {
2563 iif
[index
].setSize(jdk
.getWidth(), jdk
.getHeight());
2567 private void getCompontentsFromFrameworkDatabase() {
2568 this.vModuleList
= wt
.getAllModules();
2569 this.vPackageList
= wt
.getAllPackages();
2570 this.vPlatformList
= wt
.getAllPlatforms();
2573 private void insertModuleTreeNode(Identification id
) {
2574 iTree
.addNode(new IDefaultMutableTreeNode("Module Definitions", IDefaultMutableTreeNode
.MSA_MODULEDEFINITIONS
,
2576 iTree
.addNode(new IDefaultMutableTreeNode("Library Class Definitions",
2577 IDefaultMutableTreeNode
.MSA_LIBRARYCLASSDEFINITIONS
, true, id
));
2578 iTree
.addNode(new IDefaultMutableTreeNode("Source Files", IDefaultMutableTreeNode
.MSA_SOURCEFILES
, true, id
));
2579 iTree
.addNode(new IDefaultMutableTreeNode("Package Dependencies",
2580 IDefaultMutableTreeNode
.MSA_PACKAGEDEPENDENCIES
, true, id
));
2581 iTree
.addNode(new IDefaultMutableTreeNode("Protocols", IDefaultMutableTreeNode
.MSA_PROTOCOLS
, true, id
));
2582 iTree
.addNode(new IDefaultMutableTreeNode("Events", IDefaultMutableTreeNode
.MSA_EVENTS
, true, id
));
2583 iTree
.addNode(new IDefaultMutableTreeNode("Hobs", IDefaultMutableTreeNode
.MSA_HOBS
, true, id
));
2584 iTree
.addNode(new IDefaultMutableTreeNode("Ppis", IDefaultMutableTreeNode
.MSA_PPIS
, true, id
));
2585 iTree
.addNode(new IDefaultMutableTreeNode("Variables", IDefaultMutableTreeNode
.MSA_VARIABLES
, true, id
));
2586 iTree
.addNode(new IDefaultMutableTreeNode("Boot Modes", IDefaultMutableTreeNode
.MSA_BOOTMODES
, true, id
));
2587 iTree
.addNode(new IDefaultMutableTreeNode("System Tables", IDefaultMutableTreeNode
.MSA_SYSTEMTABLES
, true, id
));
2588 iTree
.addNode(new IDefaultMutableTreeNode("Data Hubs", IDefaultMutableTreeNode
.MSA_DATAHUBS
, true, id
));
2589 iTree
.addNode(new IDefaultMutableTreeNode("Hii Packages", IDefaultMutableTreeNode
.MSA_HIIPACKAGES
, true, id
));
2590 iTree
.addNode(new IDefaultMutableTreeNode("Guids", IDefaultMutableTreeNode
.MSA_GUIDS
, true, id
));
2591 iTree
.addNode(new IDefaultMutableTreeNode("Externs", IDefaultMutableTreeNode
.MSA_EXTERNS
, true, id
));
2592 iTree
.addNode(new IDefaultMutableTreeNode("PcdCoded", IDefaultMutableTreeNode
.MSA_PCDS
, true, id
));
2595 private void insertPackageTreeNode(Identification id
) {
2596 iTree
.addNode(new IDefaultMutableTreeNode("Package Definitions",
2597 IDefaultMutableTreeNode
.SPD_PACKAGEDEFINITIONS
, true, id
));
2598 iTree
.addNode(new IDefaultMutableTreeNode("Library Class Declarations",
2599 IDefaultMutableTreeNode
.SPD_LIBRARYCLASSDECLARATIONS
, true, id
));
2600 iTree
.addNode(new IDefaultMutableTreeNode("Msa Files", IDefaultMutableTreeNode
.SPD_MSAFILES
, false, id
));
2601 iTree
.addNode(new IDefaultMutableTreeNode("Package Headers", IDefaultMutableTreeNode
.SPD_PACKAGEHEADERS
, true,
2603 iTree
.addNode(new IDefaultMutableTreeNode("Guid Declarations", IDefaultMutableTreeNode
.SPD_GUIDDECLARATIONS
,
2605 iTree
.addNode(new IDefaultMutableTreeNode("Protocol Declarations",
2606 IDefaultMutableTreeNode
.SPD_PROTOCOLDECLARATIONS
, true, id
));
2607 iTree
.addNode(new IDefaultMutableTreeNode("Ppi Declarations", IDefaultMutableTreeNode
.SPD_PPIDECLARATIONS
,
2609 iTree
.addNode(new IDefaultMutableTreeNode("Pcd Declarations", IDefaultMutableTreeNode
.SPD_PCDDECLARATIONS
,
2613 private void insertPlatformTreeNode(Identification id
) {
2614 iTree
.addNode(new IDefaultMutableTreeNode("Platform Definitions",
2615 IDefaultMutableTreeNode
.FPD_PLATFORMDEFINITIONS
, true, id
));
2616 iTree
.addNode(new IDefaultMutableTreeNode("Flash", IDefaultMutableTreeNode
.FPD_FLASH
, true, id
));
2617 iTree
.addNode(new IDefaultMutableTreeNode("Framework Modules", IDefaultMutableTreeNode
.FPD_FRAMEWORKMODULES
,
2619 iTree
.addNode(new IDefaultMutableTreeNode("Pcd Dynamic Build Declarations",
2620 IDefaultMutableTreeNode
.FPD_PCDDYNAMICBUILDDECLARATIONS
, true, id
));
2621 iTree
.addNode(new IDefaultMutableTreeNode("Build Options", IDefaultMutableTreeNode
.FPD_BUILDOPTIONS
, true, id
));
2625 Operate when double click a tree node
2628 private void doubleClickModuleTreeNode() {
2629 Identification id
= iTree
.getSelectNode().getId();
2630 int intCategory
= iTree
.getSelectCategory();
2633 // If the node is not opened yet
2634 // Insert top level elements first
2636 //if (intCategory == IDefaultMutableTreeNode.MSA_HEADER || intCategory == IDefaultMutableTreeNode.SPD_MSAFILES) {
2637 if (intCategory
== IDefaultMutableTreeNode
.MSA_HEADER
) {
2639 if (intCategory
== IDefaultMutableTreeNode
.MSA_HEADER
) {
2640 path
= iTree
.getSelectNode().getId().getPath();
2642 if (intCategory
== IDefaultMutableTreeNode
.SPD_MSAFILES
) {
2643 path
= iTree
.getSelectNode().getId().getPath();
2648 if (intCategory
== IDefaultMutableTreeNode
.SPD_HEADER
) {
2649 path
= iTree
.getSelectNode().getId().getPath();
2653 if (intCategory
== IDefaultMutableTreeNode
.FPD_PLATFORMHEADER
) {
2654 path
= iTree
.getSelectNode().getId().getPath();
2659 // Show editor panel
2661 if (intCategory
>= IDefaultMutableTreeNode
.MSA_HEADER
&& intCategory
< IDefaultMutableTreeNode
.SPD_HEADER
) {
2662 showModuleElement(intCategory
, openingModuleList
.getOpeningModuleById(id
));
2663 this.currentOpeningModuleIndex
= openingModuleList
.findIndexOfListById(id
);
2665 if (intCategory
>= IDefaultMutableTreeNode
.SPD_HEADER
2666 && intCategory
< IDefaultMutableTreeNode
.FPD_PLATFORMHEADER
) {
2667 showPackageElement(intCategory
, openingPackageList
.getOpeningPackageById(id
));
2668 this.currentOpeningPackageIndex
= openingPackageList
.findIndexOfListById(id
);
2670 if (intCategory
>= IDefaultMutableTreeNode
.FPD_PLATFORMHEADER
) {
2671 showPlatformElement(intCategory
, openingPlatformList
.getOpeningPlatformById(id
));
2672 this.currentOpeningPlatformIndex
= openingPlatformList
.findIndexOfListById(id
);
2677 Show content of editor panel via selected element
2683 private void showPlatformElement(int elementType
, OpeningPlatformType fpd
) {
2684 this.cleanDesktopPanePlatform();
2686 switch (elementType
) {
2687 case IDefaultMutableTreeNode
.FPD_PLATFORMDEFINITIONS
:
2688 FpdPlatformDefs frmFpdPlatformDefs
= new FpdPlatformDefs(fpd
);
2689 getJDesktopPanePlatform().add(frmFpdPlatformDefs
, 1);
2691 case IDefaultMutableTreeNode
.FPD_PLATFORMHEADER
:
2692 FpdHeader frmFpdHeader
= new FpdHeader(fpd
);
2693 getJDesktopPanePlatform().add(frmFpdHeader
, 1);
2695 case IDefaultMutableTreeNode
.FPD_FLASH
:
2696 FpdFlash frmFpdFlash
= new FpdFlash(fpd
);
2697 getJDesktopPanePlatform().add(frmFpdFlash
, 1);
2699 case IDefaultMutableTreeNode
.FPD_FRAMEWORKMODULES
:
2700 FpdFrameworkModules frmFpdFrameworkModules
= new FpdFrameworkModules(fpd
);
2701 getJDesktopPanePlatform().add(frmFpdFrameworkModules
, 1);
2703 case IDefaultMutableTreeNode
.FPD_PCDDYNAMICBUILDDECLARATIONS
:
2704 FpdDynamicPcdBuildDefinitions frmFpdDynamicPcdBuildDefinitions
= new FpdDynamicPcdBuildDefinitions(fpd
);
2705 getJDesktopPanePlatform().add(frmFpdDynamicPcdBuildDefinitions
, 1);
2707 case IDefaultMutableTreeNode
.FPD_BUILDOPTIONS
:
2708 FpdBuildOptions frmFpdBuildOptions
= new FpdBuildOptions(fpd
);
2709 getJDesktopPanePlatform().add(frmFpdBuildOptions
, 1);
2712 this.jTabbedPaneEditor
.setSelectedIndex(2);
2713 resizeDesktopPanel();
2717 Show content of editor panel via selected element
2723 private void showPackageElement(int elementType
, OpeningPackageType spd
) {
2724 this.cleanDesktopPanePackage();
2725 Tools
.dirForNewSpd
= spd
.getId().getPath();
2726 switch (elementType
) {
2727 case IDefaultMutableTreeNode
.SPD_HEADER
:
2728 SpdHeader frmSpdHeader
= new SpdHeader(spd
);
2729 getJDesktopPanePackage().add(frmSpdHeader
, 1);
2731 case IDefaultMutableTreeNode
.SPD_PACKAGEDEFINITIONS
:
2732 SpdPackageDefinitions frmSpdPackageDefinitions
= new SpdPackageDefinitions(spd
);
2733 getJDesktopPanePackage().add(frmSpdPackageDefinitions
, 1);
2735 case IDefaultMutableTreeNode
.SPD_LIBRARYCLASSDECLARATIONS
:
2736 SpdLibClassDecls frmSlcd
= new SpdLibClassDecls(spd
);
2737 getJDesktopPanePackage().add(frmSlcd
, 1);
2739 case IDefaultMutableTreeNode
.SPD_MSAFILES
:
2740 SpdMsaFiles frmSmf
= new SpdMsaFiles(spd
);
2741 getJDesktopPanePackage().add(frmSmf
, 1);
2743 case IDefaultMutableTreeNode
.SPD_PACKAGEHEADERS
:
2744 SpdPackageHeaders frmSph
= new SpdPackageHeaders(spd
);
2745 getJDesktopPanePackage().add(frmSph
, 1);
2747 case IDefaultMutableTreeNode
.SPD_GUIDDECLARATIONS
:
2748 SpdGuidDecls frmSgd
= new SpdGuidDecls(spd
);
2749 getJDesktopPanePackage().add(frmSgd
, 1);
2751 case IDefaultMutableTreeNode
.SPD_PROTOCOLDECLARATIONS
:
2752 SpdProtocolDecls frmSprod
= new SpdProtocolDecls(spd
);
2753 getJDesktopPanePackage().add(frmSprod
, 1);
2755 case IDefaultMutableTreeNode
.SPD_PPIDECLARATIONS
:
2756 SpdPpiDecls frmSppid
= new SpdPpiDecls(spd
);
2757 getJDesktopPanePackage().add(frmSppid
, 1);
2759 case IDefaultMutableTreeNode
.SPD_PCDDECLARATIONS
:
2760 SpdPcdDefs frmSpcdd
= new SpdPcdDefs(spd
);
2761 getJDesktopPanePackage().add(frmSpcdd
, 1);
2764 this.jTabbedPaneEditor
.setSelectedIndex(1);
2765 resizeDesktopPanel();
2769 Show content of editor panel via selected element
2775 private void showModuleElement(int elementType
, OpeningModuleType msa
) {
2776 this.cleanDesktopPaneModule();
2777 switch (elementType
) {
2778 case IDefaultMutableTreeNode
.MSA_HEADER
:
2779 MsaHeader frmMsaHeader
= new MsaHeader(msa
);
2780 getJDesktopPaneModule().add(frmMsaHeader
, 1);
2782 case IDefaultMutableTreeNode
.MSA_MODULEDEFINITIONS
:
2783 ModuleDefinitions frmMd
= new ModuleDefinitions(msa
);
2784 getJDesktopPaneModule().add(frmMd
, 1);
2786 case IDefaultMutableTreeNode
.MSA_LIBRARYCLASSDEFINITIONS
:
2787 ModuleLibraryClassDefinitions frmMlcd
= new ModuleLibraryClassDefinitions(msa
);
2788 getJDesktopPaneModule().add(frmMlcd
, 1);
2790 case IDefaultMutableTreeNode
.MSA_PACKAGEDEPENDENCIES
:
2791 ModulePackageDependencies frmMpd
= new ModulePackageDependencies(msa
);
2792 getJDesktopPaneModule().add(frmMpd
, 1);
2794 case IDefaultMutableTreeNode
.MSA_SOURCEFILES
:
2795 ModuleSourceFiles frmMsf
= new ModuleSourceFiles(msa
);
2796 getJDesktopPaneModule().add(frmMsf
, 1);
2798 case IDefaultMutableTreeNode
.MSA_PROTOCOLS
:
2799 ModuleProtocols frmMp
= new ModuleProtocols(msa
);
2800 getJDesktopPaneModule().add(frmMp
, 1);
2802 case IDefaultMutableTreeNode
.MSA_EVENTS
:
2803 ModuleEvents frmMe
= new ModuleEvents(msa
);
2804 getJDesktopPaneModule().add(frmMe
, 1);
2806 case IDefaultMutableTreeNode
.MSA_HOBS
:
2807 ModuleHobs frmMh
= new ModuleHobs(msa
);
2808 getJDesktopPaneModule().add(frmMh
, 1);
2810 case IDefaultMutableTreeNode
.MSA_PPIS
:
2811 ModulePpis frmMpp
= new ModulePpis(msa
);
2812 getJDesktopPaneModule().add(frmMpp
, 1);
2814 case IDefaultMutableTreeNode
.MSA_VARIABLES
:
2815 ModuleVariables frmMv
= new ModuleVariables(msa
);
2816 getJDesktopPaneModule().add(frmMv
, 1);
2818 case IDefaultMutableTreeNode
.MSA_BOOTMODES
:
2819 ModuleBootModes frmMbm
= new ModuleBootModes(msa
);
2820 getJDesktopPaneModule().add(frmMbm
, 1);
2822 case IDefaultMutableTreeNode
.MSA_SYSTEMTABLES
:
2823 ModuleSystemTables frmMst
= new ModuleSystemTables(msa
);
2824 getJDesktopPaneModule().add(frmMst
, 1);
2826 case IDefaultMutableTreeNode
.MSA_DATAHUBS
:
2827 ModuleDataHubs frmMdh
= new ModuleDataHubs(msa
);
2828 getJDesktopPaneModule().add(frmMdh
, 1);
2830 case IDefaultMutableTreeNode
.MSA_HIIPACKAGES
:
2831 ModuleHiiPackages frmMf
= new ModuleHiiPackages(msa
);
2832 getJDesktopPaneModule().add(frmMf
, 1);
2834 case IDefaultMutableTreeNode
.MSA_GUIDS
:
2835 ModuleGuids frmGuid
= new ModuleGuids(msa
);
2836 getJDesktopPaneModule().add(frmGuid
, 1);
2838 case IDefaultMutableTreeNode
.MSA_EXTERNS
:
2839 ModuleExterns frmMex
= new ModuleExterns(msa
);
2840 getJDesktopPaneModule().add(frmMex
, 1);
2842 case IDefaultMutableTreeNode
.MSA_PCDS
:
2843 ModulePCDs frmPcd
= new ModulePCDs(msa
);
2844 getJDesktopPaneModule().add(frmPcd
, 1);
2847 this.jTabbedPaneEditor
.setSelectedIndex(0);
2848 resizeDesktopPanel();
2852 // Define operations of menu
2858 private void fileNew() {
2861 // Selece new file type
2863 NewFileChooser nfc
= new NewFileChooser(this, true);
2864 result
= nfc
.showDialog();
2866 if (result
== DataType
.RETURN_TYPE_CANCEL
) {
2869 } else if (result
== DataType
.RETURN_TYPE_MODULE_SURFACE_AREA
) {
2873 SelectModuleBelong smb
= new SelectModuleBelong(this, true, result
);
2874 result
= smb
.showDialog();
2876 if (result
== DataType
.RETURN_TYPE_CANCEL
) {
2880 } else if (result
== DataType
.RETURN_TYPE_OK
) {
2881 PackageSurfaceAreaDocument
.PackageSurfaceArea psa
= null;
2882 if (this.openingPackageList
.existsPackage(smb
.getMid().getPackageId())) {
2883 psa
= openingPackageList
.getPackageSurfaceAreaFromId(smb
.getMid().getPackageId());
2886 wt
.addModuleToPackage(smb
.getMid(), psa
);
2887 } catch (IOException e
) {
2888 Log
.err("Upddate MsaFiles of Package", e
.getMessage());
2889 e
.printStackTrace();
2891 } catch (XmlException e
) {
2892 Log
.err("Upddate MsaFiles of Package", e
.getMessage());
2893 e
.printStackTrace();
2895 } catch (Exception e
) {
2896 Log
.err("Upddate MsaFiles of Package", e
.getMessage());
2897 e
.printStackTrace();
2900 this.openModule(smb
.getMid().getPath(), smb
.getMid());
2902 } else if (result
== DataType
.RETURN_TYPE_PACKAGE_SURFACE_AREA
) {
2906 SelectModuleBelong smb
= new SelectModuleBelong(this, true, result
);
2907 result
= smb
.showDialog();
2909 if (result
== DataType
.RETURN_TYPE_CANCEL
) {
2913 } else if (result
== DataType
.RETURN_TYPE_OK
) {
2915 wt
.addPackageToDatabase(smb
.getPid());
2916 } catch (Exception e
) {
2917 // TODO Auto-generated catch block
2918 e
.printStackTrace();
2920 vPackageList
.addElement(smb
.getPid());
2922 // Add new SpdHeader node to the tree
2924 IDefaultMutableTreeNode node
= new IDefaultMutableTreeNode(vPackageList
.lastElement().getName(),
2925 IDefaultMutableTreeNode
.SPD_HEADER
, true,
2926 vPackageList
.lastElement());
2927 iTree
.addNode(dmtnPackageDescription
, node
);
2928 this.openPackage(smb
.getPid().getPath());
2930 } else if (result
== DataType
.RETURN_TYPE_PLATFORM_SURFACE_AREA
) {
2932 // To new a platform
2934 SelectModuleBelong smb
= new SelectModuleBelong(this, true, result
);
2935 result
= smb
.showDialog();
2937 if (result
== DataType
.RETURN_TYPE_CANCEL
) {
2941 } else if (result
== DataType
.RETURN_TYPE_OK
) {
2943 wt
.addPlatformToDatabase(smb
.getFid());
2944 } catch (Exception e
) {
2945 // TODO Auto-generated catch block
2946 e
.printStackTrace();
2948 vPlatformList
.addElement(smb
.getFid());
2950 // Add new SpdHeader node to the tree
2952 IDefaultMutableTreeNode node
= new IDefaultMutableTreeNode(vPlatformList
.lastElement().getName(),
2953 IDefaultMutableTreeNode
.FPD_PLATFORMHEADER
,
2954 true, vPlatformList
.lastElement());
2955 iTree
.addNode(dmtnPlatformDescription
, node
);
2956 this.openPlatform(smb
.getFid().getPath());
2965 private void open() {
2966 JFileChooser fc
= new JFileChooser(Workspace
.getCurrentWorkspace());
2967 fc
.setAcceptAllFileFilterUsed(false);
2968 IFileFilter iffM
= new IFileFilter(DataType
.MODULE_SURFACE_AREA_EXT
);
2969 IFileFilter iffP
= new IFileFilter(DataType
.PACKAGE_SURFACE_AREA_EXT
);
2970 IFileFilter iffF
= new IFileFilter(DataType
.PLATFORM_SURFACE_AREA_EXT
);
2971 fc
.addChoosableFileFilter(iffM
);
2972 fc
.addChoosableFileFilter(iffP
);
2973 fc
.addChoosableFileFilter(iffF
);
2974 fc
.setFileFilter(iffM
);
2976 int result
= fc
.showOpenDialog(new JPanel());
2978 if (result
== JFileChooser
.APPROVE_OPTION
) {
2979 String path
= fc
.getSelectedFile().getPath();
2980 String match
= path
.substring(path
.length() - 4);
2981 if (match
.equals(DataType
.FILE_EXT_SEPARATOR
+ DataType
.MODULE_SURFACE_AREA_EXT
)) {
2983 } else if (match
.equals(DataType
.FILE_EXT_SEPARATOR
+ DataType
.PACKAGE_SURFACE_AREA_EXT
)) {
2985 } else if (match
.equals(DataType
.FILE_EXT_SEPARATOR
+ DataType
.PLATFORM_SURFACE_AREA_EXT
)) {
2995 private void close() {
2996 switch (this.jTabbedPaneEditor
.getSelectedIndex()) {
2998 // Current is module
3001 if (this.currentOpeningModuleIndex
> -1) {
3002 if (!openingModuleList
.getModuleSaved(currentOpeningModuleIndex
)) {
3003 int result
= showSaveDialog();
3004 if (result
== JOptionPane
.YES_OPTION
) {
3007 if (result
== JOptionPane
.NO_OPTION
) {
3010 if (result
== JOptionPane
.CANCEL_OPTION
) {
3014 iTree
.removeNodeChildrenByPath(openingModuleList
.getTreePathByIndex(currentOpeningModuleIndex
));
3015 this.openingModuleList
.removeFromOpeningModuleListByIndex(this.currentOpeningModuleIndex
);
3016 this.cleanDesktopPaneModule();
3017 this.currentOpeningModuleIndex
= -1;
3021 // Current is package
3024 if (this.currentOpeningPackageIndex
> -1) {
3025 if (!openingPackageList
.getPackageSaved(currentOpeningPackageIndex
)) {
3026 int result
= showSaveDialog();
3027 if (result
== JOptionPane
.YES_OPTION
) {
3030 if (result
== JOptionPane
.NO_OPTION
) {
3033 if (result
== JOptionPane
.CANCEL_OPTION
) {
3037 iTree
.removeNodeChildrenByPath(openingPackageList
.getTreePathByIndex(currentOpeningPackageIndex
));
3038 this.openingPackageList
.removeFromOpeningPackageListByIndex(this.currentOpeningPackageIndex
);
3039 this.cleanDesktopPanePackage();
3040 this.currentOpeningPackageIndex
= -1;
3044 // Current is platform
3047 if (this.currentOpeningPlatformIndex
> -1) {
3048 if (!openingPlatformList
.getPlatformSaved(currentOpeningPlatformIndex
)) {
3049 int result
= showSaveDialog();
3050 if (result
== JOptionPane
.YES_OPTION
) {
3053 if (result
== JOptionPane
.NO_OPTION
) {
3056 if (result
== JOptionPane
.CANCEL_OPTION
) {
3060 iTree
.removeNodeChildrenByPath(openingPlatformList
.getTreePathByIndex(currentOpeningPlatformIndex
));
3061 this.openingPlatformList
.removeFromOpeningPlatformListByIndex(this.currentOpeningPlatformIndex
);
3062 this.cleanDesktopPanePlatform();
3063 this.currentOpeningPlatformIndex
= -1;
3070 Close all opening files and clean all showing internal frame
3073 private void closeAll() {
3075 if (!openingModuleList
.isSaved() || !openingPackageList
.isSaved() || !openingPlatformList
.isSaved()) {
3076 result
= showSaveDialog();
3078 if (result
== JOptionPane
.YES_OPTION
) {
3081 if (result
== JOptionPane
.NO_OPTION
) {
3084 if (result
== JOptionPane
.CANCEL_OPTION
) {
3087 this.cleanDesktopPane();
3088 this.getCompontentsFromFrameworkDatabase();
3089 openingModuleList
.removeAllFromOpeningModuleList();
3090 openingPackageList
.removeAllFromOpeningPackageList();
3091 openingPlatformList
.removeAllFromOpeningPlatformList();
3092 this.makeEmptyTree();
3096 Save currentModule when press button OK
3099 private void save() {
3100 switch (this.jTabbedPaneEditor
.getSelectedIndex()) {
3102 if (this.currentOpeningModuleIndex
> -1) {
3103 saveModule(this.currentOpeningModuleIndex
);
3107 if (this.currentOpeningPackageIndex
> -1) {
3108 savePackage(this.currentOpeningPackageIndex
);
3112 if (this.currentOpeningPlatformIndex
> -1) {
3113 savePlatform(this.currentOpeningPlatformIndex
);
3119 private void saveAs() {
3123 private void saveAll() {
3127 for (int index
= 0; index
< openingModuleList
.size(); index
++) {
3128 if (!openingModuleList
.getModuleSaved(index
)) {
3134 // Save all packages
3136 for (int index
= 0; index
< openingPackageList
.size(); index
++) {
3137 if (!openingPackageList
.getPackageSaved(index
)) {
3143 // Save all platforms
3145 for (int index
= 0; index
< openingPlatformList
.size(); index
++) {
3146 if (!openingPlatformList
.getPlatformSaved(index
)) {
3147 savePlatform(index
);
3153 To save changed items before exit.
3156 private void exit() {
3158 if (!openingModuleList
.isSaved() || !openingPackageList
.isSaved() || !openingPlatformList
.isSaved()) {
3159 result
= showSaveDialog();
3161 if (result
== JOptionPane
.YES_OPTION
) {
3164 if (result
== JOptionPane
.NO_OPTION
) {
3167 if (result
== JOptionPane
.CANCEL_OPTION
) {
3175 Switch current workspace to others
3178 private void changeWorkspace() {
3179 SwitchWorkspace sw
= new SwitchWorkspace(this, true);
3180 int result
= sw
.showDialog();
3181 if (result
== DataType
.RETURN_TYPE_CANCEL
) {
3183 } else if (result
== DataType
.RETURN_TYPE_OK
) {
3185 // Reinit whole window
3188 this.setTitle(DataType
.PROJECT_NAME
+ " " + DataType
.PROJECT_VERSION
+ " " + "- ["
3189 + Workspace
.getCurrentWorkspace() + "]");
3195 Show Tool Chain Configuration Dialog to setup Tool Chain
3198 private void setupToolChainConfiguration() {
3199 ToolChainConfig tcc
= ToolChainConfig
.getInstance();
3207 private void cloneItem() {
3211 // Check if there is any item can be cloned
3213 if (iTree
.getSelectionPath() == null) {
3214 Log
.err("Please select a target to clone!");
3217 int category
= iTree
.getSelectCategory();
3218 Identification id
= iTree
.getSelectNode().getId();
3219 if (category
== IDefaultMutableTreeNode
.MODULE
|| category
== IDefaultMutableTreeNode
.PACKAGE
3220 || category
== IDefaultMutableTreeNode
.PLATFORM
) {
3221 Log
.err("Please select a target to clone!");
3225 if (category
== IDefaultMutableTreeNode
.WORKSPACE
) {
3226 mode
= DataType
.RETURN_TYPE_WORKSPACE
;
3229 if (category
>= IDefaultMutableTreeNode
.MSA_HEADER
&& category
< IDefaultMutableTreeNode
.SPD_HEADER
) {
3230 mode
= DataType
.RETURN_TYPE_MODULE_SURFACE_AREA
;
3232 if (category
>= IDefaultMutableTreeNode
.SPD_HEADER
&& category
< IDefaultMutableTreeNode
.FPD_PLATFORMHEADER
) {
3233 mode
= DataType
.RETURN_TYPE_PACKAGE_SURFACE_AREA
;
3235 if (category
>= IDefaultMutableTreeNode
.FPD_PLATFORMHEADER
) {
3236 mode
= DataType
.RETURN_TYPE_PLATFORM_SURFACE_AREA
;
3239 Clone c
= new Clone(this, true, mode
, id
);
3240 int result
= c
.showDialog();
3242 if (result
== DataType
.RETURN_TYPE_CANCEL
) {
3245 if (result
== DataType
.RETURN_TYPE_WORKSPACE
) {
3246 Tools
.showInformationMessage("Workspace Clone Finished");
3248 if (result
== DataType
.RETURN_TYPE_MODULE_SURFACE_AREA
) {
3249 Tools
.showInformationMessage("Module Surface Area Clone Finished");
3250 vModuleList
.addElement(c
.getMid());
3252 // Add new MsaHeader node to the tree
3254 IDefaultMutableTreeNode node
= new IDefaultMutableTreeNode(vModuleList
.lastElement().getName(),
3255 IDefaultMutableTreeNode
.MSA_HEADER
, true,
3256 vModuleList
.lastElement());
3257 iTree
.addNode(dmtnModuleDescription
, node
);
3259 if (result
== DataType
.RETURN_TYPE_PACKAGE_SURFACE_AREA
) {
3260 Tools
.showInformationMessage("Package Surface Area Clone Finished");
3261 vPackageList
.addElement(c
.getPid());
3263 // Add new SpdHeader node to the tree
3265 IDefaultMutableTreeNode node
= new IDefaultMutableTreeNode(vPackageList
.lastElement().getName(),
3266 IDefaultMutableTreeNode
.SPD_HEADER
, true,
3267 vPackageList
.lastElement());
3268 iTree
.addNode(dmtnPackageDescription
, node
);
3270 if (result
== DataType
.RETURN_TYPE_PLATFORM_SURFACE_AREA
) {
3271 Tools
.showInformationMessage("Platform Surface Area Clone Finished");
3272 vPlatformList
.addElement(c
.getFid());
3274 // Add new SpdHeader node to the tree
3276 IDefaultMutableTreeNode node
= new IDefaultMutableTreeNode(vPlatformList
.lastElement().getName(),
3277 IDefaultMutableTreeNode
.FPD_PLATFORMHEADER
,
3278 true, vPlatformList
.lastElement());
3279 iTree
.addNode(dmtnPlatformDescription
, node
);
3280 //this.openPlatform(c.getFid().getPath());
3282 if (result
== DataType
.RETURN_TYPE_OK
) {
3287 public void valueChanged(TreeSelectionEvent arg0
) {
3288 // TODO Auto-generated method stub
3292 public void menuCanceled(MenuEvent arg0
) {
3293 // TODO Auto-generated method stub
3297 public void menuDeselected(MenuEvent arg0
) {
3298 // TODO Auto-generated method stub
3302 public void menuSelected(MenuEvent arg0
) {
3303 if (arg0
.getSource() == jMenuFile
) {
3305 // Enable close/close all if some files are opened
3307 jMenuItemFileClose
.setEnabled(openingModuleList
.isOpend() || openingPackageList
.isOpend()
3308 || openingPlatformList
.isOpend());
3309 jMenuItemFileCloseAll
.setEnabled(openingModuleList
.isOpend() || openingPackageList
.isOpend()
3310 || openingPlatformList
.isOpend());
3313 // Enable save/save all if some files are changed
3315 jMenuItemFileSave
.setEnabled(!openingModuleList
.isSaved() || !openingPackageList
.isSaved()
3316 || !openingPlatformList
.isSaved());
3317 jMenuItemFileSaveAll
.setEnabled(!openingModuleList
.isSaved() || !openingPackageList
.isSaved()
3318 || !openingPlatformList
.isSaved());
3321 if (arg0
.getSource() == jMenuTools
) {
3323 // Enable clone when select some items
3325 if (iTree
.getSelectionPath() == null) {
3326 jMenuItemToolsClone
.setEnabled(false);
3328 int category
= iTree
.getSelectCategory();
3329 if (category
== IDefaultMutableTreeNode
.MODULE
|| category
== IDefaultMutableTreeNode
.PACKAGE
3330 || category
== IDefaultMutableTreeNode
.PLATFORM
) {
3331 jMenuItemToolsClone
.setEnabled(false);
3333 jMenuItemToolsClone
.setEnabled(true);