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
This commit is contained in:
hche10x 2006-07-13 08:51:27 +00:00
parent aab6a96a70
commit 55a2762d8c
13 changed files with 426 additions and 451 deletions

View File

@ -121,7 +121,7 @@ public class Clone extends IDialog {
private JTextField getJTextFieldType() { private JTextField getJTextFieldType() {
if (jTextFieldType == null) { if (jTextFieldType == null) {
jTextFieldType = new JTextField(); 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); jTextFieldType.setEditable(false);
} }
return jTextFieldType; return jTextFieldType;
@ -135,7 +135,7 @@ public class Clone extends IDialog {
private JTextField getJTextFieldSource() { private JTextField getJTextFieldSource() {
if (jTextFieldSource == null) { if (jTextFieldSource == null) {
jTextFieldSource = new JTextField(); 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); jTextFieldSource.setEditable(false);
} }
return jTextFieldSource; return jTextFieldSource;
@ -149,7 +149,7 @@ public class Clone extends IDialog {
private JButton getJButtonBrowse() { private JButton getJButtonBrowse() {
if (jButtonBrowse == null) { if (jButtonBrowse == null) {
jButtonBrowse = new JButton(); 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.setText("Browse");
jButtonBrowse.addActionListener(this); jButtonBrowse.addActionListener(this);
} }
@ -164,7 +164,7 @@ public class Clone extends IDialog {
private JTextField getJTextFieldFilePath() { private JTextField getJTextFieldFilePath() {
if (jTextFieldFilePath == null) { if (jTextFieldFilePath == null) {
jTextFieldFilePath = new JTextField(); 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; return jTextFieldFilePath;
} }
@ -177,7 +177,7 @@ public class Clone extends IDialog {
private JTextField getJTextFieldBaseName() { private JTextField getJTextFieldBaseName() {
if (jTextFieldBaseName == null) { if (jTextFieldBaseName == null) {
jTextFieldBaseName = new JTextField(); 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; return jTextFieldBaseName;
} }
@ -190,7 +190,7 @@ public class Clone extends IDialog {
private JTextField getJTextFieldGuid() { private JTextField getJTextFieldGuid() {
if (jTextFieldGuid == null) { if (jTextFieldGuid == null) {
jTextFieldGuid = new JTextField(); 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; return jTextFieldGuid;
} }
@ -203,7 +203,7 @@ public class Clone extends IDialog {
private JTextField getJTextFieldVersion() { private JTextField getJTextFieldVersion() {
if (jTextFieldVersion == null) { if (jTextFieldVersion == null) {
jTextFieldVersion = new JTextField(); 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; return jTextFieldVersion;
} }
@ -216,7 +216,7 @@ public class Clone extends IDialog {
private JButton getJButtonOk() { private JButton getJButtonOk() {
if (jButtonOk == null) { if (jButtonOk == null) {
jButtonOk = new JButton(); 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.setText("Ok");
jButtonOk.addActionListener(this); jButtonOk.addActionListener(this);
} }
@ -231,7 +231,7 @@ public class Clone extends IDialog {
private JButton getJButtonCancel() { private JButton getJButtonCancel() {
if (jButtonCancel == null) { if (jButtonCancel == null) {
jButtonCancel = new JButton(); 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.setText("Cancel");
jButtonCancel.addActionListener(this); jButtonCancel.addActionListener(this);
} }
@ -246,7 +246,7 @@ public class Clone extends IDialog {
private JButton getJButtonGenerateGuid() { private JButton getJButtonGenerateGuid() {
if (jButtonGenerateGuid == null) { if (jButtonGenerateGuid == null) {
jButtonGenerateGuid = new JButton(); 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.setText("Gen");
jButtonGenerateGuid.addActionListener(this); jButtonGenerateGuid.addActionListener(this);
} }
@ -261,7 +261,7 @@ public class Clone extends IDialog {
private JComboBox getJComboBoxExistingPackage() { private JComboBox getJComboBoxExistingPackage() {
if (jComboBoxExistingPackage == null) { if (jComboBoxExistingPackage == null) {
jComboBoxExistingPackage = new JComboBox(); 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; return jComboBoxExistingPackage;
} }
@ -316,7 +316,7 @@ public class Clone extends IDialog {
* @return void * @return void
*/ */
private void init() { private void init() {
this.setSize(493, 260); this.setSize(550, 260);
this.setContentPane(getJContentPane()); this.setContentPane(getJContentPane());
this.setTitle("Clone"); this.setTitle("Clone");
this.centerWindow(); this.centerWindow();
@ -331,20 +331,26 @@ public class Clone extends IDialog {
init(); init();
if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) { if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
this.jTextFieldType.setText(DataType.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(); initExistingPackage();
this.jButtonBrowse.setEnabled(false); this.jButtonBrowse.setVisible(false);
this.jTextFieldFilePath.setToolTipText("Input module name here. For example, Application\\HelloWorld\\HelloWorld.msa"); 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) { if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
this.jTextFieldType.setText(DataType.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.jLabelBelong.setEnabled(false);
this.jComboBoxExistingPackage.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.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) { if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
this.jTextFieldType.setText(DataType.PLATFORM_SURFACE_AREA); this.jTextFieldType.setText(DataType.PLATFORM_SURFACE_AREA);
@ -352,7 +358,7 @@ public class Clone extends IDialog {
this.jLabelBelong.setEnabled(false); this.jLabelBelong.setEnabled(false);
this.jComboBoxExistingPackage.setEnabled(false); this.jComboBoxExistingPackage.setEnabled(false);
this.jTextFieldFilePath.setToolTipText("Select platform path here. For example, C:\\MyWorkspace\\EdkNt32Pkg\\Nt32.fpd"); 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) { if (mode == DataType.RETURN_TYPE_WORKSPACE) {
this.jTextFieldType.setText(DataType.WORKSPACE); this.jTextFieldType.setText(DataType.WORKSPACE);
@ -367,7 +373,7 @@ public class Clone extends IDialog {
this.jLabelVersion.setEnabled(false); this.jLabelVersion.setEnabled(false);
this.jTextFieldVersion.setEnabled(false); this.jTextFieldVersion.setEnabled(false);
this.jTextFieldFilePath.setToolTipText("Input workspace path here. For example, C:\\MyWorkspace"); 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() { private JPanel getJContentPane() {
if (jContentPane == null) { if (jContentPane == null) {
jLabelBelong = new JLabel(); 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"); jLabelBelong.setText("Clone to Package");
jLabelVersion = new JLabel(); 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"); jLabelVersion.setText("Version");
jLabelGuid = new JLabel(); 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"); jLabelGuid.setText("Guid");
jLabelBaseName = new JLabel(); 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"); jLabelBaseName.setText("Base Name");
jLabelDestinationFile = new JLabel(); 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"); jLabelDestinationFile.setText("Destination File Name");
jLabelSource = new JLabel(); 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"); jLabelSource.setText("Source");
jLabelType = new JLabel(); 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"); jLabelType.setText("Type");
jContentPane = new JPanel(); jContentPane = new JPanel();
jContentPane.setLayout(null); 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(jLabelType, null);
jContentPane.add(getJTextFieldType(), null); jContentPane.add(getJTextFieldType(), null);
jContentPane.add(jLabelSource, null); jContentPane.add(jLabelSource, null);
@ -551,7 +557,7 @@ public class Clone extends IDialog {
**/ **/
private boolean check() { private boolean check() {
String src = this.jTextFieldSource.getText(); String src = this.oldId.getPath();
String trg = this.jTextFieldFilePath.getText(); String trg = this.jTextFieldFilePath.getText();
File srcFile = new File(src); File srcFile = new File(src);
File trgFile = new File(trg); File trgFile = new File(trg);
@ -648,7 +654,7 @@ public class Clone extends IDialog {
} }
private void save() throws IOException, XmlException, Exception { private void save() throws IOException, XmlException, Exception {
String src = this.jTextFieldSource.getText(); String src = this.oldId.getPath();
String trg = this.jTextFieldFilePath.getText(); String trg = this.jTextFieldFilePath.getText();
Vector<String> vFiles = new Vector<String>(); Vector<String> vFiles = new Vector<String>();
@ -898,6 +904,10 @@ public class Clone extends IDialog {
c.setPackageGuid(wt.getPackageIdByModuleId(oldId).getGuid()); c.setPackageGuid(wt.getPackageIdByModuleId(oldId).getGuid());
c.setPackageVersion(wt.getPackageIdByModuleId(oldId).getVersion()); c.setPackageVersion(wt.getPackageIdByModuleId(oldId).getVersion());
c.setId(count.add(new BigInteger("1"))); c.setId(count.add(new BigInteger("1")));
String guid = wt.getModuleFarGuid(oldId);
if (guid != null && !guid.equals("")) {
c.setFarGuid(guid);
}
cf.addNewCloned(); cf.addNewCloned();
cf.setClonedArray(cf.getClonedList().size() - 1, c); cf.setClonedArray(cf.getClonedList().size() - 1, c);
@ -950,6 +960,10 @@ public class Clone extends IDialog {
c.setPackageGuid(id.getGuid()); c.setPackageGuid(id.getGuid());
c.setPackageVersion(id.getVersion()); c.setPackageVersion(id.getVersion());
c.setId(count.add(new BigInteger("1"))); c.setId(count.add(new BigInteger("1")));
String guid = wt.getModuleFarGuid(oldId);
if (guid != null && !guid.equals("")) {
c.setFarGuid(guid);
}
cf.addNewCloned(); cf.addNewCloned();
cf.setClonedArray(cf.getClonedList().size() - 1, c); cf.setClonedArray(cf.getClonedList().size() - 1, c);
@ -1002,6 +1016,10 @@ public class Clone extends IDialog {
c.setPlatformGuid(id.getGuid()); c.setPlatformGuid(id.getGuid());
c.setPlatformVersion(id.getVersion()); c.setPlatformVersion(id.getVersion());
c.setId(count.add(new BigInteger("1"))); c.setId(count.add(new BigInteger("1")));
String guid = wt.getModuleFarGuid(oldId);
if (guid != null && !guid.equals("")) {
c.setFarGuid(guid);
}
cf.addNewCloned(); cf.addNewCloned();
cf.setClonedArray(cf.getClonedList().size() - 1, c); cf.setClonedArray(cf.getClonedList().size() - 1, c);

View File

@ -1793,7 +1793,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
CreateStepOne cso = new CreateStepOne(this, true); CreateStepOne cso = new CreateStepOne(this, true);
int result = cso.showDialog(); int result = cso.showDialog();
if (result == DataType.RETURN_TYPE_OK) { 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(); cso.dispose();
} }
@ -1802,6 +1803,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
InstallStepOne iso = new InstallStepOne(this, true); InstallStepOne iso = new InstallStepOne(this, true);
int result = iso.showDialog(); int result = iso.showDialog();
if (result == DataType.RETURN_TYPE_OK) { 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(); this.closeAll();
} }
iso.dispose(); iso.dispose();
@ -1811,6 +1814,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
DeleteStepOne dso = new DeleteStepOne(this, true); DeleteStepOne dso = new DeleteStepOne(this, true);
int result = dso.showDialog(); int result = dso.showDialog();
if (result == DataType.RETURN_TYPE_OK) { 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(); this.closeAll();
} }
dso.dispose(); dso.dispose();
@ -1820,6 +1825,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
UpdateStepOne uso = new UpdateStepOne(this, true); UpdateStepOne uso = new UpdateStepOne(this, true);
int result = uso.showDialog(); int result = uso.showDialog();
if (result == DataType.RETURN_TYPE_OK) { 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(); this.closeAll();
} }
uso.dispose(); uso.dispose();
@ -2040,6 +2047,76 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
return fc.showSaveDialog(new JPanel()); return fc.showSaveDialog(new JPanel());
} }
/**
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 Open Module
@ -2081,69 +2158,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
if (!isFind) { if (!isFind) {
ModuleIdentification mid = new ModuleIdentification(id, pid, moduleId.isLibrary()); ModuleIdentification mid = new ModuleIdentification(id, pid, moduleId.isLibrary());
vModuleList.addElement(mid); vModuleList.addElement(mid);
// addModuleToTree(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 { } else {
// //
@ -2222,69 +2237,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
if (!isFind) { if (!isFind) {
ModuleIdentification mid = new ModuleIdentification(id, pid); ModuleIdentification mid = new ModuleIdentification(id, pid);
vModuleList.addElement(mid); vModuleList.addElement(mid);
// addModuleToTree(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 { } else {
// //
@ -3248,13 +3201,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
if (result == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) { if (result == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
Tools.showInformationMessage("Module Surface Area Clone Finished"); Tools.showInformationMessage("Module Surface Area Clone Finished");
vModuleList.addElement(c.getMid()); vModuleList.addElement(c.getMid());
// addModuleToTree(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);
} }
if (result == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) { if (result == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
Tools.showInformationMessage("Package Surface Area Clone Finished"); Tools.showInformationMessage("Package Surface Area Clone Finished");
@ -3327,7 +3274,10 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
} else { } else {
int category = iTree.getSelectCategory(); int category = iTree.getSelectCategory();
if (category == IDefaultMutableTreeNode.MODULE || category == IDefaultMutableTreeNode.PACKAGE 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); jMenuItemToolsClone.setEnabled(false);
} else { } else {
jMenuItemToolsClone.setEnabled(true); jMenuItemToolsClone.setEnabled(true);

View File

@ -35,6 +35,7 @@ import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel; import javax.swing.table.TableModel;
import org.tianocore.frameworkwizard.common.DataType; import org.tianocore.frameworkwizard.common.DataType;
import org.tianocore.frameworkwizard.common.IFileFilter;
import org.tianocore.frameworkwizard.common.Log; import org.tianocore.frameworkwizard.common.Log;
import org.tianocore.frameworkwizard.common.Tools; import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.Identifications.ToolChainConfigId; import org.tianocore.frameworkwizard.common.Identifications.ToolChainConfigId;
@ -348,7 +349,9 @@ public class ToolChainConfig extends IFrame implements ListSelectionListener, Ta
if (arg0.getSource() == jButtonOpen) { if (arg0.getSource() == jButtonOpen) {
JFileChooser fc = new JFileChooser(); 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)); fc.setCurrentDirectory(new File(toolsDir));
int result = fc.showOpenDialog(new JPanel()); int result = fc.showOpenDialog(new JPanel());
@ -369,8 +372,10 @@ public class ToolChainConfig extends IFrame implements ListSelectionListener, Ta
if (arg0.getSource() == jButtonSave) { if (arg0.getSource() == jButtonSave) {
JFileChooser fc = new JFileChooser(); JFileChooser fc = new JFileChooser();
fc.setAcceptAllFileFilterUsed(true); fc.setAcceptAllFileFilterUsed(false);
fc.setSelectedFile(new File(currentFile)); IFileFilter iff = new IFileFilter(DataType.TEXT_FILE_EXT);
fc.addChoosableFileFilter(iff);
fc.setCurrentDirectory(new File(toolsDir));
int result = fc.showSaveDialog(new JPanel()); int result = fc.showSaveDialog(new JPanel());
if (result == JFileChooser.APPROVE_OPTION) { if (result == JFileChooser.APPROVE_OPTION) {

View File

@ -210,7 +210,7 @@ public class DataType {
// First defined here // First defined here
// Will be replaced by resource file later // 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 // Project name and version

View File

@ -307,6 +307,7 @@ public class EnumerationData {
vModuleType.addElement("UEFI_DRIVER"); vModuleType.addElement("UEFI_DRIVER");
vModuleType.addElement("UEFI_APPLICATION"); vModuleType.addElement("UEFI_APPLICATION");
vModuleType.addElement("USER_DEFINED"); vModuleType.addElement("USER_DEFINED");
Tools.sortVectorString(vModuleType, DataType.SORT_TYPE_ASCENDING);
} }
// private void initComponentType() { // private void initComponentType() {
@ -362,6 +363,7 @@ public class EnumerationData {
vFrameworkModuleTypes.addElement("UEFI_DRIVER"); vFrameworkModuleTypes.addElement("UEFI_DRIVER");
vFrameworkModuleTypes.addElement("UEFI_APPLICATION"); vFrameworkModuleTypes.addElement("UEFI_APPLICATION");
vFrameworkModuleTypes.addElement("USER_DEFINED"); vFrameworkModuleTypes.addElement("USER_DEFINED");
Tools.sortVectorString(vFrameworkModuleTypes, DataType.SORT_TYPE_ASCENDING);
} }
private void initLibClassDef() { private void initLibClassDef() {

View File

@ -20,6 +20,8 @@ import java.util.Vector;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JCheckBox; import javax.swing.JCheckBox;
import org.tianocore.frameworkwizard.common.DataType;
public class ArchCheckBox extends JPanel { public class ArchCheckBox extends JPanel {
/// ///
@ -49,6 +51,7 @@ public class ArchCheckBox extends JPanel {
jCheckBoxIa32 = new JCheckBox(); jCheckBoxIa32 = new JCheckBox();
jCheckBoxIa32.setBounds(new java.awt.Rectangle(0, 0, 50, 20)); jCheckBoxIa32.setBounds(new java.awt.Rectangle(0, 0, 50, 20));
jCheckBoxIa32.setText("IA32"); jCheckBoxIa32.setText("IA32");
jCheckBoxIa32.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
} }
return jCheckBoxIa32; return jCheckBoxIa32;
} }
@ -63,6 +66,7 @@ public class ArchCheckBox extends JPanel {
jCheckBoxX64 = new JCheckBox(); jCheckBoxX64 = new JCheckBox();
jCheckBoxX64.setBounds(new java.awt.Rectangle(50, 0, 50, 20)); jCheckBoxX64.setBounds(new java.awt.Rectangle(50, 0, 50, 20));
jCheckBoxX64.setText("X64"); jCheckBoxX64.setText("X64");
jCheckBoxX64.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
} }
return jCheckBoxX64; return jCheckBoxX64;
} }
@ -77,6 +81,7 @@ public class ArchCheckBox extends JPanel {
jCheckBoxIpf = new JCheckBox(); jCheckBoxIpf = new JCheckBox();
jCheckBoxIpf.setBounds(new java.awt.Rectangle(100, 0, 50, 20)); jCheckBoxIpf.setBounds(new java.awt.Rectangle(100, 0, 50, 20));
jCheckBoxIpf.setText("IPF"); jCheckBoxIpf.setText("IPF");
jCheckBoxIpf.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
} }
return jCheckBoxIpf; return jCheckBoxIpf;
} }
@ -91,6 +96,7 @@ public class ArchCheckBox extends JPanel {
jCheckBoxEbc = new JCheckBox(); jCheckBoxEbc = new JCheckBox();
jCheckBoxEbc.setBounds(new java.awt.Rectangle(150, 0, 50, 20)); jCheckBoxEbc.setBounds(new java.awt.Rectangle(150, 0, 50, 20));
jCheckBoxEbc.setText("EBC"); jCheckBoxEbc.setText("EBC");
jCheckBoxEbc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
} }
return jCheckBoxEbc; return jCheckBoxEbc;
} }
@ -105,6 +111,7 @@ public class ArchCheckBox extends JPanel {
jCheckBoxArm = new JCheckBox(); jCheckBoxArm = new JCheckBox();
jCheckBoxArm.setBounds(new java.awt.Rectangle(200, 0, 55, 20)); jCheckBoxArm.setBounds(new java.awt.Rectangle(200, 0, 55, 20));
jCheckBoxArm.setText("ARM"); jCheckBoxArm.setText("ARM");
jCheckBoxArm.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
} }
return jCheckBoxArm; return jCheckBoxArm;
} }
@ -119,6 +126,7 @@ public class ArchCheckBox extends JPanel {
jCheckBoxPpc = new JCheckBox(); jCheckBoxPpc = new JCheckBox();
jCheckBoxPpc.setBounds(new java.awt.Rectangle(255, 0, 50, 20)); jCheckBoxPpc.setBounds(new java.awt.Rectangle(255, 0, 50, 20));
jCheckBoxPpc.setText("PPC"); jCheckBoxPpc.setText("PPC");
jCheckBoxPpc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
} }
return jCheckBoxPpc; return jCheckBoxPpc;
} }
@ -155,6 +163,7 @@ public class ArchCheckBox extends JPanel {
this.add(getJCheckBoxEbc(), null); this.add(getJCheckBoxEbc(), null);
this.add(getJCheckBoxArm(), null); this.add(getJCheckBoxArm(), null);
this.add(getJCheckBoxPpc(), null); this.add(getJCheckBoxPpc(), null);
this.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
} }
public Vector<String> getSelectedItemsVector() { public Vector<String> getSelectedItemsVector() {

View File

@ -344,7 +344,7 @@ public class ModuleSourceFiles extends IInternalFrame {
} }
private void showEdit(int index) { 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(); int result = sfd.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -254,12 +254,6 @@ public class MsaHeader extends IInternalFrame {
jTextFieldSpecification.setLocation(new java.awt.Point(160, 435)); jTextFieldSpecification.setLocation(new java.awt.Point(160, 435));
jTextFieldSpecification.setEditable(false); jTextFieldSpecification.setEditable(false);
jTextFieldSpecification.addFocusListener(this); 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; return jTextFieldSpecification;
} }
@ -800,6 +794,7 @@ public class MsaHeader extends IInternalFrame {
// } // }
// this.msaHeader.setSpecification(this.jTextFieldSpecification.getText()); // this.msaHeader.setSpecification(this.jTextFieldSpecification.getText());
msaHeader.setSpecification(this.jTextFieldSpecification.getText());
msa.setMsaHeader(msaHeader); msa.setMsaHeader(msaHeader);
this.omt.setSaved(false); this.omt.setSaved(false);
} catch (Exception e) { } catch (Exception e) {

View File

@ -15,6 +15,7 @@
package org.tianocore.frameworkwizard.module.ui.dialog; package org.tianocore.frameworkwizard.module.ui.dialog;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.io.File;
import java.util.Vector; import java.util.Vector;
import javax.swing.JButton; import javax.swing.JButton;
@ -27,12 +28,12 @@ import javax.swing.JTextField;
import org.tianocore.frameworkwizard.common.DataType; import org.tianocore.frameworkwizard.common.DataType;
import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.DataValidation;
import org.tianocore.frameworkwizard.common.Log; 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.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.SourceFiles.SourceFilesIdentification; 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 The class is used to create, update SourceFile of MSA/MBD file
@ -83,14 +84,16 @@ public class SourceFilesDlg extends IDialog {
private ArchCheckBox jArchCheckBox = null; private ArchCheckBox jArchCheckBox = null;
private JButton jButtonOk = null;
private JButton jButtonCancel = null;
// //
// Not used by UI // Not used by UI
// //
private SourceFilesIdentification sfid = null; private SourceFilesIdentification sfid = null;
private JButton jButtonOk = null; private String msaFileName = "";
private JButton jButtonCancel = null;
/** /**
This method initializes jTextFieldFileName This method initializes jTextFieldFileName
@ -238,9 +241,9 @@ public class SourceFilesDlg extends IDialog {
This is the default constructor This is the default constructor
**/ **/
public SourceFilesDlg(SourceFilesIdentification inSourceFilesIdentification, IFrame iFrame) { public SourceFilesDlg(SourceFilesIdentification inSourceFilesIdentification, IFrame iFrame, String fileName) {
super(iFrame, true); 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 @param inSourceFiles The input data of SourceFilesDocument.SourceFiles
**/ **/
private void init(SourceFilesIdentification inSourceFilesIdentifications) { private void init(SourceFilesIdentification inSourceFilesIdentifications, String fileName) {
init(); init();
this.sfid = inSourceFilesIdentifications; this.sfid = inSourceFilesIdentifications;
this.msaFileName = fileName;
if (this.sfid != null) { if (this.sfid != null) {
this.jTextFieldFileName.setText(sfid.getFilename()); this.jTextFieldFileName.setText(sfid.getFilename());
@ -451,8 +455,8 @@ public class SourceFilesDlg extends IDialog {
**/ **/
private void selectFile() { 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()); int result = fc.showOpenDialog(new JPanel());
if (result == JFileChooser.APPROVE_OPTION) { if (result == JFileChooser.APPROVE_OPTION) {
this.jTextFieldFileName.setText(fc.getSelectedFile().getName()); this.jTextFieldFileName.setText(fc.getSelectedFile().getName());

View File

@ -24,7 +24,6 @@ import org.tianocore.frameworkwizard.workspace.Workspace;
public class PlatformIdentification extends Identification{ public class PlatformIdentification extends Identification{
public PlatformIdentification(String name, String guid, String version, String path){ public PlatformIdentification(String name, String guid, String version, String path){
super(name, guid, version, path); super(name, guid, version, path);
} }

View File

@ -103,13 +103,11 @@ public class WorkspaceTools {
try { try {
SaveFile.saveDbFile(strFrameworkDbFilePath, fdb); SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);
} } catch (Exception e) {
catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
public void removeFarFromDb(FarIdentification far) { public void removeFarFromDb(FarIdentification far) {
FrameworkDatabase fdb = openFrameworkDb(); FrameworkDatabase fdb = openFrameworkDb();
// //
@ -118,7 +116,7 @@ public class WorkspaceTools {
XmlCursor cursor = fdb.getPackageList().newCursor(); XmlCursor cursor = fdb.getPackageList().newCursor();
cursor.toFirstChild(); cursor.toFirstChild();
do { do {
DbPathAndFilename item = (DbPathAndFilename)cursor.getObject(); DbPathAndFilename item = (DbPathAndFilename) cursor.getObject();
if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) { if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
cursor.removeXml(); cursor.removeXml();
@ -132,7 +130,7 @@ public class WorkspaceTools {
cursor = fdb.getPlatformList().newCursor(); cursor = fdb.getPlatformList().newCursor();
cursor.toFirstChild(); cursor.toFirstChild();
do { do {
DbPathAndFilename item = (DbPathAndFilename)cursor.getObject(); DbPathAndFilename item = (DbPathAndFilename) cursor.getObject();
if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) { if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
cursor.removeXml(); cursor.removeXml();
} }
@ -144,7 +142,7 @@ public class WorkspaceTools {
cursor = fdb.getFarList().newCursor(); cursor = fdb.getFarList().newCursor();
cursor.toFirstChild(); cursor.toFirstChild();
do { do {
DbPathAndFilename item = (DbPathAndFilename)cursor.getObject(); DbPathAndFilename item = (DbPathAndFilename) cursor.getObject();
if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) { if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
cursor.removeXml(); cursor.removeXml();
} }
@ -155,21 +153,19 @@ public class WorkspaceTools {
strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath); strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);
try { try {
SaveFile.saveDbFile(strFrameworkDbFilePath, fdb); SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);
} } catch (Exception e) {
catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
public String getPackageFarGuid(PackageIdentification packageId) { public String getPackageFarGuid(Identification packageId) {
openFrameworkDb(); openFrameworkDb();
for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) { for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) {
DbPathAndFilename item = fdb.getPackageList().getFilenameArray(index); DbPathAndFilename item = fdb.getPackageList().getFilenameArray(index);
String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();
+ item.getStringValue();
File tempFile = new File(path); File tempFile = new File(path);
if (tempFile.getPath().equalsIgnoreCase(packageId.getSpdFile().getPath())) { if (tempFile.getPath().equalsIgnoreCase(packageId.getPath())) {
return fdb.getPackageList().getFilenameArray(index).getFarGuid(); return fdb.getPackageList().getFilenameArray(index).getFarGuid();
} }
} }
@ -177,15 +173,14 @@ public class WorkspaceTools {
return null; return null;
} }
public String getPlatformFarGuid(PlatformIdentification platformId) { public String getPlatformFarGuid(Identification platformId) {
openFrameworkDb(); openFrameworkDb();
for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) { for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) {
DbPathAndFilename item = fdb.getPlatformList().getFilenameArray(index); DbPathAndFilename item = fdb.getPlatformList().getFilenameArray(index);
String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();
+ item.getStringValue();
File tempFile = new File(path); File tempFile = new File(path);
if (tempFile.getPath().equalsIgnoreCase(platformId.getFpdFile().getPath())) { if (tempFile.getPath().equalsIgnoreCase(platformId.getPath())) {
return fdb.getPlatformList().getFilenameArray(index).getFarGuid(); return fdb.getPlatformList().getFilenameArray(index).getFarGuid();
} }
} }
@ -193,15 +188,15 @@ public class WorkspaceTools {
return null; return null;
} }
public String getModuleFarGuid(ModuleIdentification moduleId) { public String getModuleFarGuid(Identification moduleId) {
PackageIdentification packageId = getPackageIdByModuleId(moduleId); PackageIdentification packageId = getPackageIdByModuleId(moduleId);
if (packageId != null) { if (packageId != null) {
return getPackageFarGuid(packageId); return getPackageFarGuid(packageId);
} } else {
else {
return null; return null;
} }
} }
/** /**
Get all modules' paths from one package Get all modules' paths from one package
@ -242,7 +237,7 @@ public class WorkspaceTools {
IndustryStdIncludes files = OpenFile.openSpdFile(path).getIndustryStdIncludes(); IndustryStdIncludes files = OpenFile.openSpdFile(path).getIndustryStdIncludes();
if (files != null) { if (files != null) {
for (int index = 0; index < files.getIndustryStdHeaderList().size(); index++) { for (int index = 0; index < files.getIndustryStdHeaderList().size(); index++) {
String temp = files.getIndustryStdHeaderList().get(index).getName(); String temp = files.getIndustryStdHeaderList().get(index).getIncludeHeader();
temp = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + temp; temp = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + temp;
temp = Tools.convertPathToCurrentOsType(temp); temp = Tools.convertPathToCurrentOsType(temp);
includePath.addElement(temp); includePath.addElement(temp);
@ -310,8 +305,7 @@ public class WorkspaceTools {
for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) { for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) {
DbPathAndFilename item = fdb.getPackageList().getFilenameArray(index); DbPathAndFilename item = fdb.getPackageList().getFilenameArray(index);
String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();
+ item.getStringValue();
path = Tools.convertPathToCurrentOsType(path); path = Tools.convertPathToCurrentOsType(path);
if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) { if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
@ -341,8 +335,7 @@ public class WorkspaceTools {
for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) { for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) {
DbPathAndFilename item = fdb.getPlatformList().getFilenameArray(index); DbPathAndFilename item = fdb.getPlatformList().getFilenameArray(index);
String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();
+ item.getStringValue();
path = Tools.convertPathToCurrentOsType(path); path = Tools.convertPathToCurrentOsType(path);
if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) { if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {