summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-13 08:51:27 +0000
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-13 08:51:27 +0000
commit55a2762d8c1fe0291903f5015e11fd29b913f2b6 (patch)
treedb444afa7f3ecc524dfcd67ffa11d097b4b9ea1d /Tools
parentaab6a96a702f2de389671d2117107635a884dae8 (diff)
downloadedk2-platforms-55a2762d8c1fe0291903f5015e11fd29b913f2b6.tar.xz
1. Fix bug in get industry std headers
2. Fix bug in save msa without saving specification 3. Add tool tip text to ArchCheckBox 4. Locate to msa file location when open a file browser when edit source file in Msa 5. File filter only for text file when open/save ToolChainConfig file 6. Adjust UI for clone and add far id info when clone an item. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@971 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools')
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java80
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java372
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfig.java11
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java4
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java2
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IFileFilter.java2
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java4
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java9
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java2
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java7
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java22
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/PlatformIdentification.java3
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java381
13 files changed, 437 insertions, 462 deletions
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java
index 8f1ec6c6ba..68d8c48160 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java
@@ -121,7 +121,7 @@ public class Clone extends IDialog {
private JTextField getJTextFieldType() {
if (jTextFieldType == null) {
jTextFieldType = new JTextField();
- jTextFieldType.setBounds(new java.awt.Rectangle(160, 10, 320, 20));
+ jTextFieldType.setBounds(new java.awt.Rectangle(210, 10, 320, 20));
jTextFieldType.setEditable(false);
}
return jTextFieldType;
@@ -135,7 +135,7 @@ public class Clone extends IDialog {
private JTextField getJTextFieldSource() {
if (jTextFieldSource == null) {
jTextFieldSource = new JTextField();
- jTextFieldSource.setBounds(new java.awt.Rectangle(160, 35, 320, 20));
+ jTextFieldSource.setBounds(new java.awt.Rectangle(210, 35, 320, 20));
jTextFieldSource.setEditable(false);
}
return jTextFieldSource;
@@ -149,7 +149,7 @@ public class Clone extends IDialog {
private JButton getJButtonBrowse() {
if (jButtonBrowse == null) {
jButtonBrowse = new JButton();
- jButtonBrowse.setBounds(new java.awt.Rectangle(395, 60, 85, 20));
+ jButtonBrowse.setBounds(new java.awt.Rectangle(445, 85, 85, 20));
jButtonBrowse.setText("Browse");
jButtonBrowse.addActionListener(this);
}
@@ -164,7 +164,7 @@ public class Clone extends IDialog {
private JTextField getJTextFieldFilePath() {
if (jTextFieldFilePath == null) {
jTextFieldFilePath = new JTextField();
- jTextFieldFilePath.setBounds(new java.awt.Rectangle(160, 60, 230, 20));
+ jTextFieldFilePath.setBounds(new java.awt.Rectangle(210, 85, 230, 20));
}
return jTextFieldFilePath;
}
@@ -177,7 +177,7 @@ public class Clone extends IDialog {
private JTextField getJTextFieldBaseName() {
if (jTextFieldBaseName == null) {
jTextFieldBaseName = new JTextField();
- jTextFieldBaseName.setBounds(new java.awt.Rectangle(160, 110, 320, 20));
+ jTextFieldBaseName.setBounds(new java.awt.Rectangle(210, 110, 320, 20));
}
return jTextFieldBaseName;
}
@@ -190,7 +190,7 @@ public class Clone extends IDialog {
private JTextField getJTextFieldGuid() {
if (jTextFieldGuid == null) {
jTextFieldGuid = new JTextField();
- jTextFieldGuid.setBounds(new java.awt.Rectangle(160, 135, 230, 20));
+ jTextFieldGuid.setBounds(new java.awt.Rectangle(210, 135, 230, 20));
}
return jTextFieldGuid;
}
@@ -203,7 +203,7 @@ public class Clone extends IDialog {
private JTextField getJTextFieldVersion() {
if (jTextFieldVersion == null) {
jTextFieldVersion = new JTextField();
- jTextFieldVersion.setBounds(new java.awt.Rectangle(160, 160, 320, 20));
+ jTextFieldVersion.setBounds(new java.awt.Rectangle(210, 160, 320, 20));
}
return jTextFieldVersion;
}
@@ -216,7 +216,7 @@ public class Clone extends IDialog {
private JButton getJButtonOk() {
if (jButtonOk == null) {
jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(235, 200, 90, 20));
+ jButtonOk.setBounds(new java.awt.Rectangle(285, 200, 90, 20));
jButtonOk.setText("Ok");
jButtonOk.addActionListener(this);
}
@@ -231,7 +231,7 @@ public class Clone extends IDialog {
private JButton getJButtonCancel() {
if (jButtonCancel == null) {
jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(355, 200, 90, 20));
+ jButtonCancel.setBounds(new java.awt.Rectangle(405, 200, 90, 20));
jButtonCancel.setText("Cancel");
jButtonCancel.addActionListener(this);
}
@@ -246,7 +246,7 @@ public class Clone extends IDialog {
private JButton getJButtonGenerateGuid() {
if (jButtonGenerateGuid == null) {
jButtonGenerateGuid = new JButton();
- jButtonGenerateGuid.setBounds(new java.awt.Rectangle(395, 135, 85, 20));
+ jButtonGenerateGuid.setBounds(new java.awt.Rectangle(445, 135, 85, 20));
jButtonGenerateGuid.setText("Gen");
jButtonGenerateGuid.addActionListener(this);
}
@@ -261,7 +261,7 @@ public class Clone extends IDialog {
private JComboBox getJComboBoxExistingPackage() {
if (jComboBoxExistingPackage == null) {
jComboBoxExistingPackage = new JComboBox();
- jComboBoxExistingPackage.setBounds(new java.awt.Rectangle(160, 85, 320, 20));
+ jComboBoxExistingPackage.setBounds(new java.awt.Rectangle(210, 60, 320, 20));
}
return jComboBoxExistingPackage;
}
@@ -316,7 +316,7 @@ public class Clone extends IDialog {
* @return void
*/
private void init() {
- this.setSize(493, 260);
+ this.setSize(550, 260);
this.setContentPane(getJContentPane());
this.setTitle("Clone");
this.centerWindow();
@@ -331,20 +331,26 @@ public class Clone extends IDialog {
init();
if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
this.jTextFieldType.setText(DataType.MODULE_SURFACE_AREA);
- this.jTextFieldSource.setText(oldId.getPath());
+ String s = oldId.getPath();
+ s = Tools.getRelativePath(s, Tools.getFilePathOnly(wt.getPackageIdByModuleId(oldId).getPath()));
+ this.jTextFieldSource.setText(Tools.convertPathToCurrentOsType(s));
initExistingPackage();
- this.jButtonBrowse.setEnabled(false);
+ this.jButtonBrowse.setVisible(false);
this.jTextFieldFilePath.setToolTipText("Input module name here. For example, Application\\HelloWorld\\HelloWorld.msa");
- this.jLabelDestinationFile.setText("Module Path\\Name");
+ this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height);
+ this.jLabelDestinationFile.setText("New Module Path and Filename");
}
if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
this.jTextFieldType.setText(DataType.PACKAGE_SURFACE_AREA);
- this.jTextFieldSource.setText(oldId.getPath());
+ String s = oldId.getPath();
+ s = Tools.getRelativePath(oldId.getPath(), Workspace.getCurrentWorkspace());
+ this.jTextFieldSource.setText(Tools.convertPathToCurrentOsType(s));
this.jLabelBelong.setEnabled(false);
this.jComboBoxExistingPackage.setEnabled(false);
- this.jButtonBrowse.setEnabled(false);
+ this.jButtonBrowse.setVisible(false);
this.jTextFieldFilePath.setToolTipText("Input package name here. For example, MdePkg\\MdePkg.fpd");
- this.jLabelDestinationFile.setText("Package Path\\Name");
+ this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height);
+ this.jLabelDestinationFile.setText("New Package Path and Filename");
}
if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
this.jTextFieldType.setText(DataType.PLATFORM_SURFACE_AREA);
@@ -352,7 +358,7 @@ public class Clone extends IDialog {
this.jLabelBelong.setEnabled(false);
this.jComboBoxExistingPackage.setEnabled(false);
this.jTextFieldFilePath.setToolTipText("Select platform path here. For example, C:\\MyWorkspace\\EdkNt32Pkg\\Nt32.fpd");
- this.jLabelDestinationFile.setText("New Platform path");
+ this.jLabelDestinationFile.setText("New Platform Path and Filename");
}
if (mode == DataType.RETURN_TYPE_WORKSPACE) {
this.jTextFieldType.setText(DataType.WORKSPACE);
@@ -367,7 +373,7 @@ public class Clone extends IDialog {
this.jLabelVersion.setEnabled(false);
this.jTextFieldVersion.setEnabled(false);
this.jTextFieldFilePath.setToolTipText("Input workspace path here. For example, C:\\MyWorkspace");
- this.jLabelDestinationFile.setText("New Workspace path");
+ this.jLabelDestinationFile.setText("New Workspace Path");
}
}
@@ -379,29 +385,29 @@ public class Clone extends IDialog {
private JPanel getJContentPane() {
if (jContentPane == null) {
jLabelBelong = new JLabel();
- jLabelBelong.setBounds(new java.awt.Rectangle(15, 85, 140, 20));
+ jLabelBelong.setBounds(new java.awt.Rectangle(15, 60, 190, 20));
jLabelBelong.setText("Clone to Package");
jLabelVersion = new JLabel();
- jLabelVersion.setBounds(new java.awt.Rectangle(15, 160, 140, 20));
+ jLabelVersion.setBounds(new java.awt.Rectangle(15, 160, 190, 20));
jLabelVersion.setText("Version");
jLabelGuid = new JLabel();
- jLabelGuid.setBounds(new java.awt.Rectangle(15, 135, 140, 20));
+ jLabelGuid.setBounds(new java.awt.Rectangle(15, 135, 190, 20));
jLabelGuid.setText("Guid");
jLabelBaseName = new JLabel();
- jLabelBaseName.setBounds(new java.awt.Rectangle(15, 110, 140, 20));
+ jLabelBaseName.setBounds(new java.awt.Rectangle(15, 110, 190, 20));
jLabelBaseName.setText("Base Name");
jLabelDestinationFile = new JLabel();
- jLabelDestinationFile.setBounds(new java.awt.Rectangle(15, 60, 140, 20));
+ jLabelDestinationFile.setBounds(new java.awt.Rectangle(15, 85, 190, 20));
jLabelDestinationFile.setText("Destination File Name");
jLabelSource = new JLabel();
- jLabelSource.setBounds(new java.awt.Rectangle(15, 35, 140, 20));
+ jLabelSource.setBounds(new java.awt.Rectangle(15, 35, 190, 20));
jLabelSource.setText("Source");
jLabelType = new JLabel();
- jLabelType.setBounds(new java.awt.Rectangle(15, 10, 140, 20));
+ jLabelType.setBounds(new java.awt.Rectangle(15, 10, 190, 20));
jLabelType.setText("Type");
jContentPane = new JPanel();
jContentPane.setLayout(null);
- jContentPane.setSize(new java.awt.Dimension(490, 227));
+ jContentPane.setSize(new java.awt.Dimension(540, 227));
jContentPane.add(jLabelType, null);
jContentPane.add(getJTextFieldType(), null);
jContentPane.add(jLabelSource, null);
@@ -551,7 +557,7 @@ public class Clone extends IDialog {
**/
private boolean check() {
- String src = this.jTextFieldSource.getText();
+ String src = this.oldId.getPath();
String trg = this.jTextFieldFilePath.getText();
File srcFile = new File(src);
File trgFile = new File(trg);
@@ -648,7 +654,7 @@ public class Clone extends IDialog {
}
private void save() throws IOException, XmlException, Exception {
- String src = this.jTextFieldSource.getText();
+ String src = this.oldId.getPath();
String trg = this.jTextFieldFilePath.getText();
Vector<String> vFiles = new Vector<String>();
@@ -898,6 +904,10 @@ public class Clone extends IDialog {
c.setPackageGuid(wt.getPackageIdByModuleId(oldId).getGuid());
c.setPackageVersion(wt.getPackageIdByModuleId(oldId).getVersion());
c.setId(count.add(new BigInteger("1")));
+ String guid = wt.getModuleFarGuid(oldId);
+ if (guid != null && !guid.equals("")) {
+ c.setFarGuid(guid);
+ }
cf.addNewCloned();
cf.setClonedArray(cf.getClonedList().size() - 1, c);
@@ -950,6 +960,10 @@ public class Clone extends IDialog {
c.setPackageGuid(id.getGuid());
c.setPackageVersion(id.getVersion());
c.setId(count.add(new BigInteger("1")));
+ String guid = wt.getModuleFarGuid(oldId);
+ if (guid != null && !guid.equals("")) {
+ c.setFarGuid(guid);
+ }
cf.addNewCloned();
cf.setClonedArray(cf.getClonedList().size() - 1, c);
@@ -1002,7 +1016,11 @@ public class Clone extends IDialog {
c.setPlatformGuid(id.getGuid());
c.setPlatformVersion(id.getVersion());
c.setId(count.add(new BigInteger("1")));
-
+ String guid = wt.getModuleFarGuid(oldId);
+ if (guid != null && !guid.equals("")) {
+ c.setFarGuid(guid);
+ }
+
cf.addNewCloned();
cf.setClonedArray(cf.getClonedList().size() - 1, c);
pd.addNewClonedFrom();
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
index 6426f6b0e5..1087d85a4e 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
@@ -1793,7 +1793,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
CreateStepOne cso = new CreateStepOne(this, true);
int result = cso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
- this.closeAll();
+ String strReturn = "Create Far Done!";
+ JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);
}
cso.dispose();
}
@@ -1802,6 +1803,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
InstallStepOne iso = new InstallStepOne(this, true);
int result = iso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
+ String strReturn = "<html>Install Far Done! <br>The WORKSPACE will be refreshed!</html>";
+ JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);
this.closeAll();
}
iso.dispose();
@@ -1811,6 +1814,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
DeleteStepOne dso = new DeleteStepOne(this, true);
int result = dso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
+ String strReturn = "<html>Delete Far Done! <br>The WORKSPACE will be refreshed!</html>";
+ JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);
this.closeAll();
}
dso.dispose();
@@ -1820,6 +1825,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
UpdateStepOne uso = new UpdateStepOne(this, true);
int result = uso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
+ String strReturn = "<html>Update Far Done! <br>The WORKSPACE will be refreshed!</html>";
+ JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);
this.closeAll();
}
uso.dispose();
@@ -2039,147 +2046,76 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
fc.addChoosableFileFilter(new IFileFilter(ext));
return fc.showSaveDialog(new JPanel());
}
-
- /**
- Open Module
-
- @param path input file path
-
- **/
- private void openModule(String path, ModuleIdentification moduleId) {
- ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = null;
- try {
- msa = OpenFile.openMsaFile(path);
- } catch (IOException e) {
- Log.err("Open Module Surface Area " + path, e.getMessage());
- return;
- } catch (XmlException e) {
- Log.err("Open Module Surface Area " + path, e.getMessage());
- return;
- } catch (Exception e) {
- Log.err("Open Module Surface Area " + path, "Invalid file type");
- return;
- }
- Identification id = new Identification(msa.getMsaHeader().getModuleName(), msa.getMsaHeader().getGuidValue(),
- msa.getMsaHeader().getVersion(), path);
- //
- // Generate module id
- //
- PackageIdentification pid = wt.getPackageIdByModuleId(id);
- if (pid != null) {
- //
- // To judge if the module existed in vModuleList
- // If not, add it to vModuleList
- //
- boolean isFind = false;
- for (int index = 0; index < vModuleList.size(); index++) {
- if (vModuleList.elementAt(index).equals(id)) {
- isFind = true;
- break;
- }
- }
- if (!isFind) {
- ModuleIdentification mid = new ModuleIdentification(id, pid, moduleId.isLibrary());
- vModuleList.addElement(mid);
- //
- // Add new MsaHeader node to the tree
- //
- IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(mid.getName(),
- IDefaultMutableTreeNode.MSA_HEADER, true,
- mid);
- //
- // First find the module belongs to which package
- //
- IDefaultMutableTreeNode packageNode = iTree.getNodeById(dmtnModuleDescription, mid.getPackageId(),
- IDefaultMutableTreeNode.MODULE_PACKAGE);
- //
- // To check if has module node or library node
- //
- IDefaultMutableTreeNode parentModuleNode = null;
- IDefaultMutableTreeNode parentLibraryNode = null;
- boolean hasModule = false;
- boolean hasLibrary = false;
- for (int index = 0; index < packageNode.getChildCount(); index++) {
- IDefaultMutableTreeNode iNode = (IDefaultMutableTreeNode) packageNode.getChildAt(index);
- if (iNode.getCategory() == IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY) {
- hasLibrary = true;
- parentLibraryNode = iNode;
- }
- if (iNode.getCategory() == IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE) {
- hasModule = true;
- parentModuleNode = iNode;
- }
- }
-
- //
- // If is a module
- //
- if (!mid.isLibrary()) {
- //
- // Create parent node first if has no parent node
- //
- if (!hasModule) {
- parentModuleNode = new IDefaultMutableTreeNode("Module",
- IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
- false, mid.getPackageId());
- iTree.addNode(packageNode, parentModuleNode);
- }
-
- iTree.addNode(parentModuleNode, node);
- }
-
- //
- // If is a Library
- //
- if (mid.isLibrary()) {
- //
- // Create parent node first if has no parent node
- //
- if (!hasLibrary) {
- parentLibraryNode = new IDefaultMutableTreeNode("Library",
- IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY,
- false, mid.getPackageId());
- iTree.addNode(packageNode, parentLibraryNode);
- }
-
- iTree.addNode(parentLibraryNode, node);
- }
- }
- } else {
- //
- // The module is not in existing packages
- //
- Log.err("The module hasn't been added to any package of current workspace!");
- return;
- }
-
- //
- // Make the node selected
- //
- iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id,
- IDefaultMutableTreeNode.MSA_HEADER)));
- //
- // Update opening Module list information
- //
- if (!openingModuleList.existsModule(id)) {
- //
- // Insert sub node of module
- //
- insertModuleTreeNode(id);
- iTree.getSelectNode().setOpening(true);
-
- //
- // Update opening module list
- //
- openingModuleList.insertToOpeningModuleList(id, msa);
- openingModuleList.setTreePathById(id, iTree.getSelectionPath());
- }
- //
- // Show msa header in editor panel
- //
- showModuleElement(IDefaultMutableTreeNode.MSA_HEADER, openingModuleList.getOpeningModuleById(id));
- this.currentOpeningModuleIndex = openingModuleList.findIndexOfListById(id);
- }
+
+ /**
+ Add a module to tree
+
+ @param mid The module node to be added
+
+ **/
+ private void addModuleToTree(ModuleIdentification mid) {
+ //
+ // Add new MsaHeader node to the tree
+ //
+ IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(mid.getName(), IDefaultMutableTreeNode.MSA_HEADER,
+ true, mid);
+ //
+ // First find the module belongs to which package
+ //
+ IDefaultMutableTreeNode packageNode = iTree.getNodeById(dmtnModuleDescription, mid.getPackageId(),
+ IDefaultMutableTreeNode.MODULE_PACKAGE);
+ //
+ // To check if has module node or library node
+ //
+ IDefaultMutableTreeNode parentModuleNode = null;
+ IDefaultMutableTreeNode parentLibraryNode = null;
+ boolean hasModule = false;
+ boolean hasLibrary = false;
+ for (int index = 0; index < packageNode.getChildCount(); index++) {
+ IDefaultMutableTreeNode iNode = (IDefaultMutableTreeNode) packageNode.getChildAt(index);
+ if (iNode.getCategory() == IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY) {
+ hasLibrary = true;
+ parentLibraryNode = iNode;
+ }
+ if (iNode.getCategory() == IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE) {
+ hasModule = true;
+ parentModuleNode = iNode;
+ }
+ }
+
+ //
+ // If is a module
+ //
+ if (!mid.isLibrary()) {
+ //
+ // Create parent node first if has no parent node
+ //
+ if (!hasModule) {
+ parentModuleNode = new IDefaultMutableTreeNode("Module", IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
+ false, mid.getPackageId());
+ iTree.addNode(packageNode, parentModuleNode);
+ }
+
+ iTree.addNode(parentModuleNode, node);
+ }
+
+ //
+ // If is a Library
+ //
+ if (mid.isLibrary()) {
+ //
+ // Create parent node first if has no parent node
+ //
+ if (!hasLibrary) {
+ parentLibraryNode = new IDefaultMutableTreeNode("Library",
+ IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY, false,
+ mid.getPackageId());
+ iTree.addNode(packageNode, parentLibraryNode);
+ }
+
+ iTree.addNode(parentLibraryNode, node);
+ }
+ }
/**
Open Module
@@ -2187,7 +2123,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@param path input file path
**/
- private void openModule(String path) {
+ private void openModule(String path, ModuleIdentification moduleId) {
ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = null;
try {
msa = OpenFile.openMsaFile(path);
@@ -2220,72 +2156,89 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
}
}
if (!isFind) {
- ModuleIdentification mid = new ModuleIdentification(id, pid);
+ ModuleIdentification mid = new ModuleIdentification(id, pid, moduleId.isLibrary());
vModuleList.addElement(mid);
- //
- // Add new MsaHeader node to the tree
- //
- IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(mid.getName(),
- IDefaultMutableTreeNode.MSA_HEADER, true,
- mid);
- //
- // First find the module belongs to which package
- //
- IDefaultMutableTreeNode packageNode = iTree.getNodeById(dmtnModuleDescription, mid.getPackageId(),
- IDefaultMutableTreeNode.MODULE_PACKAGE);
- //
- // To check if has module node or library node
- //
- IDefaultMutableTreeNode parentModuleNode = null;
- IDefaultMutableTreeNode parentLibraryNode = null;
- boolean hasModule = false;
- boolean hasLibrary = false;
- for (int index = 0; index < packageNode.getChildCount(); index++) {
- IDefaultMutableTreeNode iNode = (IDefaultMutableTreeNode) packageNode.getChildAt(index);
- if (iNode.getCategory() == IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY) {
- hasLibrary = true;
- parentLibraryNode = iNode;
- }
- if (iNode.getCategory() == IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE) {
- hasModule = true;
- parentModuleNode = iNode;
- }
- }
+ addModuleToTree(mid);
+ }
+ } else {
+ //
+ // The module is not in existing packages
+ //
+ Log.err("The module hasn't been added to any package of current workspace!");
+ return;
+ }
- //
- // If is a module
- //
- if (!mid.isLibrary()) {
- //
- // Create parent node first if has no parent node
- //
- if (!hasModule) {
- parentModuleNode = new IDefaultMutableTreeNode("Module",
- IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
- false, mid.getPackageId());
- iTree.addNode(packageNode, parentModuleNode);
- }
+ //
+ // Make the node selected
+ //
+ iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id,
+ IDefaultMutableTreeNode.MSA_HEADER)));
+ //
+ // Update opening Module list information
+ //
+ if (!openingModuleList.existsModule(id)) {
+ //
+ // Insert sub node of module
+ //
+ insertModuleTreeNode(id);
+ iTree.getSelectNode().setOpening(true);
- iTree.addNode(parentModuleNode, node);
- }
+ //
+ // Update opening module list
+ //
+ openingModuleList.insertToOpeningModuleList(id, msa);
+ openingModuleList.setTreePathById(id, iTree.getSelectionPath());
+ }
+ //
+ // Show msa header in editor panel
+ //
+ showModuleElement(IDefaultMutableTreeNode.MSA_HEADER, openingModuleList.getOpeningModuleById(id));
+ this.currentOpeningModuleIndex = openingModuleList.findIndexOfListById(id);
+ }
- //
- // If is a Library
- //
- if (mid.isLibrary()) {
- //
- // Create parent node first if has no parent node
- //
- if (!hasLibrary) {
- parentLibraryNode = new IDefaultMutableTreeNode("Library",
- IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY,
- false, mid.getPackageId());
- iTree.addNode(packageNode, parentLibraryNode);
- }
+ /**
+ Open Module
- iTree.addNode(parentLibraryNode, node);
+ @param path input file path
+
+ **/
+ private void openModule(String path) {
+ ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = null;
+ try {
+ msa = OpenFile.openMsaFile(path);
+ } catch (IOException e) {
+ Log.err("Open Module Surface Area " + path, e.getMessage());
+ return;
+ } catch (XmlException e) {
+ Log.err("Open Module Surface Area " + path, e.getMessage());
+ return;
+ } catch (Exception e) {
+ Log.err("Open Module Surface Area " + path, "Invalid file type");
+ return;
+ }
+ Identification id = new Identification(msa.getMsaHeader().getModuleName(), msa.getMsaHeader().getGuidValue(),
+ msa.getMsaHeader().getVersion(), path);
+ //
+ // Generate module id
+ //
+ PackageIdentification pid = wt.getPackageIdByModuleId(id);
+ if (pid != null) {
+ //
+ // To judge if the module existed in vModuleList
+ // If not, add it to vModuleList
+ //
+ boolean isFind = false;
+ for (int index = 0; index < vModuleList.size(); index++) {
+ if (vModuleList.elementAt(index).equals(id)) {
+ isFind = true;
+ break;
}
}
+ if (!isFind) {
+ ModuleIdentification mid = new ModuleIdentification(id, pid);
+ vModuleList.addElement(mid);
+ addModuleToTree(mid);
+ }
} else {
//
// The module is not in existing packages
@@ -2293,7 +2246,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
Log.err("The module hasn't been added to any package of current workspace!");
return;
}
-
+
//
// Make the node selected
//
@@ -3248,13 +3201,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
if (result == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
Tools.showInformationMessage("Module Surface Area Clone Finished");
vModuleList.addElement(c.getMid());
- //
- // Add new MsaHeader node to the tree
- //
- IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(vModuleList.lastElement().getName(),
- IDefaultMutableTreeNode.MSA_HEADER, true,
- vModuleList.lastElement());
- iTree.addNode(dmtnModuleDescription, node);
+ addModuleToTree(c.getMid());
}
if (result == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
Tools.showInformationMessage("Package Surface Area Clone Finished");
@@ -3327,7 +3274,10 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
} else {
int category = iTree.getSelectCategory();
if (category == IDefaultMutableTreeNode.MODULE || category == IDefaultMutableTreeNode.PACKAGE
- || category == IDefaultMutableTreeNode.PLATFORM) {
+ || category == IDefaultMutableTreeNode.PLATFORM
+ || category == IDefaultMutableTreeNode.MODULE_PACKAGE
+ || category == IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY
+ || category == IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE) {
jMenuItemToolsClone.setEnabled(false);
} else {
jMenuItemToolsClone.setEnabled(true);
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfig.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfig.java
index ddfb479cc4..ce3f96c91c 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfig.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfig.java
@@ -35,6 +35,7 @@ import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import org.tianocore.frameworkwizard.common.DataType;
+import org.tianocore.frameworkwizard.common.IFileFilter;
import org.tianocore.frameworkwizard.common.Log;
import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.Identifications.ToolChainConfigId;
@@ -348,7 +349,9 @@ public class ToolChainConfig extends IFrame implements ListSelectionListener, Ta
if (arg0.getSource() == jButtonOpen) {
JFileChooser fc = new JFileChooser();
- fc.setAcceptAllFileFilterUsed(true);
+ fc.setAcceptAllFileFilterUsed(false);
+ IFileFilter iff = new IFileFilter(DataType.TEXT_FILE_EXT);
+ fc.addChoosableFileFilter(iff);
fc.setCurrentDirectory(new File(toolsDir));
int result = fc.showOpenDialog(new JPanel());
@@ -369,8 +372,10 @@ public class ToolChainConfig extends IFrame implements ListSelectionListener, Ta
if (arg0.getSource() == jButtonSave) {
JFileChooser fc = new JFileChooser();
- fc.setAcceptAllFileFilterUsed(true);
- fc.setSelectedFile(new File(currentFile));
+ fc.setAcceptAllFileFilterUsed(false);
+ IFileFilter iff = new IFileFilter(DataType.TEXT_FILE_EXT);
+ fc.addChoosableFileFilter(iff);
+ fc.setCurrentDirectory(new File(toolsDir));
int result = fc.showSaveDialog(new JPanel());
if (result == JFileChooser.APPROVE_OPTION) {
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java
index cd432b1bf7..22367795ec 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java
@@ -162,7 +162,7 @@ public class DataType {
public static final int SPACE_TO_RIGHT_FOR_REMOVE_BUTTON = 95;
public static final int SPACE_TO_RIGHT_FOR_UPDATE_BUTTON = 10;
-
+
public static final int SPACE_TO_BOTTOM_FOR_ADD_BUTTON = 30;
public static final int SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON = 30;
@@ -210,7 +210,7 @@ public class DataType {
// First defined here
// Will be replaced by resource file later
//
- public static final String SUP_ARCH_LIST_HELP_TEXT = "Deselecting a checkbox will restrict this module for use with the selected architectures, based on the list of items that are checked. If all boxes are checked, then the module will support all current AND FUTURE architectures";
+ public static final String SUP_ARCH_LIST_HELP_TEXT = "<html>Selecting a checkbox means supporting the selected architectures;<br> None of boxes are checked means supporting all architectures<html>";
//
// Project name and version
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java
index b14c86f10a..a03dfac775 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java
@@ -307,6 +307,7 @@ public class EnumerationData {
vModuleType.addElement("UEFI_DRIVER");
vModuleType.addElement("UEFI_APPLICATION");
vModuleType.addElement("USER_DEFINED");
+ Tools.sortVectorString(vModuleType, DataType.SORT_TYPE_ASCENDING);
}
// private void initComponentType() {
@@ -362,6 +363,7 @@ public class EnumerationData {
vFrameworkModuleTypes.addElement("UEFI_DRIVER");
vFrameworkModuleTypes.addElement("UEFI_APPLICATION");
vFrameworkModuleTypes.addElement("USER_DEFINED");
+ Tools.sortVectorString(vFrameworkModuleTypes, DataType.SORT_TYPE_ASCENDING);
}
private void initLibClassDef() {
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IFileFilter.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IFileFilter.java
index b2d2bbe9da..8194a316c6 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IFileFilter.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IFileFilter.java
@@ -84,7 +84,7 @@ public class IFileFilter extends FileFilter {
if (strExt.equals(DataType.TEXT_FILE_EXT))
return DataType.TEXT_FILE_EXT_DESCRIPTION;
if (strExt.equals(DataType.FAR_SURFACE_AREA_EXT))
- return DataType.FAR_SURFACE_AREA_EXT_DESCRIPTION;
+ return DataType.FAR_SURFACE_AREA_EXT_DESCRIPTION;
return "";
}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
index 517c4b1b3a..8cb8dc0302 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
@@ -305,8 +305,8 @@ public class Tools {
match = DataType.FILE_EXT_SEPARATOR + DataType.TEXT_FILE_EXT;
}
if (type == DataType.RETURN_TYPE_FAR_SURFACE_AREA) {
- match = DataType.FILE_EXT_SEPARATOR + DataType.FAR_SURFACE_AREA_EXT;
- }
+ match = DataType.FILE_EXT_SEPARATOR + DataType.FAR_SURFACE_AREA_EXT;
+ }
if (path.length() <= match.length()) {
path = path + match;
return path;
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java
index e564ab5eff..901ff86634 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java
@@ -20,6 +20,8 @@ import java.util.Vector;
import javax.swing.JPanel;
import javax.swing.JCheckBox;
+import org.tianocore.frameworkwizard.common.DataType;
+
public class ArchCheckBox extends JPanel {
///
@@ -49,6 +51,7 @@ public class ArchCheckBox extends JPanel {
jCheckBoxIa32 = new JCheckBox();
jCheckBoxIa32.setBounds(new java.awt.Rectangle(0, 0, 50, 20));
jCheckBoxIa32.setText("IA32");
+ jCheckBoxIa32.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
}
return jCheckBoxIa32;
}
@@ -63,6 +66,7 @@ public class ArchCheckBox extends JPanel {
jCheckBoxX64 = new JCheckBox();
jCheckBoxX64.setBounds(new java.awt.Rectangle(50, 0, 50, 20));
jCheckBoxX64.setText("X64");
+ jCheckBoxX64.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
}
return jCheckBoxX64;
}
@@ -77,6 +81,7 @@ public class ArchCheckBox extends JPanel {
jCheckBoxIpf = new JCheckBox();
jCheckBoxIpf.setBounds(new java.awt.Rectangle(100, 0, 50, 20));
jCheckBoxIpf.setText("IPF");
+ jCheckBoxIpf.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
}
return jCheckBoxIpf;
}
@@ -91,6 +96,7 @@ public class ArchCheckBox extends JPanel {
jCheckBoxEbc = new JCheckBox();
jCheckBoxEbc.setBounds(new java.awt.Rectangle(150, 0, 50, 20));
jCheckBoxEbc.setText("EBC");
+ jCheckBoxEbc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
}
return jCheckBoxEbc;
}
@@ -105,6 +111,7 @@ public class ArchCheckBox extends JPanel {
jCheckBoxArm = new JCheckBox();
jCheckBoxArm.setBounds(new java.awt.Rectangle(200, 0, 55, 20));
jCheckBoxArm.setText("ARM");
+ jCheckBoxArm.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
}
return jCheckBoxArm;
}
@@ -119,6 +126,7 @@ public class ArchCheckBox extends JPanel {
jCheckBoxPpc = new JCheckBox();
jCheckBoxPpc.setBounds(new java.awt.Rectangle(255, 0, 50, 20));
jCheckBoxPpc.setText("PPC");
+ jCheckBoxPpc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
}
return jCheckBoxPpc;
}
@@ -155,6 +163,7 @@ public class ArchCheckBox extends JPanel {
this.add(getJCheckBoxEbc(), null);
this.add(getJCheckBoxArm(), null);
this.add(getJCheckBoxPpc(), null);
+ this.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
}
public Vector<String> getSelectedItemsVector() {
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java
index 515017349b..7dd7d32e3a 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java
@@ -344,7 +344,7 @@ public class ModuleSourceFiles extends IInternalFrame {
}
private void showEdit(int index) {
- SourceFilesDlg sfd = new SourceFilesDlg(this.vSourceFiles.getSourceFiles(index), new IFrame());
+ SourceFilesDlg sfd = new SourceFilesDlg(this.vSourceFiles.getSourceFiles(index), new IFrame(), omt.getId().getPath());
int result = sfd.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) {
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
index 5e65afbea8..250eb9da2d 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
@@ -254,12 +254,6 @@ public class MsaHeader extends IInternalFrame {
jTextFieldSpecification.setLocation(new java.awt.Point(160, 435));
jTextFieldSpecification.setEditable(false);
jTextFieldSpecification.addFocusListener(this);
- jTextFieldSpecification
- .setToolTipText("Deselecting a checkbox"
- + " will restrict this module for use with the selected architectures, "
- + "based on the list of items that are checked. "
- + "If all boxes are checked, "
- + "then the module will support all current AND FUTURE architectures");
}
return jTextFieldSpecification;
}
@@ -800,6 +794,7 @@ public class MsaHeader extends IInternalFrame {
// }
// this.msaHeader.setSpecification(this.jTextFieldSpecification.getText());
+ msaHeader.setSpecification(this.jTextFieldSpecification.getText());
msa.setMsaHeader(msaHeader);
this.omt.setSaved(false);
} catch (Exception e) {
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java
index 3c868494ef..53ac9a591c 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java
@@ -15,6 +15,7 @@
package org.tianocore.frameworkwizard.module.ui.dialog;
import java.awt.event.ActionEvent;
+import java.io.File;
import java.util.Vector;
import javax.swing.JButton;
@@ -27,12 +28,12 @@ import javax.swing.JTextField;
import org.tianocore.frameworkwizard.common.DataType;
import org.tianocore.frameworkwizard.common.DataValidation;
import org.tianocore.frameworkwizard.common.Log;
+import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.SourceFiles.SourceFilesIdentification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
/**
The class is used to create, update SourceFile of MSA/MBD file
@@ -82,15 +83,17 @@ public class SourceFilesDlg extends IDialog {
private JTextField jTextFieldFeatureFlag = null;
private ArchCheckBox jArchCheckBox = null;
+
+ private JButton jButtonOk = null;
+
+ private JButton jButtonCancel = null;
//
// Not used by UI
//
private SourceFilesIdentification sfid = null;
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
+ private String msaFileName = "";
/**
This method initializes jTextFieldFileName
@@ -238,9 +241,9 @@ public class SourceFilesDlg extends IDialog {
This is the default constructor
**/
- public SourceFilesDlg(SourceFilesIdentification inSourceFilesIdentification, IFrame iFrame) {
+ public SourceFilesDlg(SourceFilesIdentification inSourceFilesIdentification, IFrame iFrame, String fileName) {
super(iFrame, true);
- init(inSourceFilesIdentification);
+ init(inSourceFilesIdentification, fileName);
}
/**
@@ -263,9 +266,10 @@ public class SourceFilesDlg extends IDialog {
@param inSourceFiles The input data of SourceFilesDocument.SourceFiles
**/
- private void init(SourceFilesIdentification inSourceFilesIdentifications) {
+ private void init(SourceFilesIdentification inSourceFilesIdentifications, String fileName) {
init();
this.sfid = inSourceFilesIdentifications;
+ this.msaFileName = fileName;
if (this.sfid != null) {
this.jTextFieldFileName.setText(sfid.getFilename());
@@ -451,8 +455,8 @@ public class SourceFilesDlg extends IDialog {
**/
private void selectFile() {
- JFileChooser fc = new JFileChooser(Workspace.getCurrentWorkspace());
-
+ JFileChooser fc = new JFileChooser();
+ fc.setCurrentDirectory(new File(Tools.getFilePathOnly(msaFileName)));
int result = fc.showOpenDialog(new JPanel());
if (result == JFileChooser.APPROVE_OPTION) {
this.jTextFieldFileName.setText(fc.getSelectedFile().getName());
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/PlatformIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/PlatformIdentification.java
index ced7c92152..2fdbdd6d73 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/PlatformIdentification.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/PlatformIdentification.java
@@ -23,8 +23,7 @@ import org.tianocore.frameworkwizard.common.Identifications.Identification;
import org.tianocore.frameworkwizard.workspace.Workspace;
public class PlatformIdentification extends Identification{
-
-
+
public PlatformIdentification(String name, String guid, String version, String path){
super(name, guid, version, path);
}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java
index dda8844495..46c325e3b3 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java
@@ -77,39 +77,37 @@ public class WorkspaceTools {
}
public void addFarToDb(List<String> packageList, List<String> platformList, FarHeader far) {
- FrameworkDatabase fdb = openFrameworkDb();
-
- for (int i = 0; i < packageList.size(); i++) {
- DbPathAndFilename item = DbPathAndFilename.Factory.newInstance();
- item.setFarGuid(far.getGuidValue());
- item.setStringValue(packageList.get(i));
- fdb.getPackageList().getFilenameList().add(item);
- }
-
- for (int i = 0; i < platformList.size(); i++) {
- DbPathAndFilename item = DbPathAndFilename.Factory.newInstance();
- item.setFarGuid(far.getGuidValue());
- item.setStringValue(platformList.get(i));
- fdb.getPlatformList().getFilenameList().add(item);
- }
-
- DbPathAndFilename farItem = DbPathAndFilename.Factory.newInstance();
- farItem.setFarGuid(far.getGuidValue());
- farItem.setStringValue(far.getFarName());
- fdb.getFarList().getFilenameList().add(farItem);
-
- String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();
- strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);
-
- try {
- SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);
- }
- catch (Exception e) {
- e.printStackTrace();
- }
+ FrameworkDatabase fdb = openFrameworkDb();
+
+ for (int i = 0; i < packageList.size(); i++) {
+ DbPathAndFilename item = DbPathAndFilename.Factory.newInstance();
+ item.setFarGuid(far.getGuidValue());
+ item.setStringValue(packageList.get(i));
+ fdb.getPackageList().getFilenameList().add(item);
+ }
+
+ for (int i = 0; i < platformList.size(); i++) {
+ DbPathAndFilename item = DbPathAndFilename.Factory.newInstance();
+ item.setFarGuid(far.getGuidValue());
+ item.setStringValue(platformList.get(i));
+ fdb.getPlatformList().getFilenameList().add(item);
+ }
+
+ DbPathAndFilename farItem = DbPathAndFilename.Factory.newInstance();
+ farItem.setFarGuid(far.getGuidValue());
+ farItem.setStringValue(far.getFarName());
+ fdb.getFarList().getFilenameList().add(farItem);
+
+ String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();
+ strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);
+
+ try {
+ SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
-
-
+
public void removeFarFromDb(FarIdentification far) {
FrameworkDatabase fdb = openFrameworkDb();
//
@@ -118,90 +116,87 @@ public class WorkspaceTools {
XmlCursor cursor = fdb.getPackageList().newCursor();
cursor.toFirstChild();
do {
- DbPathAndFilename item = (DbPathAndFilename)cursor.getObject();
-
- if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
- cursor.removeXml();
- }
+ DbPathAndFilename item = (DbPathAndFilename) cursor.getObject();
+
+ if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
+ cursor.removeXml();
+ }
} while (cursor.toNextSibling());
cursor.dispose();
-
+
//
// Remove Platforms
//
cursor = fdb.getPlatformList().newCursor();
cursor.toFirstChild();
do {
- DbPathAndFilename item = (DbPathAndFilename)cursor.getObject();
- if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
- cursor.removeXml();
- }
+ DbPathAndFilename item = (DbPathAndFilename) cursor.getObject();
+ if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
+ cursor.removeXml();
+ }
} while (cursor.toNextSibling());
-
+
//
// Remove Far
//
cursor = fdb.getFarList().newCursor();
cursor.toFirstChild();
do {
- DbPathAndFilename item = (DbPathAndFilename)cursor.getObject();
- if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
- cursor.removeXml();
- }
+ DbPathAndFilename item = (DbPathAndFilename) cursor.getObject();
+ if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
+ cursor.removeXml();
+ }
} while (cursor.toNextSibling());
cursor.dispose();
-
+
String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();
strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);
try {
- SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public String getPackageFarGuid(PackageIdentification packageId) {
- openFrameworkDb();
-
- for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) {
- DbPathAndFilename item = fdb.getPackageList().getFilenameArray(index);
- String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR
- + item.getStringValue();
- File tempFile = new File(path);
- if (tempFile.getPath().equalsIgnoreCase(packageId.getSpdFile().getPath())) {
- return fdb.getPackageList().getFilenameArray(index).getFarGuid();
- }
- }
-
- return null;
- }
-
- public String getPlatformFarGuid(PlatformIdentification platformId) {
- openFrameworkDb();
-
- for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) {
- DbPathAndFilename item = fdb.getPlatformList().getFilenameArray(index);
- String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR
- + item.getStringValue();
- File tempFile = new File(path);
- if (tempFile.getPath().equalsIgnoreCase(platformId.getFpdFile().getPath())) {
- return fdb.getPlatformList().getFilenameArray(index).getFarGuid();
- }
- }
-
- return null;
- }
-
- public String getModuleFarGuid(ModuleIdentification moduleId) {
- PackageIdentification packageId = getPackageIdByModuleId(moduleId);
- if (packageId != null) {
- return getPackageFarGuid(packageId);
- }
- else {
+ SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public String getPackageFarGuid(Identification packageId) {
+ openFrameworkDb();
+
+ for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) {
+ DbPathAndFilename item = fdb.getPackageList().getFilenameArray(index);
+ String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();
+ File tempFile = new File(path);
+ if (tempFile.getPath().equalsIgnoreCase(packageId.getPath())) {
+ return fdb.getPackageList().getFilenameArray(index).getFarGuid();
+ }
+ }
+
return null;
- }
}
+
+ public String getPlatformFarGuid(Identification platformId) {
+ openFrameworkDb();
+
+ for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) {
+ DbPathAndFilename item = fdb.getPlatformList().getFilenameArray(index);
+ String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();
+ File tempFile = new File(path);
+ if (tempFile.getPath().equalsIgnoreCase(platformId.getPath())) {
+ return fdb.getPlatformList().getFilenameArray(index).getFarGuid();
+ }
+ }
+
+ return null;
+ }
+
+ public String getModuleFarGuid(Identification moduleId) {
+ PackageIdentification packageId = getPackageIdByModuleId(moduleId);
+ if (packageId != null) {
+ return getPackageFarGuid(packageId);
+ } else {
+ return null;
+ }
+ }
+
/**
Get all modules' paths from one package
@@ -229,34 +224,34 @@ public class WorkspaceTools {
}
return modulePath;
}
-
+
/**
- Get all Industry Std Includes' paths from one package
-
- @return a Vector with all paths
-
- **/
- public Vector<String> getAllIndustryStdIncludesOfPackage(String path) {
- Vector<String> includePath = new Vector<String>();
- try {
- IndustryStdIncludes files = OpenFile.openSpdFile(path).getIndustryStdIncludes();
- if (files != null) {
- for (int index = 0; index < files.getIndustryStdHeaderList().size(); index++) {
- String temp = files.getIndustryStdHeaderList().get(index).getName();
- temp = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + temp;
- temp = Tools.convertPathToCurrentOsType(temp);
- includePath.addElement(temp);
- }
- }
- } catch (IOException e) {
-
- } catch (XmlException e) {
-
- } catch (Exception e) {
-
- }
- return includePath;
- }
+ Get all Industry Std Includes' paths from one package
+
+ @return a Vector with all paths
+
+ **/
+ public Vector<String> getAllIndustryStdIncludesOfPackage(String path) {
+ Vector<String> includePath = new Vector<String>();
+ try {
+ IndustryStdIncludes files = OpenFile.openSpdFile(path).getIndustryStdIncludes();
+ if (files != null) {
+ for (int index = 0; index < files.getIndustryStdHeaderList().size(); index++) {
+ String temp = files.getIndustryStdHeaderList().get(index).getIncludeHeader();
+ temp = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + temp;
+ temp = Tools.convertPathToCurrentOsType(temp);
+ includePath.addElement(temp);
+ }
+ }
+ } catch (IOException e) {
+
+ } catch (XmlException e) {
+
+ } catch (Exception e) {
+
+ }
+ return includePath;
+ }
/**
Get all package basic information form the FrameworkDatabase.db file
@@ -293,90 +288,88 @@ public class WorkspaceTools {
}
public Vector<FarIdentification> getAllFars() {
- openFrameworkDb();
- Vector<FarIdentification> v = new Vector<FarIdentification>();
- for (int index = 0; index < fdb.getFarList().getFilenameList().size(); index++) {
- DbPathAndFilename item = fdb.getFarList().getFilenameList().get(index);
- FarIdentification far = new FarIdentification(item.getFarGuid(), item.getMd5Sum(), item.getStringValue());
- v.addElement(far);
- }
- return v;
- }
-
+ openFrameworkDb();
+ Vector<FarIdentification> v = new Vector<FarIdentification>();
+ for (int index = 0; index < fdb.getFarList().getFilenameList().size(); index++) {
+ DbPathAndFilename item = fdb.getFarList().getFilenameList().get(index);
+ FarIdentification far = new FarIdentification(item.getFarGuid(), item.getMd5Sum(), item.getStringValue());
+ v.addElement(far);
+ }
+ return v;
+ }
+
public Vector<PackageIdentification> getPackagesByFar(FarIdentification far) {
- Identification id = null;
- openFrameworkDb();
- Vector<PackageIdentification> v = new Vector<PackageIdentification>();
-
- for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) {
- DbPathAndFilename item = fdb.getPackageList().getFilenameArray(index);
- String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR
- + item.getStringValue();
- path = Tools.convertPathToCurrentOsType(path);
-
- if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
-
- try {
- id = getId(path, OpenFile.openSpdFile(path));
- v.addElement(new PackageIdentification(id));
- } catch (IOException e) {
- Log.err("Open Package Surface Area " + path, e.getMessage());
- e.printStackTrace();
- } catch (XmlException e) {
- Log.err("Open Package Surface Area " + path, e.getMessage());
- e.printStackTrace();
- } catch (Exception e) {
- Log.err("Open Package Surface Area " + path, "Invalid file type");
- e.printStackTrace();
- }
+ Identification id = null;
+ openFrameworkDb();
+ Vector<PackageIdentification> v = new Vector<PackageIdentification>();
+
+ for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) {
+ DbPathAndFilename item = fdb.getPackageList().getFilenameArray(index);
+ String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();
+ path = Tools.convertPathToCurrentOsType(path);
+
+ if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
+
+ try {
+ id = getId(path, OpenFile.openSpdFile(path));
+ v.addElement(new PackageIdentification(id));
+ } catch (IOException e) {
+ Log.err("Open Package Surface Area " + path, e.getMessage());
+ e.printStackTrace();
+ } catch (XmlException e) {
+ Log.err("Open Package Surface Area " + path, e.getMessage());
+ e.printStackTrace();
+ } catch (Exception e) {
+ Log.err("Open Package Surface Area " + path, "Invalid file type");
+ e.printStackTrace();
+ }
+ }
}
- }
- return v;
+ return v;
}
-
+
public Vector<PlatformIdentification> getPlatformsByFar(FarIdentification far) {
- Identification id = null;
- openFrameworkDb();
- Vector<PlatformIdentification> v = new Vector<PlatformIdentification>();
-
- for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) {
- DbPathAndFilename item = fdb.getPlatformList().getFilenameArray(index);
- String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR
- + item.getStringValue();
- path = Tools.convertPathToCurrentOsType(path);
-
- if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
- try {
- id = getId(path, OpenFile.openFpdFile(path));
- v.addElement(new PlatformIdentification(id));
- } catch (IOException e) {
- Log.err("Open Platform Surface Area " + path, e.getMessage());
- e.printStackTrace();
- } catch (XmlException e) {
- Log.err("Open Platform Surface Area " + path, e.getMessage());
- e.printStackTrace();
- } catch (Exception e) {
- Log.err("Open Platform Surface Area " + path, "Invalid file type");
- e.printStackTrace();
- }
+ Identification id = null;
+ openFrameworkDb();
+ Vector<PlatformIdentification> v = new Vector<PlatformIdentification>();
+
+ for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) {
+ DbPathAndFilename item = fdb.getPlatformList().getFilenameArray(index);
+ String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();
+ path = Tools.convertPathToCurrentOsType(path);
+
+ if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
+ try {
+ id = getId(path, OpenFile.openFpdFile(path));
+ v.addElement(new PlatformIdentification(id));
+ } catch (IOException e) {
+ Log.err("Open Platform Surface Area " + path, e.getMessage());
+ e.printStackTrace();
+ } catch (XmlException e) {
+ Log.err("Open Platform Surface Area " + path, e.getMessage());
+ e.printStackTrace();
+ } catch (Exception e) {
+ Log.err("Open Platform Surface Area " + path, "Invalid file type");
+ e.printStackTrace();
+ }
+ }
}
- }
- return v;
+ return v;
}
/**
Get all module basic information from a package
-
+
@param id Package id
@return A vector includes all modules' basic information
-
- **/
+
+ **/
public Vector<ModuleIdentification> getAllModules(PackageIdentification pid) {
Vector<ModuleIdentification> v = new Vector<ModuleIdentification>();
Vector<String> modulePaths = this.getAllModulesOfPackage(pid.getPath());
Identification id = null;
String modulePath = null;
-
+
for (int index = 0; index < modulePaths.size(); index++) {
try {
modulePath = modulePaths.get(index);
@@ -392,7 +385,7 @@ public class WorkspaceTools {
}
Tools.sortModules(v, DataType.SORT_TYPE_ASCENDING);
return v;
-
+
}
/**
@@ -418,7 +411,7 @@ public class WorkspaceTools {
for (int indexI = 0; indexI < vPackageList.size(); indexI++) {
packagePath = vPackageList.elementAt(indexI).getPath();
modulePaths = this.getAllModulesOfPackage(packagePath);
-
+
for (int indexJ = 0; indexJ < modulePaths.size(); indexJ++) {
try {
modulePath = modulePaths.get(indexJ);
@@ -723,7 +716,7 @@ public class WorkspaceTools {
} catch (IOException e) {
} catch (XmlException e) {
-
+
} catch (Exception e) {
}
@@ -877,7 +870,7 @@ public class WorkspaceTools {
// First add package
//
v.addElement(path);
-
+
//
// Add the package's industry std includes one by one
//
@@ -886,7 +879,7 @@ public class WorkspaceTools {
for (int index = 0; index < f1.size(); index++) {
v.addElement(f1.get(index));
}
-
+
//
// Add module's files one by one
//