summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>2006-09-08 01:58:04 +0000
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>2006-09-08 01:58:04 +0000
commit4917d9ddc38808bce82bc54ee690edf6bb5804a6 (patch)
tree95245fc141af2c4cb5637e5acd253e9f75d38ea5 /Tools
parent63e30d14b49ca48c626c19ad0567785566addb74 (diff)
downloadedk2-4917d9ddc38808bce82bc54ee690edf6bb5804a6.zip
edk2-4917d9ddc38808bce82bc54ee690edf6bb5804a6.tar.gz
edk2-4917d9ddc38808bce82bc54ee690edf6bb5804a6.tar.bz2
1. Add function "Refresh" in main UI
2. Add function to add modules to GlobalData when clone a package. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1501 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools')
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java29
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java41
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java2
3 files changed, 65 insertions, 7 deletions
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java
index 97f16ce..3395434 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java
@@ -376,7 +376,7 @@ public class Clone extends IDialog {
this.jLabelBelong.setEnabled(false);
this.jComboBoxExistingPackage.setEnabled(false);
this.jButtonBrowse.setVisible(false);
- this.jTextFieldFilePath.setToolTipText("<html>Input the package's relative path and file name, for example:<br>MdePkg\\MdePkg.fpd</html>");
+ this.jTextFieldFilePath.setToolTipText("<html>Input the package's relative path and file name, for example:<br>MdePkg\\MdePkg.spd</html>");
this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height);
this.jLabelDestinationFile.setText("New Package Path and Filename");
}
@@ -845,6 +845,33 @@ public class Clone extends IDialog {
GlobalData.vPackageList.addElement(pid);
GlobalData.openingPackageList.insertToOpeningPackageList(pid, spd);
+ //
+ // Add all cloned modules
+ //
+ Vector<String> modulePaths = GlobalData.getAllModulesOfPackage(pid.getPath());
+ String modulePath = null;
+ ModuleSurfaceArea msa = null;
+
+ for (int indexJ = 0; indexJ < modulePaths.size(); indexJ++) {
+ try {
+ modulePath = modulePaths.get(indexJ);
+ msa = OpenFile.openMsaFile(modulePath);
+ } catch (IOException e) {
+ Log.err("Open Module Surface Area " + modulePath, e.getMessage());
+ continue;
+ } catch (XmlException e) {
+ Log.err("Open Module Surface Area " + modulePath, e.getMessage());
+ continue;
+ } catch (Exception e) {
+ Log.err("Open Module Surface Area " + modulePath, "Invalid file type");
+ continue;
+ }
+ Identification id = Tools.getId(modulePath, msa);
+ mid = new ModuleIdentification(id, pid);
+ GlobalData.vModuleList.addElement(mid);
+ GlobalData.openingModuleList.insertToOpeningModuleList(mid, msa);
+ }
+
this.returnType = DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA;
}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
index b159fe4..0d3ddb5 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
@@ -149,6 +149,8 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
private JMenuItem jMenuItemFileNew = null;
+ private JMenuItem jMenuItemFileRefresh = null;
+
private JMenuItem jMenuItemFileSaveAs = null;
private JMenuItem jMenuItemFileExit = null;
@@ -429,6 +431,9 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
jMenuFile.add(getJMenuItemFileSaveAs());
jMenuFile.add(getJMenuItemFileSaveAll());
jMenuFile.addSeparator();
+
+ jMenuFile.add(getJMenuItemFileRefresh());
+ jMenuFile.addSeparator();
jMenuFile.add(getJMenuItemFilePageSetup());
jMenuFile.add(getJMenuItemFilePrint());
@@ -459,6 +464,23 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
}
/**
+ This method initializes jMenuItemFileRefresh
+
+ @return javax.swing.JMenuItem jMenuItemFileRefresh
+
+ **/
+ private JMenuItem getJMenuItemFileRefresh() {
+ if (jMenuItemFileRefresh == null) {
+ jMenuItemFileRefresh = new JMenuItem();
+ jMenuItemFileRefresh.setText("Refresh");
+ jMenuItemFileRefresh.setMnemonic('R');
+ jMenuItemFileRefresh.addActionListener(this);
+ jMenuItemFileRefresh.setVisible(true);
+ }
+ return jMenuItemFileRefresh;
+ }
+
+ /**
This method initializes jMenuItemModuleExit
@return javax.swing.JMenuItem jMenuItemModuleExit
@@ -633,6 +655,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
//
jMenuHelp = new JMenu();
jMenuHelp.setText("Help");
+ jMenuHelp.setMnemonic('H');
//
// Add sub menu items
@@ -656,6 +679,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
if (jMenuItemHelpAbout == null) {
jMenuItemHelpAbout = new JMenuItem();
jMenuItemHelpAbout.setText("About...");
+ jMenuItemHelpAbout.setMnemonic('A');
jMenuItemHelpAbout.addActionListener(this);
}
return jMenuItemHelpAbout;
@@ -882,6 +906,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
if (jMenuItemFileCloseAll == null) {
jMenuItemFileCloseAll = new JMenuItem();
jMenuItemFileCloseAll.setText("Close All");
+ jMenuItemFileCloseAll.setMnemonic('A');
jMenuItemFileCloseAll.setEnabled(true);
jMenuItemFileCloseAll.addActionListener(this);
}
@@ -1859,6 +1884,12 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
if (arg0.getSource() == this.jMenuItemFileSaveAll) {
this.saveAll();
}
+
+ if (arg0.getSource() == this.jMenuItemFileRefresh) {
+ this.closeAll();
+ this.refresh();
+ this.makeEmptyTree();
+ }
if (arg0.getSource() == this.jMenuItemFileExit) {
this.exit();
@@ -3309,13 +3340,13 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
//
// Reinit whole window
//
- closeAll();
+ this.closeAll();
this.setTitle(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION + " " + "- ["
+ Workspace.getCurrentWorkspace() + "]");
//
- // Reinit Global Data
+ // Refrash the tree
//
- GlobalData.init();
+ this.refresh();
}
sw.dispose();
}
@@ -3467,8 +3498,8 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
//
IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(
GlobalData.vPlatformList.lastElement().getName(),
- IDefaultMutableTreeNode.PLATFORM,
- false, GlobalData.vPlatformList.lastElement(),
+ IDefaultMutableTreeNode.PLATFORM, false,
+ GlobalData.vPlatformList.lastElement(),
this.dmtnPlatformDescription);
iTree.addNode(this.dmtnPlatformDescription, node);
}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java
index a50d2f1..e83a95b 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java
@@ -178,7 +178,7 @@ public class GlobalData {
@return a Vector with all modules' path
**/
- private static Vector<String> getAllModulesOfPackage(String path) {
+ public static Vector<String> getAllModulesOfPackage(String path) {
Vector<String> modulePath = new Vector<String>();
try {
MsaFiles files = OpenFile.openSpdFile(path).getMsaFiles();