mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-22 21:24:35 +02:00
1. Restructure module description on main UI
2. Make alphabetized list for all module, package, platform names and guid_c_names git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@875 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
73b4e31adc
commit
92e2937805
@ -282,11 +282,11 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
|
|
||||||
private JMenuItem jMenuItemHelpSearch = null;
|
private JMenuItem jMenuItemHelpSearch = null;
|
||||||
|
|
||||||
private JMenuItem jMenuItemProjectInstallPackage = null;
|
private JMenuItem jMenuItemProjectInstallFar = null;
|
||||||
|
|
||||||
private JMenuItem jMenuItemProjectUpdatePackage = null;
|
private JMenuItem jMenuItemProjectUpdateFar = null;
|
||||||
|
|
||||||
private JMenuItem jMenuItemProjectRemovePackage = null;
|
private JMenuItem jMenuItemProjectRemoveFar = null;
|
||||||
|
|
||||||
//private JToolBar jToolBarFile = null;
|
//private JToolBar jToolBarFile = null;
|
||||||
|
|
||||||
@ -296,6 +296,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
|
|
||||||
private static FrameworkWizardUI fwui = null;
|
private static FrameworkWizardUI fwui = null;
|
||||||
|
|
||||||
|
private JMenuItem jMenuItemProjectCreateFar = null;
|
||||||
|
|
||||||
public static FrameworkWizardUI getInstance() {
|
public static FrameworkWizardUI getInstance() {
|
||||||
if (fwui == null) {
|
if (fwui == null) {
|
||||||
fwui = new FrameworkWizardUI();
|
fwui = new FrameworkWizardUI();
|
||||||
@ -1262,9 +1264,10 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
//jMenuProject.addSeparator();
|
//jMenuProject.addSeparator();
|
||||||
jMenuProject.add(getJMenuItemProjectChangeWorkspace());
|
jMenuProject.add(getJMenuItemProjectChangeWorkspace());
|
||||||
jMenuProject.addSeparator();
|
jMenuProject.addSeparator();
|
||||||
jMenuProject.add(getJMenuItemProjectInstallPackage());
|
jMenuProject.add(getJMenuItemProjectCreateFar());
|
||||||
jMenuProject.add(getJMenuItemProjectUpdatePackage());
|
jMenuProject.add(getJMenuItemProjectInstallFar());
|
||||||
jMenuProject.add(getJMenuItemProjectRemovePackage());
|
jMenuProject.add(getJMenuItemProjectUpdateFar());
|
||||||
|
jMenuProject.add(getJMenuItemProjectRemoveFar());
|
||||||
//jMenuProject.addSeparator();
|
//jMenuProject.addSeparator();
|
||||||
jMenuProject.add(getJMenuProjectBuildTargets());
|
jMenuProject.add(getJMenuProjectBuildTargets());
|
||||||
}
|
}
|
||||||
@ -1607,15 +1610,15 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
*
|
*
|
||||||
* @return javax.swing.JMenuItem
|
* @return javax.swing.JMenuItem
|
||||||
*/
|
*/
|
||||||
private JMenuItem getJMenuItemProjectInstallPackage() {
|
private JMenuItem getJMenuItemProjectInstallFar() {
|
||||||
if (jMenuItemProjectInstallPackage == null) {
|
if (jMenuItemProjectInstallFar == null) {
|
||||||
jMenuItemProjectInstallPackage = new JMenuItem();
|
jMenuItemProjectInstallFar = new JMenuItem();
|
||||||
jMenuItemProjectInstallPackage.setText("Install Distribution Package");
|
jMenuItemProjectInstallFar.setText("Install FAR");
|
||||||
jMenuItemProjectInstallPackage.setMnemonic('I');
|
jMenuItemProjectInstallFar.setMnemonic('I');
|
||||||
jMenuItemProjectInstallPackage.setEnabled(false);
|
jMenuItemProjectInstallFar.setEnabled(true);
|
||||||
jMenuItemProjectInstallPackage.addActionListener(this);
|
jMenuItemProjectInstallFar.addActionListener(this);
|
||||||
}
|
}
|
||||||
return jMenuItemProjectInstallPackage;
|
return jMenuItemProjectInstallFar;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1623,15 +1626,15 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
*
|
*
|
||||||
* @return javax.swing.JMenuItem
|
* @return javax.swing.JMenuItem
|
||||||
*/
|
*/
|
||||||
private JMenuItem getJMenuItemProjectUpdatePackage() {
|
private JMenuItem getJMenuItemProjectUpdateFar() {
|
||||||
if (jMenuItemProjectUpdatePackage == null) {
|
if (jMenuItemProjectUpdateFar == null) {
|
||||||
jMenuItemProjectUpdatePackage = new JMenuItem();
|
jMenuItemProjectUpdateFar = new JMenuItem();
|
||||||
jMenuItemProjectUpdatePackage.setText("Update Disstribution Package");
|
jMenuItemProjectUpdateFar.setText("Update FAR");
|
||||||
jMenuItemProjectUpdatePackage.setMnemonic('U');
|
jMenuItemProjectUpdateFar.setMnemonic('U');
|
||||||
jMenuItemProjectUpdatePackage.setEnabled(false);
|
jMenuItemProjectUpdateFar.setEnabled(true);
|
||||||
jMenuItemProjectUpdatePackage.addActionListener(this);
|
jMenuItemProjectUpdateFar.addActionListener(this);
|
||||||
}
|
}
|
||||||
return jMenuItemProjectUpdatePackage;
|
return jMenuItemProjectUpdateFar;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1639,15 +1642,30 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
*
|
*
|
||||||
* @return javax.swing.JMenuItem
|
* @return javax.swing.JMenuItem
|
||||||
*/
|
*/
|
||||||
private JMenuItem getJMenuItemProjectRemovePackage() {
|
private JMenuItem getJMenuItemProjectRemoveFar() {
|
||||||
if (jMenuItemProjectRemovePackage == null) {
|
if (jMenuItemProjectRemoveFar == null) {
|
||||||
jMenuItemProjectRemovePackage = new JMenuItem();
|
jMenuItemProjectRemoveFar = new JMenuItem();
|
||||||
jMenuItemProjectRemovePackage.setText("Remove Distribution Package");
|
jMenuItemProjectRemoveFar.setText("Remove FAR");
|
||||||
jMenuItemProjectRemovePackage.setMnemonic('R');
|
jMenuItemProjectRemoveFar.setMnemonic('R');
|
||||||
jMenuItemProjectRemovePackage.setEnabled(false);
|
jMenuItemProjectRemoveFar.setEnabled(true);
|
||||||
jMenuItemProjectRemovePackage.addActionListener(this);
|
jMenuItemProjectRemoveFar.addActionListener(this);
|
||||||
}
|
}
|
||||||
return jMenuItemProjectRemovePackage;
|
return jMenuItemProjectRemoveFar;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method initializes jMenuItemProjectCreateFar
|
||||||
|
*
|
||||||
|
* @return javax.swing.JMenuItem
|
||||||
|
*/
|
||||||
|
private JMenuItem getJMenuItemProjectCreateFar() {
|
||||||
|
if (jMenuItemProjectCreateFar == null) {
|
||||||
|
jMenuItemProjectCreateFar = new JMenuItem();
|
||||||
|
jMenuItemProjectCreateFar.setText("Create FAR");
|
||||||
|
jMenuItemProjectCreateFar.setMnemonic('C');
|
||||||
|
jMenuItemProjectCreateFar.addActionListener(this);
|
||||||
|
}
|
||||||
|
return jMenuItemProjectCreateFar;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
@ -1695,7 +1713,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
this.addComponentListener(this);
|
this.addComponentListener(this);
|
||||||
this.getCompontentsFromFrameworkDatabase();
|
this.getCompontentsFromFrameworkDatabase();
|
||||||
this.setContentPane(getJContentPane());
|
this.setContentPane(getJContentPane());
|
||||||
this.setTitle(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION + " " + "- [" + Workspace.getCurrentWorkspace() + "]");
|
this.setTitle(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION + " " + "- ["
|
||||||
|
+ Workspace.getCurrentWorkspace() + "]");
|
||||||
this.setExitType(1);
|
this.setExitType(1);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1766,6 +1785,22 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
changeWorkspace();
|
changeWorkspace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arg0.getSource() == jMenuItemProjectCreateFar) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arg0.getSource() == jMenuItemProjectInstallFar) {
|
||||||
|
this.closeAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arg0.getSource() == jMenuItemProjectRemoveFar) {
|
||||||
|
this.closeAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arg0.getSource() == jMenuItemProjectUpdateFar) {
|
||||||
|
this.closeAll();
|
||||||
|
}
|
||||||
|
|
||||||
if (arg0.getSource() == jMenuItemToolsClone) {
|
if (arg0.getSource() == jMenuItemToolsClone) {
|
||||||
cloneItem();
|
cloneItem();
|
||||||
}
|
}
|
||||||
@ -1794,14 +1829,56 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
// Make Module Description
|
// Make Module Description
|
||||||
dmtnModuleDescription = new IDefaultMutableTreeNode("ModuleDescription", IDefaultMutableTreeNode.MODULE, -1);
|
dmtnModuleDescription = new IDefaultMutableTreeNode("ModuleDescription", IDefaultMutableTreeNode.MODULE, -1);
|
||||||
|
|
||||||
if (this.vModuleList.size() > 0) {
|
//
|
||||||
for (int index = 0; index < this.vModuleList.size(); index++) {
|
// First add package
|
||||||
dmtnModuleDescription.add(new IDefaultMutableTreeNode(this.vModuleList.elementAt(index).getName(),
|
//
|
||||||
IDefaultMutableTreeNode.MSA_HEADER, false,
|
if (this.vPackageList.size() > 0) {
|
||||||
this.vModuleList.elementAt(index)));
|
for (int index = 0; index < this.vPackageList.size(); index++) {
|
||||||
|
IDefaultMutableTreeNode dmtnModulePackage = null;
|
||||||
|
IDefaultMutableTreeNode dmtnModulePackageLibrary = null;
|
||||||
|
IDefaultMutableTreeNode dmtnModulePackageModule = null;
|
||||||
|
|
||||||
|
dmtnModulePackage = new IDefaultMutableTreeNode(this.vPackageList.elementAt(index).getName(),
|
||||||
|
IDefaultMutableTreeNode.MODULE_PACKAGE, false,
|
||||||
|
this.vPackageList.elementAt(index));
|
||||||
|
dmtnModulePackageLibrary = new IDefaultMutableTreeNode("Library",
|
||||||
|
IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY,
|
||||||
|
false, this.vPackageList.elementAt(index));
|
||||||
|
dmtnModulePackageModule = new IDefaultMutableTreeNode("Module",
|
||||||
|
IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
|
||||||
|
false, this.vPackageList.elementAt(index));
|
||||||
|
|
||||||
|
Vector<ModuleIdentification> vModule = wt.getAllModules(this.vPackageList.elementAt(index));
|
||||||
|
for (int indexJ = 0; indexJ < vModule.size(); indexJ++) {
|
||||||
|
if (vModule.get(indexJ).isLibrary()) {
|
||||||
|
dmtnModulePackageLibrary.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
|
||||||
|
IDefaultMutableTreeNode.MSA_HEADER,
|
||||||
|
false, vModule.get(indexJ)));
|
||||||
|
} else {
|
||||||
|
dmtnModulePackageModule.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
|
||||||
|
IDefaultMutableTreeNode.MSA_HEADER,
|
||||||
|
false, vModule.get(indexJ)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dmtnModulePackageModule.getChildCount() > 0) {
|
||||||
|
dmtnModulePackage.add(dmtnModulePackageModule);
|
||||||
|
}
|
||||||
|
if (dmtnModulePackageLibrary.getChildCount() > 0) {
|
||||||
|
dmtnModulePackage.add(dmtnModulePackageLibrary);
|
||||||
|
}
|
||||||
|
|
||||||
|
dmtnModuleDescription.add(dmtnModulePackage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (this.vModuleList.size() > 0) {
|
||||||
|
// for (int index = 0; index < this.vModuleList.size(); index++) {
|
||||||
|
// dmtnModuleDescription.add(new IDefaultMutableTreeNode(this.vModuleList.elementAt(index).getName(),
|
||||||
|
// IDefaultMutableTreeNode.MSA_HEADER, false,
|
||||||
|
// this.vModuleList.elementAt(index)));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
// Make Package Description
|
// Make Package Description
|
||||||
dmtnPackageDescription = new IDefaultMutableTreeNode("PackageDescription", IDefaultMutableTreeNode.PACKAGE, -1);
|
dmtnPackageDescription = new IDefaultMutableTreeNode("PackageDescription", IDefaultMutableTreeNode.PACKAGE, -1);
|
||||||
if (this.vPackageList.size() > 0) {
|
if (this.vPackageList.size() > 0) {
|
||||||
@ -1939,6 +2016,147 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
return fc.showSaveDialog(new JPanel());
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Open Module
|
Open Module
|
||||||
|
|
||||||
@ -1978,14 +2196,71 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isFind) {
|
if (!isFind) {
|
||||||
vModuleList.addElement(new ModuleIdentification(id, pid));
|
ModuleIdentification mid = new ModuleIdentification(id, pid);
|
||||||
|
vModuleList.addElement(mid);
|
||||||
//
|
//
|
||||||
// Add new MsaHeader node to the tree
|
// Add new MsaHeader node to the tree
|
||||||
//
|
//
|
||||||
IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(vModuleList.lastElement().getName(),
|
IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(mid.getName(),
|
||||||
IDefaultMutableTreeNode.MSA_HEADER, true,
|
IDefaultMutableTreeNode.MSA_HEADER, true,
|
||||||
vModuleList.lastElement());
|
mid);
|
||||||
iTree.addNode(dmtnModuleDescription, node);
|
//
|
||||||
|
// 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 {
|
||||||
//
|
//
|
||||||
@ -1995,6 +2270,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
// Make the node selected
|
// Make the node selected
|
||||||
//
|
//
|
||||||
iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id,
|
iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id,
|
||||||
@ -2311,7 +2587,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void insertPlatformTreeNode(Identification id) {
|
private void insertPlatformTreeNode(Identification id) {
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Platform Definitions", IDefaultMutableTreeNode.FPD_PLATFORMDEFINITIONS, true, id));
|
iTree.addNode(new IDefaultMutableTreeNode("Platform Definitions",
|
||||||
|
IDefaultMutableTreeNode.FPD_PLATFORMDEFINITIONS, true, id));
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Flash", IDefaultMutableTreeNode.FPD_FLASH, true, id));
|
iTree.addNode(new IDefaultMutableTreeNode("Flash", IDefaultMutableTreeNode.FPD_FLASH, true, id));
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Framework Modules", IDefaultMutableTreeNode.FPD_FRAMEWORKMODULES,
|
iTree.addNode(new IDefaultMutableTreeNode("Framework Modules", IDefaultMutableTreeNode.FPD_FRAMEWORKMODULES,
|
||||||
true, id));
|
true, id));
|
||||||
@ -2378,7 +2655,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
@param elementType
|
@param elementType
|
||||||
@param fpd
|
@param fpd
|
||||||
|
|
||||||
**/
|
**/
|
||||||
private void showPlatformElement(int elementType, OpeningPlatformType fpd) {
|
private void showPlatformElement(int elementType, OpeningPlatformType fpd) {
|
||||||
this.cleanDesktopPanePlatform();
|
this.cleanDesktopPanePlatform();
|
||||||
|
|
||||||
@ -2596,7 +2873,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.openModule(smb.getMid().getPath());
|
this.openModule(smb.getMid().getPath(), smb.getMid());
|
||||||
}
|
}
|
||||||
} else if (result == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
|
} else if (result == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
|
||||||
//
|
//
|
||||||
@ -2884,15 +3161,16 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||||||
// Reinit whole window
|
// Reinit whole window
|
||||||
//
|
//
|
||||||
closeAll();
|
closeAll();
|
||||||
this.setTitle(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION + " " + "- [" + Workspace.getCurrentWorkspace() + "]");
|
this.setTitle(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION + " " + "- ["
|
||||||
|
+ Workspace.getCurrentWorkspace() + "]");
|
||||||
}
|
}
|
||||||
sw.dispose();
|
sw.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Show Tool Chain Configuration Dialog to setup Tool Chain
|
Show Tool Chain Configuration Dialog to setup Tool Chain
|
||||||
|
|
||||||
**/
|
**/
|
||||||
private void setupToolChainConfiguration() {
|
private void setupToolChainConfiguration() {
|
||||||
ToolChainConfig tcc = ToolChainConfig.getInstance();
|
ToolChainConfig tcc = ToolChainConfig.getInstance();
|
||||||
tcc.showDialog();
|
tcc.showDialog();
|
||||||
|
@ -15,10 +15,12 @@
|
|||||||
**/
|
**/
|
||||||
package org.tianocore.frameworkwizard;
|
package org.tianocore.frameworkwizard;
|
||||||
|
|
||||||
|
import java.awt.Component;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
|
import javax.swing.ButtonGroup;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
import javax.swing.JFileChooser;
|
import javax.swing.JFileChooser;
|
||||||
@ -46,6 +48,7 @@ import org.tianocore.frameworkwizard.packaging.PackageIdentification;
|
|||||||
import org.tianocore.frameworkwizard.platform.PlatformIdentification;
|
import org.tianocore.frameworkwizard.platform.PlatformIdentification;
|
||||||
import org.tianocore.frameworkwizard.workspace.Workspace;
|
import org.tianocore.frameworkwizard.workspace.Workspace;
|
||||||
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
|
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
|
||||||
|
import javax.swing.JRadioButton;
|
||||||
|
|
||||||
public class SelectModuleBelong extends IDialog {
|
public class SelectModuleBelong extends IDialog {
|
||||||
|
|
||||||
@ -55,7 +58,7 @@ public class SelectModuleBelong extends IDialog {
|
|||||||
**/
|
**/
|
||||||
private static final long serialVersionUID = 4171355136991448972L;
|
private static final long serialVersionUID = 4171355136991448972L;
|
||||||
|
|
||||||
private JPanel jContentPane = null;
|
private JPanel jContentPane = null; // @jve:decl-index=0:visual-constraint="10,54"
|
||||||
|
|
||||||
private JComboBox jComboBoxExistingPackage = null;
|
private JComboBox jComboBoxExistingPackage = null;
|
||||||
|
|
||||||
@ -97,6 +100,8 @@ public class SelectModuleBelong extends IDialog {
|
|||||||
|
|
||||||
private StarLabel jStarLabel5 = null;
|
private StarLabel jStarLabel5 = null;
|
||||||
|
|
||||||
|
private ButtonGroup bg = new ButtonGroup();
|
||||||
|
|
||||||
private WorkspaceTools wt = new WorkspaceTools();
|
private WorkspaceTools wt = new WorkspaceTools();
|
||||||
|
|
||||||
private ModuleIdentification mid = null;
|
private ModuleIdentification mid = null;
|
||||||
@ -107,6 +112,12 @@ public class SelectModuleBelong extends IDialog {
|
|||||||
|
|
||||||
private int mode = -1;
|
private int mode = -1;
|
||||||
|
|
||||||
|
private JLabel jLabelIsLibrary = null;
|
||||||
|
|
||||||
|
private JRadioButton jRadioButtonYes = null;
|
||||||
|
|
||||||
|
private JRadioButton jRadioButtonNo = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method initializes jComboBoxExistingPackage
|
* This method initializes jComboBoxExistingPackage
|
||||||
*
|
*
|
||||||
@ -128,7 +139,7 @@ public class SelectModuleBelong 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(310, 140, 80, 20));
|
jButtonOk.setBounds(new java.awt.Rectangle(310, 165, 80, 20));
|
||||||
jButtonOk.setText("Ok");
|
jButtonOk.setText("Ok");
|
||||||
jButtonOk.addActionListener(this);
|
jButtonOk.addActionListener(this);
|
||||||
}
|
}
|
||||||
@ -143,7 +154,7 @@ public class SelectModuleBelong 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(395, 140, 80, 20));
|
jButtonCancel.setBounds(new java.awt.Rectangle(395, 165, 80, 20));
|
||||||
jButtonCancel.setText("Cancel");
|
jButtonCancel.setText("Cancel");
|
||||||
jButtonCancel.addActionListener(this);
|
jButtonCancel.addActionListener(this);
|
||||||
}
|
}
|
||||||
@ -158,7 +169,7 @@ public class SelectModuleBelong 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(140, 35, 250, 20));
|
jTextFieldFilePath.setBounds(new java.awt.Rectangle(140, 60, 250, 20));
|
||||||
}
|
}
|
||||||
return jTextFieldFilePath;
|
return jTextFieldFilePath;
|
||||||
}
|
}
|
||||||
@ -171,7 +182,7 @@ public class SelectModuleBelong 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, 35, 85, 20));
|
jButtonBrowse.setBounds(new java.awt.Rectangle(395, 60, 85, 20));
|
||||||
jButtonBrowse.setText("Browse");
|
jButtonBrowse.setText("Browse");
|
||||||
jButtonBrowse.addActionListener(this);
|
jButtonBrowse.addActionListener(this);
|
||||||
}
|
}
|
||||||
@ -186,7 +197,7 @@ public class SelectModuleBelong extends IDialog {
|
|||||||
private JTextField getJTextFieldName() {
|
private JTextField getJTextFieldName() {
|
||||||
if (jTextFieldName == null) {
|
if (jTextFieldName == null) {
|
||||||
jTextFieldName = new JTextField();
|
jTextFieldName = new JTextField();
|
||||||
jTextFieldName.setBounds(new java.awt.Rectangle(140, 60, 340, 20));
|
jTextFieldName.setBounds(new java.awt.Rectangle(140, 85, 340, 20));
|
||||||
}
|
}
|
||||||
return jTextFieldName;
|
return jTextFieldName;
|
||||||
}
|
}
|
||||||
@ -199,7 +210,7 @@ public class SelectModuleBelong 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(140, 85, 250, 20));
|
jTextFieldGuid.setBounds(new java.awt.Rectangle(140, 110, 250, 20));
|
||||||
}
|
}
|
||||||
return jTextFieldGuid;
|
return jTextFieldGuid;
|
||||||
}
|
}
|
||||||
@ -212,7 +223,7 @@ public class SelectModuleBelong extends IDialog {
|
|||||||
private JButton getJButtonGen() {
|
private JButton getJButtonGen() {
|
||||||
if (jButtonGen == null) {
|
if (jButtonGen == null) {
|
||||||
jButtonGen = new JButton();
|
jButtonGen = new JButton();
|
||||||
jButtonGen.setBounds(new java.awt.Rectangle(395, 85, 85, 20));
|
jButtonGen.setBounds(new java.awt.Rectangle(395, 110, 85, 20));
|
||||||
jButtonGen.setText("GEN");
|
jButtonGen.setText("GEN");
|
||||||
jButtonGen.addActionListener(this);
|
jButtonGen.addActionListener(this);
|
||||||
}
|
}
|
||||||
@ -227,11 +238,41 @@ public class SelectModuleBelong 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(140, 110, 340, 20));
|
jTextFieldVersion.setBounds(new java.awt.Rectangle(140, 135, 340, 20));
|
||||||
}
|
}
|
||||||
return jTextFieldVersion;
|
return jTextFieldVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method initializes jRadioButtonYes
|
||||||
|
*
|
||||||
|
* @return javax.swing.JRadioButton
|
||||||
|
*/
|
||||||
|
private JRadioButton getJRadioButtonYes() {
|
||||||
|
if (jRadioButtonYes == null) {
|
||||||
|
jRadioButtonYes = new JRadioButton();
|
||||||
|
jRadioButtonYes.setBounds(new java.awt.Rectangle(140,35,100,20));
|
||||||
|
jRadioButtonYes.setSelected(true);
|
||||||
|
jRadioButtonYes.setText("Yes");
|
||||||
|
}
|
||||||
|
return jRadioButtonYes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method initializes jRadioButtonNo
|
||||||
|
*
|
||||||
|
* @return javax.swing.JRadioButton
|
||||||
|
*/
|
||||||
|
private JRadioButton getJRadioButtonNo() {
|
||||||
|
if (jRadioButtonNo == null) {
|
||||||
|
jRadioButtonNo = new JRadioButton();
|
||||||
|
jRadioButtonNo.setBounds(new java.awt.Rectangle(300,35,110,20));
|
||||||
|
jRadioButtonNo.setSelected(false);
|
||||||
|
jRadioButtonNo.setText("No");
|
||||||
|
}
|
||||||
|
return jRadioButtonNo;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param args
|
* @param args
|
||||||
*/
|
*/
|
||||||
@ -260,6 +301,23 @@ public class SelectModuleBelong extends IDialog {
|
|||||||
this.jStarLabel1.setVisible(false);
|
this.jStarLabel1.setVisible(false);
|
||||||
this.jLabelPackage.setVisible(false);
|
this.jLabelPackage.setVisible(false);
|
||||||
this.jComboBoxExistingPackage.setVisible(false);
|
this.jComboBoxExistingPackage.setVisible(false);
|
||||||
|
this.jLabelIsLibrary.setVisible(false);
|
||||||
|
this.jRadioButtonYes.setVisible(false);
|
||||||
|
this.jRadioButtonNo.setVisible(false);
|
||||||
|
upLocation(this.jStarLabel2, 50);
|
||||||
|
upLocation(this.jStarLabel3, 50);
|
||||||
|
upLocation(this.jStarLabel4, 50);
|
||||||
|
upLocation(this.jStarLabel5, 50);
|
||||||
|
upLocation(this.jLabelFilePath, 50);
|
||||||
|
upLocation(this.jLabelName, 50);
|
||||||
|
upLocation(this.jLabelGuid, 50);
|
||||||
|
upLocation(this.jLabelVersion, 50);
|
||||||
|
upLocation(this.jTextFieldFilePath, 50);
|
||||||
|
upLocation(this.jTextFieldName, 50);
|
||||||
|
upLocation(this.jTextFieldGuid, 50);
|
||||||
|
upLocation(this.jTextFieldVersion, 50);
|
||||||
|
upLocation(this.jButtonBrowse, 50);
|
||||||
|
upLocation(this.jButtonGen, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,7 +327,7 @@ public class SelectModuleBelong extends IDialog {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private void init() {
|
private void init() {
|
||||||
this.setSize(500, 200);
|
this.setSize(500, 230);
|
||||||
this.setContentPane(getJContentPane());
|
this.setContentPane(getJContentPane());
|
||||||
this.setTitle("New");
|
this.setTitle("New");
|
||||||
this.centerWindow();
|
this.centerWindow();
|
||||||
@ -282,24 +340,27 @@ public class SelectModuleBelong extends IDialog {
|
|||||||
*/
|
*/
|
||||||
private JPanel getJContentPane() {
|
private JPanel getJContentPane() {
|
||||||
if (jContentPane == null) {
|
if (jContentPane == null) {
|
||||||
|
jLabelIsLibrary = new JLabel();
|
||||||
|
jLabelIsLibrary.setBounds(new java.awt.Rectangle(15,35,120,20));
|
||||||
|
jLabelIsLibrary.setText("Is a Library");
|
||||||
jLabelVersion = new JLabel();
|
jLabelVersion = new JLabel();
|
||||||
jLabelVersion.setBounds(new java.awt.Rectangle(15, 110, 120, 20));
|
jLabelVersion.setBounds(new java.awt.Rectangle(15, 135, 120, 20));
|
||||||
jLabelVersion.setText("Version");
|
jLabelVersion.setText("Version");
|
||||||
jLabelGuid = new JLabel();
|
jLabelGuid = new JLabel();
|
||||||
jLabelGuid.setBounds(new java.awt.Rectangle(15, 85, 120, 20));
|
jLabelGuid.setBounds(new java.awt.Rectangle(15, 110, 120, 20));
|
||||||
jLabelGuid.setText("Guid");
|
jLabelGuid.setText("Guid");
|
||||||
jLabelName = new JLabel();
|
jLabelName = new JLabel();
|
||||||
jLabelName.setBounds(new java.awt.Rectangle(15, 60, 120, 20));
|
jLabelName.setBounds(new java.awt.Rectangle(15, 85, 120, 20));
|
||||||
jLabelName.setText("Name");
|
jLabelName.setText("Name");
|
||||||
jLabelFilePath = new JLabel();
|
jLabelFilePath = new JLabel();
|
||||||
jLabelFilePath.setBounds(new java.awt.Rectangle(15, 35, 120, 20));
|
jLabelFilePath.setBounds(new java.awt.Rectangle(15, 60, 120, 20));
|
||||||
jLabelFilePath.setText("File Path");
|
jLabelFilePath.setText("File Path");
|
||||||
jLabelPackage = new JLabel();
|
jLabelPackage = new JLabel();
|
||||||
jLabelPackage.setBounds(new java.awt.Rectangle(15, 10, 120, 20));
|
jLabelPackage.setBounds(new java.awt.Rectangle(15, 10, 120, 20));
|
||||||
jLabelPackage.setText("Choose Package");
|
jLabelPackage.setText("Choose Package");
|
||||||
jContentPane = new JPanel();
|
jContentPane = new JPanel();
|
||||||
jContentPane.setLayout(null);
|
jContentPane.setLayout(null);
|
||||||
jContentPane.setSize(new java.awt.Dimension(490, 175));
|
jContentPane.setSize(new java.awt.Dimension(490,198));
|
||||||
jContentPane.add(getJComboBoxExistingPackage(), null);
|
jContentPane.add(getJComboBoxExistingPackage(), null);
|
||||||
jContentPane.add(getJButtonOk(), null);
|
jContentPane.add(getJButtonOk(), null);
|
||||||
jContentPane.add(getJButtonCancel(), null);
|
jContentPane.add(getJButtonCancel(), null);
|
||||||
@ -318,18 +379,23 @@ public class SelectModuleBelong extends IDialog {
|
|||||||
jStarLabel1 = new StarLabel();
|
jStarLabel1 = new StarLabel();
|
||||||
jStarLabel1.setLocation(new java.awt.Point(0, 10));
|
jStarLabel1.setLocation(new java.awt.Point(0, 10));
|
||||||
jStarLabel2 = new StarLabel();
|
jStarLabel2 = new StarLabel();
|
||||||
jStarLabel2.setLocation(new java.awt.Point(0, 35));
|
jStarLabel2.setLocation(new java.awt.Point(0, 60));
|
||||||
jStarLabel3 = new StarLabel();
|
jStarLabel3 = new StarLabel();
|
||||||
jStarLabel3.setLocation(new java.awt.Point(0, 60));
|
jStarLabel3.setLocation(new java.awt.Point(0, 85));
|
||||||
jStarLabel4 = new StarLabel();
|
jStarLabel4 = new StarLabel();
|
||||||
jStarLabel4.setLocation(new java.awt.Point(0, 85));
|
jStarLabel4.setLocation(new java.awt.Point(0, 110));
|
||||||
jStarLabel5 = new StarLabel();
|
jStarLabel5 = new StarLabel();
|
||||||
jStarLabel5.setLocation(new java.awt.Point(0, 110));
|
jStarLabel5.setLocation(new java.awt.Point(0, 135));
|
||||||
jContentPane.add(jStarLabel1, null);
|
jContentPane.add(jStarLabel1, null);
|
||||||
jContentPane.add(jStarLabel2, null);
|
jContentPane.add(jStarLabel2, null);
|
||||||
jContentPane.add(jStarLabel3, null);
|
jContentPane.add(jStarLabel3, null);
|
||||||
jContentPane.add(jStarLabel4, null);
|
jContentPane.add(jStarLabel4, null);
|
||||||
jContentPane.add(jStarLabel5, null);
|
jContentPane.add(jStarLabel5, null);
|
||||||
|
jContentPane.add(jLabelIsLibrary, null);
|
||||||
|
jContentPane.add(getJRadioButtonYes(), null);
|
||||||
|
jContentPane.add(getJRadioButtonNo(), null);
|
||||||
|
bg.add(getJRadioButtonNo());
|
||||||
|
bg.add(getJRadioButtonYes());
|
||||||
}
|
}
|
||||||
return jContentPane;
|
return jContentPane;
|
||||||
}
|
}
|
||||||
@ -543,7 +609,7 @@ public class SelectModuleBelong extends IDialog {
|
|||||||
// Save to identification
|
// Save to identification
|
||||||
//
|
//
|
||||||
mid = new ModuleIdentification(this.jTextFieldName.getText(), this.jTextFieldGuid.getText(),
|
mid = new ModuleIdentification(this.jTextFieldName.getText(), this.jTextFieldGuid.getText(),
|
||||||
this.jTextFieldVersion.getText(), path);
|
this.jTextFieldVersion.getText(), path, jRadioButtonYes.isSelected());
|
||||||
mid.setPackageId(packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()));
|
mid.setPackageId(packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -660,4 +726,8 @@ public class SelectModuleBelong extends IDialog {
|
|||||||
public void setPid(PackageIdentification pid) {
|
public void setPid(PackageIdentification pid) {
|
||||||
this.pid = pid;
|
this.pid = pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void upLocation(Component c, int size) {
|
||||||
|
c.setLocation(c.getLocation().x, c.getLocation().y - size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -113,12 +113,7 @@ public class ToolChainConfig extends IFrame implements ListSelectionListener, Ta
|
|||||||
**/
|
**/
|
||||||
private JTable getJTable() {
|
private JTable getJTable() {
|
||||||
if (jTable == null) {
|
if (jTable == null) {
|
||||||
// Vector<String> vTableHeader = new Vector<String>();
|
|
||||||
// vTableHeader.addElement("Name");
|
|
||||||
// vTableHeader.addElement("Value");
|
|
||||||
//
|
|
||||||
model = new DefaultTableModel();
|
model = new DefaultTableModel();
|
||||||
//model = new DefaultTableModel(vTableHeader);
|
|
||||||
jTable = new JTable(model);
|
jTable = new JTable(model);
|
||||||
jTable.setRowHeight(20);
|
jTable.setRowHeight(20);
|
||||||
|
|
||||||
|
@ -50,6 +50,8 @@ public class DataType {
|
|||||||
|
|
||||||
public static final int RETURN_TYPE_WORKSPACE = 15;
|
public static final int RETURN_TYPE_WORKSPACE = 15;
|
||||||
|
|
||||||
|
public static final int RETURN_TYPE_TEXT = 16;
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Define all used final variables
|
// Define all used final variables
|
||||||
@ -97,6 +99,12 @@ public class DataType {
|
|||||||
|
|
||||||
public static final String ANT_BUILD_FILE_EXT_DESCRIPTION = ANT_BUILD_FILE + " (*." + ANT_BUILD_FILE_EXT + ")";
|
public static final String ANT_BUILD_FILE_EXT_DESCRIPTION = ANT_BUILD_FILE + " (*." + ANT_BUILD_FILE_EXT + ")";
|
||||||
|
|
||||||
|
public static final String TEXT_FILE = "Text File";
|
||||||
|
|
||||||
|
public static final String TEXT_FILE_EXT = "txt";
|
||||||
|
|
||||||
|
public static final String TEXT_FILE_EXT_DESCRIPTION = TEXT_FILE + " (*." + TEXT_FILE_EXT + ")";
|
||||||
|
|
||||||
//
|
//
|
||||||
// Define file separator for current OS
|
// Define file separator for current OS
|
||||||
//
|
//
|
||||||
@ -171,4 +179,17 @@ public class DataType {
|
|||||||
|
|
||||||
public static final String PROJECT_VERSION = "1.0";
|
public static final String PROJECT_VERSION = "1.0";
|
||||||
|
|
||||||
|
//
|
||||||
|
// Sort Type
|
||||||
|
//
|
||||||
|
public static final int SORT_TYPE_ASCENDING = 1;
|
||||||
|
|
||||||
|
public static final int SORT_TYPE_DESCENDING = 2;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Module Type
|
||||||
|
//
|
||||||
|
public static final String MODULE_TYPE_LIBRARY = "Library";
|
||||||
|
|
||||||
|
public static final String MODULE_TYPE_MODULE = "Module";
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ public class DataValidation {
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
public static boolean isVersionDataType(String arg0) {
|
public static boolean isVersionDataType(String arg0) {
|
||||||
return isMatch("(\\d)+(.)?(\\d)+", arg0);
|
return isMatch("\\d+(\\.\\d+)*", arg0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
/** @file
|
||||||
|
|
||||||
|
The file is used to override DefaultTableModel to provides customized interfaces
|
||||||
|
|
||||||
|
Copyright (c) 2006, Intel Corporation
|
||||||
|
All rights reserved. This program and the accompanying materials
|
||||||
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
http://opensource.org/licenses/bsd-license.php
|
||||||
|
|
||||||
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
|
**/
|
||||||
|
package org.tianocore.frameworkwizard.common;
|
||||||
|
|
||||||
|
import javax.swing.table.DefaultTableModel;
|
||||||
|
|
||||||
|
public class IDefaultTableModel extends DefaultTableModel {
|
||||||
|
|
||||||
|
///
|
||||||
|
///
|
||||||
|
///
|
||||||
|
private static final long serialVersionUID = -1782544418084080185L;
|
||||||
|
|
||||||
|
public IDefaultTableModel() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see javax.swing.table.TableModel#isCellEditable(int, int)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public boolean isCellEditable(int rowIndex, int columnIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -81,6 +81,8 @@ public class IFileFilter extends FileFilter {
|
|||||||
return DataType.PACKAGE_SURFACE_AREA_EXT_DESCRIPTION;
|
return DataType.PACKAGE_SURFACE_AREA_EXT_DESCRIPTION;
|
||||||
if (strExt.equals(DataType.PLATFORM_SURFACE_AREA_EXT))
|
if (strExt.equals(DataType.PLATFORM_SURFACE_AREA_EXT))
|
||||||
return DataType.PLATFORM_SURFACE_AREA_EXT_DESCRIPTION;
|
return DataType.PLATFORM_SURFACE_AREA_EXT_DESCRIPTION;
|
||||||
|
if (strExt.equals(DataType.TEXT_FILE_EXT))
|
||||||
|
return DataType.TEXT_FILE_EXT_DESCRIPTION;
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,9 +22,15 @@ import java.util.List;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
|
import javax.swing.DefaultListModel;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JList;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
|
||||||
|
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
|
||||||
|
import org.tianocore.frameworkwizard.platform.PlatformIdentification;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The class is used to provides some useful interfaces
|
The class is used to provides some useful interfaces
|
||||||
|
|
||||||
@ -44,6 +50,25 @@ public class Tools {
|
|||||||
**/
|
**/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
System.out.println(getCurrentDateTime());
|
System.out.println(getCurrentDateTime());
|
||||||
|
// Vector<String> v = new Vector<String>();
|
||||||
|
// Vector<String> v1 = new Vector<String>();
|
||||||
|
//
|
||||||
|
// v.addElement("CAC");
|
||||||
|
// v1.addElement("1111");
|
||||||
|
// v.addElement("1AC");
|
||||||
|
// v1.addElement("2222");
|
||||||
|
// v.addElement("ABC");
|
||||||
|
// v1.addElement("3333");
|
||||||
|
// v.addElement("0C");
|
||||||
|
// v1.addElement("4444");
|
||||||
|
// v.addElement("AAC");
|
||||||
|
// v1.addElement("5555");
|
||||||
|
// Vector<Integer> vs = new Vector<Integer>();
|
||||||
|
// vs = Tools.getVectorSortSequence(v, DataType.Sort_Type_Ascending);
|
||||||
|
// Tools.sortVectorString(v1, Tools.getVectorSortSequence(v, DataType.Sort_Type_Ascending));
|
||||||
|
//
|
||||||
|
// Tools.sortVectorString(v, DataType.Sort_Type_Ascending);
|
||||||
|
// Tools.sortVectorString(v, DataType.Sort_Type_Descending);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -142,6 +167,27 @@ public class Tools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Generate selection items for JList by input vector
|
||||||
|
|
||||||
|
**/
|
||||||
|
public static void generateListByVector(JList jl, Vector<String> vector) {
|
||||||
|
if (jl != null) {
|
||||||
|
DefaultListModel listModel = (DefaultListModel) jl.getModel();
|
||||||
|
listModel.removeAllElements();
|
||||||
|
|
||||||
|
if (vector != null) {
|
||||||
|
for (int index = 0; index < vector.size(); index++) {
|
||||||
|
listModel.addElement(vector.get(index));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listModel.size() > 0) {
|
||||||
|
jl.setSelectedIndex(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get path only from a path
|
Get path only from a path
|
||||||
|
|
||||||
@ -255,6 +301,9 @@ public class Tools {
|
|||||||
if (type == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
|
if (type == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
|
||||||
match = DataType.FILE_EXT_SEPARATOR + DataType.PLATFORM_SURFACE_AREA_EXT;
|
match = DataType.FILE_EXT_SEPARATOR + DataType.PLATFORM_SURFACE_AREA_EXT;
|
||||||
}
|
}
|
||||||
|
if (type == DataType.RETURN_TYPE_TEXT) {
|
||||||
|
match = DataType.FILE_EXT_SEPARATOR + DataType.TEXT_FILE_EXT;
|
||||||
|
}
|
||||||
if (path.length() <= match.length()) {
|
if (path.length() <= match.length()) {
|
||||||
path = path + match;
|
path = path + match;
|
||||||
return path;
|
return path;
|
||||||
@ -276,16 +325,178 @@ public class Tools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
if the string doesn't end with a file separator, append it to the string
|
if the string doesn't end with a file separator, append it to the string
|
||||||
|
|
||||||
@param arg0
|
@param arg0
|
||||||
@return
|
@return
|
||||||
|
|
||||||
|
**/
|
||||||
|
public static String addFileSeparator(String arg0) {
|
||||||
|
if (!arg0.endsWith(DataType.FILE_SEPARATOR)) {
|
||||||
|
arg0 = arg0 + DataType.FILE_SEPARATOR;
|
||||||
|
}
|
||||||
|
return arg0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sort all elements in the vector as the specific sort type
|
||||||
|
|
||||||
|
@param v The vector need to be sorted
|
||||||
|
@param mode Sort type DataType.Sort_Type_Ascendin and DataType.Sort_Type_Descending
|
||||||
|
|
||||||
|
**/
|
||||||
|
public static void sortVectorString(Vector<String> v, int mode) {
|
||||||
|
if (v != null) {
|
||||||
|
for (int indexI = 0; indexI < v.size(); indexI++) {
|
||||||
|
for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
|
||||||
|
if ((v.get(indexJ).compareTo(v.get(indexI)) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
|
||||||
|
|| (v.get(indexI).compareTo(v.get(indexJ)) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
|
||||||
|
String temp = v.get(indexI);
|
||||||
|
v.setElementAt(v.get(indexJ), indexI);
|
||||||
|
v.setElementAt(temp, indexJ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sort all elements of vector and return sorted sequence
|
||||||
|
|
||||||
|
@param v The vector need to be sorted
|
||||||
|
@param mode Sort type DataType.Sort_Type_Ascendin and DataType.Sort_Type_Descending
|
||||||
|
@return Vector<Integer> The sorted sequence
|
||||||
|
|
||||||
|
**/
|
||||||
|
public static Vector<Integer> getVectorSortSequence(Vector<String> v, int mode) {
|
||||||
|
Vector<Integer> vSequence = new Vector<Integer>();
|
||||||
|
//
|
||||||
|
// Init sequence
|
||||||
|
//
|
||||||
|
if (v != null) {
|
||||||
|
for (int index = 0; index < v.size(); index++) {
|
||||||
|
vSequence.addElement(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// sort and get new sequence
|
||||||
|
//
|
||||||
|
for (int indexI = 0; indexI < v.size(); indexI++) {
|
||||||
|
for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
|
||||||
|
if ((v.get(indexJ).compareTo(v.get(indexI)) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
|
||||||
|
|| (v.get(indexI).compareTo(v.get(indexJ)) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
|
||||||
|
//
|
||||||
|
// Swap strings
|
||||||
|
//
|
||||||
|
String tempStr = v.get(indexI);
|
||||||
|
v.setElementAt(v.get(indexJ), indexI);
|
||||||
|
v.setElementAt(tempStr, indexJ);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Swap sequences
|
||||||
|
//
|
||||||
|
int tempInt = vSequence.get(indexI);
|
||||||
|
vSequence.setElementAt(vSequence.get(indexJ), indexI);
|
||||||
|
vSequence.setElementAt(tempInt, indexJ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return vSequence;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sort all elements of vector as input sequence
|
||||||
|
|
||||||
|
@param v The vector need to be sorted
|
||||||
|
@param vSequence The sort sequence should be followed
|
||||||
|
|
||||||
|
**/
|
||||||
|
public static void sortVectorString(Vector<String> v, Vector<Integer> vSequence) {
|
||||||
|
if (v != null && vSequence != null && v.size() == vSequence.size()) {
|
||||||
|
Vector<String> tempV = new Vector<String>();
|
||||||
|
for (int index = 0; index < v.size(); index++) {
|
||||||
|
tempV.addElement(v.get(index));
|
||||||
|
}
|
||||||
|
for (int index = 0; index < v.size(); index++) {
|
||||||
|
v.setElementAt(tempV.get(vSequence.get(index)), index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sort all modules
|
||||||
|
|
||||||
|
@param v
|
||||||
|
@param mode
|
||||||
|
|
||||||
|
**/
|
||||||
|
public static void sortModules(Vector<ModuleIdentification> v, int mode) {
|
||||||
|
if (v != null) {
|
||||||
|
//
|
||||||
|
// sort by name
|
||||||
|
//
|
||||||
|
for (int indexI = 0; indexI < v.size(); indexI++) {
|
||||||
|
for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
|
||||||
|
if ((v.get(indexJ).getName().compareTo(v.get(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
|
||||||
|
|| (v.get(indexI).getName().compareTo(v.get(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
|
||||||
|
ModuleIdentification temp = v.get(indexI);
|
||||||
|
v.setElementAt(v.get(indexJ), indexI);
|
||||||
|
v.setElementAt(temp, indexJ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sort all packages
|
||||||
|
|
||||||
|
@param v
|
||||||
|
@param mode
|
||||||
|
|
||||||
**/
|
**/
|
||||||
public static String addFileSeparator(String arg0) {
|
public static void sortPackages(Vector<PackageIdentification> v, int mode) {
|
||||||
if (!arg0.endsWith(DataType.FILE_SEPARATOR)) {
|
if (v != null) {
|
||||||
arg0 = arg0 + DataType.FILE_SEPARATOR;
|
//
|
||||||
|
// sort by name
|
||||||
|
//
|
||||||
|
for (int indexI = 0; indexI < v.size(); indexI++) {
|
||||||
|
for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
|
||||||
|
if ((v.get(indexJ).getName().compareTo(v.get(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
|
||||||
|
|| (v.get(indexI).getName().compareTo(v.get(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
|
||||||
|
PackageIdentification temp = v.get(indexI);
|
||||||
|
v.setElementAt(v.get(indexJ), indexI);
|
||||||
|
v.setElementAt(temp, indexJ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return arg0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sort all platforms
|
||||||
|
|
||||||
|
@param v
|
||||||
|
@param mode
|
||||||
|
|
||||||
|
**/
|
||||||
|
public static void sortPlatforms(Vector<PlatformIdentification> v, int mode) {
|
||||||
|
if (v != null) {
|
||||||
|
//
|
||||||
|
// sort by name
|
||||||
|
//
|
||||||
|
for (int indexI = 0; indexI < v.size(); indexI++) {
|
||||||
|
for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
|
||||||
|
if ((v.get(indexJ).getName().compareTo(v.get(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
|
||||||
|
|| (v.get(indexI).getName().compareTo(v.get(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
|
||||||
|
PlatformIdentification temp = v.get(indexI);
|
||||||
|
v.setElementAt(v.get(indexJ), indexI);
|
||||||
|
v.setElementAt(temp, indexJ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,6 +116,12 @@ public class IDefaultMutableTreeNode extends DefaultMutableTreeNode {
|
|||||||
|
|
||||||
public static final int PLATFORM = 3;
|
public static final int PLATFORM = 3;
|
||||||
|
|
||||||
|
public static final int MODULE_PACKAGE = 4;
|
||||||
|
|
||||||
|
public static final int MODULE_PACKAGE_LIBRARY = 5;
|
||||||
|
|
||||||
|
public static final int MODULE_PACKAGE_MODULE = 6;
|
||||||
|
|
||||||
//
|
//
|
||||||
//Static final definitions for operation
|
//Static final definitions for operation
|
||||||
//
|
//
|
||||||
|
@ -126,7 +126,7 @@ public class IFrame extends JFrame implements ActionListener, WindowListener {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void windowClosing(WindowEvent arg0) {
|
public void windowClosing(WindowEvent arg0) {
|
||||||
this.onDisvisible();
|
//this.onDisvisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void windowOpened(WindowEvent arg0) {
|
public void windowOpened(WindowEvent arg0) {
|
||||||
|
@ -24,13 +24,17 @@ import java.awt.event.FocusEvent;
|
|||||||
import java.awt.event.FocusListener;
|
import java.awt.event.FocusListener;
|
||||||
import java.awt.event.ItemEvent;
|
import java.awt.event.ItemEvent;
|
||||||
import java.awt.event.ItemListener;
|
import java.awt.event.ItemListener;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.awt.event.MouseListener;
|
||||||
|
|
||||||
import javax.swing.JDesktopPane;
|
import javax.swing.JDesktopPane;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JInternalFrame;
|
import javax.swing.JInternalFrame;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.event.ListSelectionEvent;
|
||||||
import org.tianocore.frameworkwizard.common.DataType;
|
import javax.swing.event.ListSelectionListener;
|
||||||
|
import javax.swing.event.TableModelEvent;
|
||||||
|
import javax.swing.event.TableModelListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The class is used to override JInternalFrame to provides customized
|
* The class is used to override JInternalFrame to provides customized
|
||||||
@ -39,7 +43,8 @@ import org.tianocore.frameworkwizard.common.DataType;
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class IInternalFrame extends JInternalFrame implements ActionListener, ComponentListener, ItemListener, FocusListener {
|
public class IInternalFrame extends JInternalFrame implements ActionListener, ComponentListener, ItemListener,
|
||||||
|
FocusListener, ListSelectionListener, TableModelListener, MouseListener {
|
||||||
|
|
||||||
// /
|
// /
|
||||||
// / Define class Serial Version UID
|
// / Define class Serial Version UID
|
||||||
@ -157,8 +162,7 @@ public class IInternalFrame extends JInternalFrame implements ActionListener, Co
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void resizeComponentWidth(Component c, int containerWidth, int preferredWidth) {
|
public void resizeComponentWidth(Component c, int containerWidth, int preferredWidth) {
|
||||||
int newWidth = c.getPreferredSize().width
|
int newWidth = c.getPreferredSize().width + (containerWidth - preferredWidth);
|
||||||
+ (containerWidth - preferredWidth);
|
|
||||||
if (newWidth < c.getPreferredSize().width) {
|
if (newWidth < c.getPreferredSize().width) {
|
||||||
newWidth = c.getPreferredSize().width;
|
newWidth = c.getPreferredSize().width;
|
||||||
}
|
}
|
||||||
@ -190,7 +194,8 @@ public class IInternalFrame extends JInternalFrame implements ActionListener, Co
|
|||||||
* @param containerHeight
|
* @param containerHeight
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void resizeComponent(Component c, int containerWidth, int containerHeight, int preferredWidth, int preferredHeight) {
|
public void resizeComponent(Component c, int containerWidth, int containerHeight, int preferredWidth,
|
||||||
|
int preferredHeight) {
|
||||||
resizeComponentWidth(c, containerWidth, preferredWidth);
|
resizeComponentWidth(c, containerWidth, preferredWidth);
|
||||||
resizeComponentHeight(c, containerHeight, preferredHeight);
|
resizeComponentHeight(c, containerHeight, preferredHeight);
|
||||||
}
|
}
|
||||||
@ -206,7 +211,7 @@ public class IInternalFrame extends JInternalFrame implements ActionListener, Co
|
|||||||
public void relocateComponentX(Component c, int containerWidth, int preferredWidth, int spaceToRight) {
|
public void relocateComponentX(Component c, int containerWidth, int preferredWidth, int spaceToRight) {
|
||||||
int intGapToRight = spaceToRight + c.getPreferredSize().width;
|
int intGapToRight = spaceToRight + c.getPreferredSize().width;
|
||||||
int newLocationX = containerWidth - intGapToRight;
|
int newLocationX = containerWidth - intGapToRight;
|
||||||
if (newLocationX < preferredWidth -intGapToRight) {
|
if (newLocationX < preferredWidth - intGapToRight) {
|
||||||
newLocationX = preferredWidth - intGapToRight;
|
newLocationX = preferredWidth - intGapToRight;
|
||||||
}
|
}
|
||||||
c.setLocation(newLocationX, c.getLocation().y);
|
c.setLocation(newLocationX, c.getLocation().y);
|
||||||
@ -221,10 +226,11 @@ public class IInternalFrame extends JInternalFrame implements ActionListener, Co
|
|||||||
* @param spaceToBottom
|
* @param spaceToBottom
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void relocateComponentY(Component c, int containerHeight, int spaceToBottom) {
|
public void relocateComponentY(Component c, int containerHeight, int preferredHeight, int spaceToBottom) {
|
||||||
int newLocationY = containerHeight - spaceToBottom;
|
int intGapToBottom = spaceToBottom + c.getPreferredSize().height;
|
||||||
if (newLocationY < DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT - spaceToBottom) {
|
int newLocationY = containerHeight - intGapToBottom;
|
||||||
newLocationY = DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT - spaceToBottom;
|
if (newLocationY < preferredHeight - spaceToBottom) {
|
||||||
|
newLocationY = preferredHeight - spaceToBottom;
|
||||||
}
|
}
|
||||||
c.setLocation(c.getLocation().x, newLocationY);
|
c.setLocation(c.getLocation().x, newLocationY);
|
||||||
c.validate();
|
c.validate();
|
||||||
@ -240,10 +246,10 @@ public class IInternalFrame extends JInternalFrame implements ActionListener, Co
|
|||||||
* @param spaceToRight
|
* @param spaceToRight
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void relocateComponent(Component c, int containerWidth, int containerHeight, int spaceToBottom,
|
public void relocateComponent(Component c, int containerWidth, int containerHeight, int preferredWidht,
|
||||||
int spaceToRight, int preferredWidht, int preferredHeight) {
|
int preferredHeight, int spaceToRight, int spaceToBottom) {
|
||||||
relocateComponentX(c, containerWidth, preferredWidht, spaceToBottom);
|
relocateComponentX(c, containerWidth, preferredWidht, spaceToRight);
|
||||||
relocateComponentY(c, containerHeight, spaceToRight);
|
relocateComponentY(c, containerHeight, preferredHeight, spaceToBottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showStandard() {
|
public void showStandard() {
|
||||||
@ -272,4 +278,39 @@ public class IInternalFrame extends JInternalFrame implements ActionListener, Co
|
|||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void valueChanged(ListSelectionEvent arg0) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void tableChanged(TableModelEvent arg0) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mouseClicked(MouseEvent arg0) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mouseEntered(MouseEvent arg0) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mouseExited(MouseEvent arg0) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mousePressed(MouseEvent arg0) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mouseReleased(MouseEvent arg0) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -238,12 +238,19 @@ public class ITree extends JTree {
|
|||||||
if (iNode.getId().equals(id) && iNode.getCategory() == category) {
|
if (iNode.getId().equals(id) && iNode.getCategory() == category) {
|
||||||
return iNode;
|
return iNode;
|
||||||
}
|
}
|
||||||
|
IDefaultMutableTreeNode childNode = getNodeById(iNode, id, category);
|
||||||
|
if (childNode != null) {
|
||||||
|
return childNode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreePath getPathOfNode(IDefaultMutableTreeNode node) {
|
public TreePath getPathOfNode(IDefaultMutableTreeNode node) {
|
||||||
TreePath treePath = new TreePath(treeModel.getPathToRoot(node));
|
if (node != null) {
|
||||||
return treePath;
|
TreePath treePath = new TreePath(treeModel.getPathToRoot(node));
|
||||||
|
return treePath;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,22 @@ public class ICheckBoxList extends JList {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get All Checked Items index of the CheckBoxList component.
|
||||||
|
|
||||||
|
@return All Checked Items index
|
||||||
|
**/
|
||||||
|
public Vector<Integer> getAllCheckedItemsIndex() {
|
||||||
|
Vector<Integer> result = new Vector<Integer>();
|
||||||
|
|
||||||
|
for (int i = 0; i < this.getModel().getSize(); i++) {
|
||||||
|
if (((ICheckBoxListItem) this.getModel().getElementAt(i)).isChecked()) {
|
||||||
|
result.addElement(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get All Checked Items String of the CheckBoxList component.
|
Get All Checked Items String of the CheckBoxList component.
|
||||||
|
|
||||||
|
@ -86,4 +86,11 @@ public class LibraryClassVector {
|
|||||||
public int size() {
|
public int size() {
|
||||||
return this.vLibraryClass.size();
|
return this.vLibraryClass.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Vector<String> toStringVector(int index) {
|
||||||
|
Vector<String> v = new Vector<String>();
|
||||||
|
v.addElement(getLibraryClass(index).getLibraryClassName());
|
||||||
|
v.addElement(getLibraryClass(index).getUsage());
|
||||||
|
return v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,44 +16,69 @@
|
|||||||
package org.tianocore.frameworkwizard.module.Identifications;
|
package org.tianocore.frameworkwizard.module.Identifications;
|
||||||
|
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.apache.xmlbeans.XmlException;
|
||||||
|
import org.tianocore.LibraryUsage;
|
||||||
|
import org.tianocore.LibraryClassDefinitionsDocument.LibraryClassDefinitions;
|
||||||
|
import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
|
||||||
|
import org.tianocore.frameworkwizard.common.DataType;
|
||||||
import org.tianocore.frameworkwizard.common.Identifications.Identification;
|
import org.tianocore.frameworkwizard.common.Identifications.Identification;
|
||||||
|
import org.tianocore.frameworkwizard.common.Identifications.OpenFile;
|
||||||
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
|
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
|
||||||
|
|
||||||
public class ModuleIdentification extends Identification {
|
public class ModuleIdentification extends Identification {
|
||||||
|
|
||||||
private PackageIdentification packageId;
|
private PackageIdentification packageId;
|
||||||
|
|
||||||
|
private String moduleType;
|
||||||
|
|
||||||
|
private boolean isLibrary;
|
||||||
|
|
||||||
public ModuleIdentification(String name, String guid, String version, String path) {
|
public ModuleIdentification(String name, String guid, String version, String path) {
|
||||||
super(name, guid, version, path);
|
super(name, guid, version, path);
|
||||||
|
setModuleType();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModuleIdentification(Identification id) {
|
public ModuleIdentification(String name, String guid, String version, String path, boolean library) {
|
||||||
|
super(name, guid, version, path);
|
||||||
|
this.isLibrary = library;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModuleIdentification(Identification id, boolean library) {
|
||||||
super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
|
super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
|
||||||
|
this.isLibrary = library;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModuleIdentification(String name, String guid, String version, String path, PackageIdentification packageId){
|
public ModuleIdentification(String name, String guid, String version, String path, PackageIdentification packageId){
|
||||||
super(name, guid, version, path);
|
super(name, guid, version, path);
|
||||||
this.packageId = packageId;
|
this.packageId = packageId;
|
||||||
|
setModuleType();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModuleIdentification(String name, String guid, String version, String path, PackageIdentification packageId, String type){
|
||||||
|
super(name, guid, version, path);
|
||||||
|
this.packageId = packageId;
|
||||||
|
this.moduleType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModuleIdentification(Identification id, PackageIdentification packageId) {
|
public ModuleIdentification(Identification id, PackageIdentification packageId) {
|
||||||
super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
|
super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
|
||||||
this.packageId = packageId;
|
this.packageId = packageId;
|
||||||
|
setModuleType();
|
||||||
}
|
}
|
||||||
|
|
||||||
// public boolean equals(Object obj) {
|
public ModuleIdentification(Identification id, PackageIdentification packageId, boolean library) {
|
||||||
// if (obj instanceof Identification) {
|
super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
|
||||||
// Identification id = (Identification)obj;
|
this.packageId = packageId;
|
||||||
// if ( this.getName().equalsIgnoreCase(id.getName())) {
|
this.isLibrary = library;
|
||||||
// return true;
|
}
|
||||||
// }
|
|
||||||
// // and package is the same one
|
public ModuleIdentification(Identification id, PackageIdentification packageId, String type) {
|
||||||
// return false;
|
super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
|
||||||
// }
|
this.packageId = packageId;
|
||||||
// else {
|
this.moduleType = type;
|
||||||
// return super.equals(obj);
|
}
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
public String toString(){
|
public String toString(){
|
||||||
return "Module " + this.getName() + "[" + this.getGuid() + "] in package " + packageId;
|
return "Module " + this.getName() + "[" + this.getGuid() + "] in package " + packageId;
|
||||||
@ -66,4 +91,50 @@ public class ModuleIdentification extends Identification {
|
|||||||
public void setPackageId(PackageIdentification packageId) {
|
public void setPackageId(PackageIdentification packageId) {
|
||||||
this.packageId = packageId;
|
this.packageId = packageId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getModuleType() {
|
||||||
|
return moduleType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModuleType(String moduleType) {
|
||||||
|
this.moduleType = moduleType;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setModuleType() {
|
||||||
|
ModuleSurfaceArea msa = null;
|
||||||
|
try {
|
||||||
|
msa = OpenFile.openMsaFile(this.getPath());
|
||||||
|
} catch (IOException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
|
||||||
|
} catch (XmlException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
|
||||||
|
}
|
||||||
|
setModuleType(DataType.MODULE_TYPE_MODULE);
|
||||||
|
setLibrary(false);
|
||||||
|
if (msa != null) {
|
||||||
|
LibraryClassDefinitions lib = msa.getLibraryClassDefinitions();
|
||||||
|
if (lib != null) {
|
||||||
|
for (int index = 0; index < lib.getLibraryClassList().size(); index++) {
|
||||||
|
if (lib.getLibraryClassList().get(index).getUsage().equals(LibraryUsage.ALWAYS_PRODUCED)) {
|
||||||
|
setModuleType(DataType.MODULE_TYPE_LIBRARY);
|
||||||
|
setLibrary(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isLibrary() {
|
||||||
|
return isLibrary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLibrary(boolean isLibrary) {
|
||||||
|
this.isLibrary = isLibrary;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,17 +14,11 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
package org.tianocore.frameworkwizard.packaging;
|
package org.tianocore.frameworkwizard.packaging;
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import org.tianocore.frameworkwizard.common.Identifications.Identification;
|
import org.tianocore.frameworkwizard.common.Identifications.Identification;
|
||||||
|
|
||||||
public class PackageIdentification extends Identification{
|
public class PackageIdentification extends Identification{
|
||||||
|
|
||||||
//
|
|
||||||
// It is optional
|
|
||||||
//
|
|
||||||
private File spdFile;
|
|
||||||
|
|
||||||
public PackageIdentification(String name, String guid, String version){
|
public PackageIdentification(String name, String guid, String version){
|
||||||
super(name, guid, version);
|
super(name, guid, version);
|
||||||
}
|
}
|
||||||
@ -36,25 +30,4 @@ public class PackageIdentification extends Identification{
|
|||||||
public PackageIdentification(Identification id){
|
public PackageIdentification(Identification id){
|
||||||
super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
|
super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
public PackageIdentification(String name, String guid, String version, File spdFile){
|
|
||||||
super(name, guid, version);
|
|
||||||
this.spdFile = spdFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public File getSpdFile() {
|
|
||||||
return spdFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString(){
|
|
||||||
return "Package " + this.getName() + "[" + this.getGuid() + "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpdFile(File spdFile) {
|
|
||||||
this.spdFile = spdFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPackageDir(){
|
|
||||||
return spdFile.getParent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -15,36 +15,15 @@
|
|||||||
|
|
||||||
package org.tianocore.frameworkwizard.platform;
|
package org.tianocore.frameworkwizard.platform;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import org.tianocore.frameworkwizard.common.Identifications.Identification;
|
import org.tianocore.frameworkwizard.common.Identifications.Identification;
|
||||||
|
|
||||||
public class PlatformIdentification extends Identification{
|
public class PlatformIdentification extends Identification{
|
||||||
|
|
||||||
private File fpdFile;
|
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlatformIdentification(String name, String guid, String version, File fpdFile){
|
|
||||||
super(name, guid, version);
|
|
||||||
this.fpdFile = fpdFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PlatformIdentification(Identification id){
|
public PlatformIdentification(Identification id){
|
||||||
super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
|
super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString(){
|
|
||||||
return "Platform " + this.getName() + "[" + this.getGuid() + "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFpdFile(File fpdFile) {
|
|
||||||
this.fpdFile = fpdFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public File getFpdFile() {
|
|
||||||
return fpdFile;
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -89,11 +89,11 @@ public class WorkspaceTools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (XmlException e) {
|
} catch (XmlException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
return modulePath;
|
return modulePath;
|
||||||
}
|
}
|
||||||
@ -117,11 +117,11 @@ public class WorkspaceTools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (XmlException e) {
|
} catch (XmlException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
return includePath;
|
return includePath;
|
||||||
}
|
}
|
||||||
@ -147,22 +147,54 @@ public class WorkspaceTools {
|
|||||||
vPackageList.addElement(new PackageIdentification(id));
|
vPackageList.addElement(new PackageIdentification(id));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.err("Open Package Surface Area " + path, e.getMessage());
|
Log.err("Open Package Surface Area " + path, e.getMessage());
|
||||||
e.printStackTrace();
|
|
||||||
} catch (XmlException e) {
|
} catch (XmlException e) {
|
||||||
Log.err("Open Package Surface Area " + path, e.getMessage());
|
Log.err("Open Package Surface Area " + path, e.getMessage());
|
||||||
e.printStackTrace();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.err("Open Package Surface Area " + path, "Invalid file type");
|
Log.err("Open Package Surface Area " + path, "Invalid file type");
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Tools.sortPackages(vPackageList, DataType.SORT_TYPE_ASCENDING);
|
||||||
return vPackageList;
|
return vPackageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get all package basic information form the FrameworkDatabase.db file
|
Get all module basic information from a package
|
||||||
|
|
||||||
@return vPackageList A vector includes all packages' basic information
|
@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);
|
||||||
|
id = getId(modulePath, OpenFile.openMsaFile(modulePath));
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.log("Error when Open Module Surface Area " + modulePath, e.getMessage());
|
||||||
|
} catch (XmlException e) {
|
||||||
|
Log.log("Error when Open Module Surface Area " + modulePath, e.getMessage());
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.log("Error when Open Module Surface Area " + modulePath, "Invalid file type " + e.getMessage());
|
||||||
|
}
|
||||||
|
v.addElement(new ModuleIdentification(id, pid));
|
||||||
|
}
|
||||||
|
Tools.sortModules(v, DataType.SORT_TYPE_ASCENDING);
|
||||||
|
return v;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get all module basic information form the FrameworkDatabase.db file
|
||||||
|
|
||||||
|
@return vModuleList A vector includes all modules' basic information
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public Vector<ModuleIdentification> getAllModules() {
|
public Vector<ModuleIdentification> getAllModules() {
|
||||||
@ -190,17 +222,14 @@ public class WorkspaceTools {
|
|||||||
vModuleList.addElement(new ModuleIdentification(id, vPackageList.elementAt(indexI)));
|
vModuleList.addElement(new ModuleIdentification(id, vPackageList.elementAt(indexI)));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.err("Open Module Surface Area " + modulePath, e.getMessage());
|
Log.err("Open Module Surface Area " + modulePath, e.getMessage());
|
||||||
e.printStackTrace();
|
|
||||||
} catch (XmlException e) {
|
} catch (XmlException e) {
|
||||||
Log.err("Open Module Surface Area " + modulePath, e.getMessage());
|
Log.err("Open Module Surface Area " + modulePath, e.getMessage());
|
||||||
e.printStackTrace();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.err("Open Module Surface Area " + modulePath, "Invalid file type");
|
Log.err("Open Module Surface Area " + modulePath, "Invalid file type");
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Tools.sortModules(vModuleList, DataType.SORT_TYPE_ASCENDING);
|
||||||
return vModuleList;
|
return vModuleList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,15 +254,13 @@ public class WorkspaceTools {
|
|||||||
vPlatformList.addElement(new PlatformIdentification(id));
|
vPlatformList.addElement(new PlatformIdentification(id));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.err("Open Platform Surface Area " + path, e.getMessage());
|
Log.err("Open Platform Surface Area " + path, e.getMessage());
|
||||||
e.printStackTrace();
|
|
||||||
} catch (XmlException e) {
|
} catch (XmlException e) {
|
||||||
Log.err("Open Platform Surface Area " + path, e.getMessage());
|
Log.err("Open Platform Surface Area " + path, e.getMessage());
|
||||||
e.printStackTrace();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.err("Open Platform Surface Area " + path, "Invalid file type");
|
Log.err("Open Platform Surface Area " + path, "Invalid file type");
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Tools.sortPlatforms(vPlatformList, DataType.SORT_TYPE_ASCENDING);
|
||||||
return vPlatformList;
|
return vPlatformList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,6 +278,7 @@ public class WorkspaceTools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,6 +296,7 @@ public class WorkspaceTools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,6 +314,7 @@ public class WorkspaceTools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,6 +332,7 @@ public class WorkspaceTools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,6 +350,7 @@ public class WorkspaceTools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,15 +372,13 @@ public class WorkspaceTools {
|
|||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
} catch (XmlException e) {
|
} catch (XmlException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -368,15 +398,13 @@ public class WorkspaceTools {
|
|||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
} catch (XmlException e) {
|
} catch (XmlException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -396,15 +424,13 @@ public class WorkspaceTools {
|
|||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
} catch (XmlException e) {
|
} catch (XmlException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -424,15 +450,13 @@ public class WorkspaceTools {
|
|||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
} catch (XmlException e) {
|
} catch (XmlException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -452,15 +476,13 @@ public class WorkspaceTools {
|
|||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
} catch (XmlException e) {
|
} catch (XmlException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -495,11 +517,11 @@ public class WorkspaceTools {
|
|||||||
return vPackageList.elementAt(indexI);
|
return vPackageList.elementAt(indexI);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (XmlException e) {
|
} catch (XmlException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user