mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 08:04:07 +02:00
1. Fix EDKT193 "Provide a Module tree when platform/package are open"
2. Fix bugs in Clone git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1497 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
274a3dbda1
commit
09ef924264
@ -36,6 +36,7 @@ import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
|
|||||||
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.FileOperation;
|
import org.tianocore.frameworkwizard.common.FileOperation;
|
||||||
|
import org.tianocore.frameworkwizard.common.GlobalData;
|
||||||
import org.tianocore.frameworkwizard.common.IFileFilter;
|
import org.tianocore.frameworkwizard.common.IFileFilter;
|
||||||
import org.tianocore.frameworkwizard.common.Log;
|
import org.tianocore.frameworkwizard.common.Log;
|
||||||
import org.tianocore.frameworkwizard.common.OpenFile;
|
import org.tianocore.frameworkwizard.common.OpenFile;
|
||||||
@ -775,6 +776,12 @@ public class Clone extends IDialog {
|
|||||||
//
|
//
|
||||||
wt.addModuleToPackage(mid, psa);
|
wt.addModuleToPackage(mid, psa);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Update GlobalData
|
||||||
|
//
|
||||||
|
GlobalData.vModuleList.addElement(mid);
|
||||||
|
GlobalData.openingModuleList.insertToOpeningModuleList(mid, msa);
|
||||||
|
|
||||||
this.returnType = DataType.RETURN_TYPE_MODULE_SURFACE_AREA;
|
this.returnType = DataType.RETURN_TYPE_MODULE_SURFACE_AREA;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -832,6 +839,12 @@ public class Clone extends IDialog {
|
|||||||
//
|
//
|
||||||
wt.addPackageToDatabase(pid);
|
wt.addPackageToDatabase(pid);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Update GlobalData
|
||||||
|
//
|
||||||
|
GlobalData.vPackageList.addElement(pid);
|
||||||
|
GlobalData.openingPackageList.insertToOpeningPackageList(pid, spd);
|
||||||
|
|
||||||
this.returnType = DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA;
|
this.returnType = DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -869,6 +882,12 @@ public class Clone extends IDialog {
|
|||||||
//
|
//
|
||||||
wt.addPlatformToDatabase(fid);
|
wt.addPlatformToDatabase(fid);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Update GlobalData
|
||||||
|
//
|
||||||
|
GlobalData.vPlatformList.addElement(fid);
|
||||||
|
GlobalData.openingPlatformList.insertToOpeningPlatformList(fid, fpd);
|
||||||
|
|
||||||
this.returnType = DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA;
|
this.returnType = DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA;
|
||||||
}
|
}
|
||||||
vFiles = null;
|
vFiles = null;
|
||||||
@ -1016,7 +1035,7 @@ 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);
|
String guid = wt.getPackageFarGuid(oldId);
|
||||||
if (guid != null && !guid.equals("")) {
|
if (guid != null && !guid.equals("")) {
|
||||||
c.setFarGuid(guid);
|
c.setFarGuid(guid);
|
||||||
}
|
}
|
||||||
@ -1072,7 +1091,7 @@ 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);
|
String guid = wt.getPlatformFarGuid(oldId);
|
||||||
if (guid != null && !guid.equals("")) {
|
if (guid != null && !guid.equals("")) {
|
||||||
c.setFarGuid(guid);
|
c.setFarGuid(guid);
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,8 @@ import java.awt.event.MouseEvent;
|
|||||||
import java.awt.event.MouseListener;
|
import java.awt.event.MouseListener;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
@ -43,6 +45,7 @@ import javax.swing.event.MenuEvent;
|
|||||||
import javax.swing.event.MenuListener;
|
import javax.swing.event.MenuListener;
|
||||||
import javax.swing.event.TreeSelectionEvent;
|
import javax.swing.event.TreeSelectionEvent;
|
||||||
import javax.swing.event.TreeSelectionListener;
|
import javax.swing.event.TreeSelectionListener;
|
||||||
|
import javax.swing.tree.TreePath;
|
||||||
|
|
||||||
import org.apache.xmlbeans.XmlException;
|
import org.apache.xmlbeans.XmlException;
|
||||||
import org.tianocore.PackageSurfaceAreaDocument;
|
import org.tianocore.PackageSurfaceAreaDocument;
|
||||||
@ -1934,12 +1937,13 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
//
|
//
|
||||||
// Make root
|
// Make root
|
||||||
//
|
//
|
||||||
dmtnRoot = new IDefaultMutableTreeNode("WORKSPACE", IDefaultMutableTreeNode.WORKSPACE, -1);
|
dmtnRoot = new IDefaultMutableTreeNode("WORKSPACE", IDefaultMutableTreeNode.WORKSPACE, false, null, null);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Make Module Description
|
// Make Module Description
|
||||||
//
|
//
|
||||||
dmtnModuleDescription = new IDefaultMutableTreeNode("Modules", IDefaultMutableTreeNode.MODULE, -1);
|
dmtnModuleDescription = new IDefaultMutableTreeNode("Modules", IDefaultMutableTreeNode.MODULE_DESCRIPTION,
|
||||||
|
false, null, dmtnRoot);
|
||||||
|
|
||||||
//
|
//
|
||||||
// First add package
|
// First add package
|
||||||
@ -1952,13 +1956,16 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
|
|
||||||
dmtnModulePackage = new IDefaultMutableTreeNode(GlobalData.vPackageList.elementAt(index).getName(),
|
dmtnModulePackage = new IDefaultMutableTreeNode(GlobalData.vPackageList.elementAt(index).getName(),
|
||||||
IDefaultMutableTreeNode.MODULE_PACKAGE, false,
|
IDefaultMutableTreeNode.MODULE_PACKAGE, false,
|
||||||
GlobalData.vPackageList.elementAt(index));
|
GlobalData.vPackageList.elementAt(index),
|
||||||
|
this.dmtnModuleDescription);
|
||||||
dmtnModulePackageLibrary = new IDefaultMutableTreeNode("Library",
|
dmtnModulePackageLibrary = new IDefaultMutableTreeNode("Library",
|
||||||
IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY,
|
IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY,
|
||||||
false, GlobalData.vPackageList.elementAt(index));
|
false, GlobalData.vPackageList.elementAt(index),
|
||||||
|
this.dmtnModuleDescription);
|
||||||
dmtnModulePackageModule = new IDefaultMutableTreeNode("Module",
|
dmtnModulePackageModule = new IDefaultMutableTreeNode("Module",
|
||||||
IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
|
IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
|
||||||
false, GlobalData.vPackageList.elementAt(index));
|
false, GlobalData.vPackageList.elementAt(index),
|
||||||
|
this.dmtnModuleDescription);
|
||||||
//
|
//
|
||||||
// And then add each module in its package
|
// And then add each module in its package
|
||||||
//
|
//
|
||||||
@ -1967,11 +1974,13 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
if (vModule.get(indexJ).isLibrary()) {
|
if (vModule.get(indexJ).isLibrary()) {
|
||||||
dmtnModulePackageLibrary.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
|
dmtnModulePackageLibrary.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
|
||||||
IDefaultMutableTreeNode.MODULE, false,
|
IDefaultMutableTreeNode.MODULE, false,
|
||||||
vModule.get(indexJ)));
|
vModule.get(indexJ),
|
||||||
|
this.dmtnModuleDescription));
|
||||||
} else {
|
} else {
|
||||||
dmtnModulePackageModule.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
|
dmtnModulePackageModule.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
|
||||||
IDefaultMutableTreeNode.MODULE, false,
|
IDefaultMutableTreeNode.MODULE, false,
|
||||||
vModule.get(indexJ)));
|
vModule.get(indexJ),
|
||||||
|
this.dmtnModuleDescription));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dmtnModulePackageModule.getChildCount() > 0) {
|
if (dmtnModulePackageModule.getChildCount() > 0) {
|
||||||
@ -1988,26 +1997,31 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
//
|
//
|
||||||
// Make Package Description
|
// Make Package Description
|
||||||
//
|
//
|
||||||
dmtnPackageDescription = new IDefaultMutableTreeNode("Packages", IDefaultMutableTreeNode.PACKAGE, -1);
|
dmtnPackageDescription = new IDefaultMutableTreeNode("Packages", IDefaultMutableTreeNode.PACKAGE_DESCRIPTION,
|
||||||
|
false, null, this.dmtnRoot);
|
||||||
if (GlobalData.vPackageList.size() > 0) {
|
if (GlobalData.vPackageList.size() > 0) {
|
||||||
for (int index = 0; index < GlobalData.vPackageList.size(); index++) {
|
for (int index = 0; index < GlobalData.vPackageList.size(); index++) {
|
||||||
dmtnPackageDescription.add(new IDefaultMutableTreeNode(GlobalData.vPackageList.elementAt(index)
|
dmtnPackageDescription.add(new IDefaultMutableTreeNode(GlobalData.vPackageList.elementAt(index)
|
||||||
.getName(),
|
.getName(),
|
||||||
IDefaultMutableTreeNode.PACKAGE, false,
|
IDefaultMutableTreeNode.PACKAGE, false,
|
||||||
GlobalData.vPackageList.elementAt(index)));
|
GlobalData.vPackageList.elementAt(index),
|
||||||
|
this.dmtnPackageDescription));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Make Platform Description
|
// Make Platform Description
|
||||||
//
|
//
|
||||||
dmtnPlatformDescription = new IDefaultMutableTreeNode("Platforms", IDefaultMutableTreeNode.PLATFORM, -1);
|
dmtnPlatformDescription = new IDefaultMutableTreeNode("Platforms",
|
||||||
|
IDefaultMutableTreeNode.PLATFORM_DESCRIPTION, false,
|
||||||
|
null, this.dmtnRoot);
|
||||||
if (GlobalData.vPlatformList.size() > 0) {
|
if (GlobalData.vPlatformList.size() > 0) {
|
||||||
for (int index = 0; index < GlobalData.vPlatformList.size(); index++) {
|
for (int index = 0; index < GlobalData.vPlatformList.size(); index++) {
|
||||||
dmtnPlatformDescription.add(new IDefaultMutableTreeNode(GlobalData.vPlatformList.elementAt(index)
|
dmtnPlatformDescription.add(new IDefaultMutableTreeNode(GlobalData.vPlatformList.elementAt(index)
|
||||||
.getName(),
|
.getName(),
|
||||||
IDefaultMutableTreeNode.PLATFORM, false,
|
IDefaultMutableTreeNode.PLATFORM, false,
|
||||||
GlobalData.vPlatformList.elementAt(index)));
|
GlobalData.vPlatformList.elementAt(index),
|
||||||
|
this.dmtnPlatformDescription));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2040,10 +2054,6 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void mouseClicked(MouseEvent arg0) {
|
public void mouseClicked(MouseEvent arg0) {
|
||||||
if (arg0.getButton() == MouseEvent.BUTTON1) {
|
|
||||||
}
|
|
||||||
if (arg0.getButton() == MouseEvent.BUTTON3) {
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// When double click
|
// When double click
|
||||||
//
|
//
|
||||||
@ -2141,8 +2151,8 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
//
|
//
|
||||||
// Add new MsaHeader node to the tree
|
// Add new MsaHeader node to the tree
|
||||||
//
|
//
|
||||||
IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(mid.getName(), IDefaultMutableTreeNode.MODULE, true,
|
IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(mid.getName(), IDefaultMutableTreeNode.MODULE,
|
||||||
mid);
|
false, mid, this.dmtnModuleDescription);
|
||||||
//
|
//
|
||||||
// First find the module belongs to which package
|
// First find the module belongs to which package
|
||||||
//
|
//
|
||||||
@ -2176,7 +2186,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
//
|
//
|
||||||
if (!hasModule) {
|
if (!hasModule) {
|
||||||
parentModuleNode = new IDefaultMutableTreeNode("Module", IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
|
parentModuleNode = new IDefaultMutableTreeNode("Module", IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
|
||||||
false, mid.getPackageId());
|
false, mid.getPackageId(), this.dmtnModuleDescription);
|
||||||
iTree.addNode(packageNode, parentModuleNode);
|
iTree.addNode(packageNode, parentModuleNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2193,7 +2203,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
if (!hasLibrary) {
|
if (!hasLibrary) {
|
||||||
parentLibraryNode = new IDefaultMutableTreeNode("Library",
|
parentLibraryNode = new IDefaultMutableTreeNode("Library",
|
||||||
IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY, false,
|
IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY, false,
|
||||||
mid.getPackageId());
|
mid.getPackageId(), this.dmtnModuleDescription);
|
||||||
iTree.addNode(packageNode, parentLibraryNode);
|
iTree.addNode(packageNode, parentLibraryNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2207,7 +2217,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
@param path input file path
|
@param path input file path
|
||||||
|
|
||||||
**/
|
**/
|
||||||
private void openModule(String path) {
|
private void openModule(String path, IDefaultMutableTreeNode belongNode) {
|
||||||
ModuleIdentification id = GlobalData.openingModuleList.getIdByPath(path);
|
ModuleIdentification id = GlobalData.openingModuleList.getIdByPath(path);
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
//
|
//
|
||||||
@ -2220,29 +2230,33 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
//
|
//
|
||||||
// Make the node selected
|
// Make the node selected
|
||||||
//
|
//
|
||||||
iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id,
|
iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(belongNode, id, IDefaultMutableTreeNode.MODULE)));
|
||||||
IDefaultMutableTreeNode.MODULE)));
|
|
||||||
//
|
//
|
||||||
// Update opening Module list information
|
// Update opening Module list information
|
||||||
//
|
//
|
||||||
if (!GlobalData.openingModuleList.getModuleOpen(id)) {
|
if (!iTree.getSelectNode().isOpening()) {
|
||||||
//
|
//
|
||||||
// Insert sub node of module
|
// Insert sub node of module
|
||||||
//
|
//
|
||||||
insertModuleTreeNode(id);
|
insertModuleTreeNode(id, belongNode);
|
||||||
iTree.getSelectNode().setOpening(true);
|
iTree.getSelectNode().setOpening(true);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Update opening module list
|
// Update opening module list
|
||||||
//
|
//
|
||||||
GlobalData.openingModuleList.setModuleOpen(id, true);
|
GlobalData.openingModuleList.setModuleOpen(id, true);
|
||||||
GlobalData.openingModuleList.setTreePathById(id, iTree.getSelectionPath());
|
Set<TreePath> temp = GlobalData.openingModuleList.getTreePathById(id);
|
||||||
|
temp.add(iTree.getSelectionPath());
|
||||||
|
GlobalData.openingModuleList.setTreePathById(id, temp);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Select msa header node and show it in editor panel
|
// Select msa header node and show it in editor panel
|
||||||
//
|
//
|
||||||
iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id,
|
iTree
|
||||||
IDefaultMutableTreeNode.MSA_HEADER)));
|
.setSelectionPath(iTree
|
||||||
|
.getPathOfNode(iTree
|
||||||
|
.getNodeById(belongNode, id, IDefaultMutableTreeNode.MSA_HEADER)));
|
||||||
showModuleElement(IDefaultMutableTreeNode.MSA_HEADER, GlobalData.openingModuleList.getOpeningModuleById(id));
|
showModuleElement(IDefaultMutableTreeNode.MSA_HEADER, GlobalData.openingModuleList.getOpeningModuleById(id));
|
||||||
this.currentOpeningModuleIndex = GlobalData.openingModuleList.findIndexOfListById(id);
|
this.currentOpeningModuleIndex = GlobalData.openingModuleList.findIndexOfListById(id);
|
||||||
}
|
}
|
||||||
@ -2282,7 +2296,9 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
// Update opening module list
|
// Update opening module list
|
||||||
//
|
//
|
||||||
GlobalData.openingPackageList.setPackageOpen(id, true);
|
GlobalData.openingPackageList.setPackageOpen(id, true);
|
||||||
GlobalData.openingPackageList.setTreePathById(id, iTree.getSelectionPath());
|
Set<TreePath> temp = GlobalData.openingPackageList.getTreePathById(id);
|
||||||
|
temp.add(iTree.getSelectionPath());
|
||||||
|
GlobalData.openingPackageList.setTreePathById(id, temp);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Show spd header in editor panel
|
// Show spd header in editor panel
|
||||||
@ -2328,7 +2344,9 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
// Update opening module list
|
// Update opening module list
|
||||||
//
|
//
|
||||||
GlobalData.openingPlatformList.setPlatformOpen(id, true);
|
GlobalData.openingPlatformList.setPlatformOpen(id, true);
|
||||||
GlobalData.openingPlatformList.setTreePathById(id, iTree.getSelectionPath());
|
Set<TreePath> temp = GlobalData.openingPlatformList.getTreePathById(id);
|
||||||
|
temp.add(iTree.getSelectionPath());
|
||||||
|
GlobalData.openingPlatformList.setTreePathById(id, temp);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Show fpd header in editor panel
|
// Show fpd header in editor panel
|
||||||
@ -2433,56 +2451,136 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void insertModuleTreeNode(Identification id) {
|
private void insertModuleTreeNode(Identification id, IDefaultMutableTreeNode belongNode) {
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Module Header", IDefaultMutableTreeNode.MSA_HEADER, true, id));
|
iTree.addNode(new IDefaultMutableTreeNode("Module Header", IDefaultMutableTreeNode.MSA_HEADER, true, id,
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Source Files", IDefaultMutableTreeNode.MSA_SOURCEFILES, true, id));
|
belongNode));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Source Files", IDefaultMutableTreeNode.MSA_SOURCEFILES, true, id,
|
||||||
|
belongNode));
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Library Class Definitions",
|
iTree.addNode(new IDefaultMutableTreeNode("Library Class Definitions",
|
||||||
IDefaultMutableTreeNode.MSA_LIBRARYCLASSDEFINITIONS, true, id));
|
IDefaultMutableTreeNode.MSA_LIBRARYCLASSDEFINITIONS, true, id,
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Package Dependencies",
|
belongNode));
|
||||||
IDefaultMutableTreeNode.MSA_PACKAGEDEPENDENCIES, true, id));
|
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Protocols", IDefaultMutableTreeNode.MSA_PROTOCOLS, true, id));
|
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Events", IDefaultMutableTreeNode.MSA_EVENTS, true, id));
|
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Hobs", IDefaultMutableTreeNode.MSA_HOBS, true, id));
|
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Ppis", IDefaultMutableTreeNode.MSA_PPIS, true, id));
|
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Variables", IDefaultMutableTreeNode.MSA_VARIABLES, true, id));
|
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Boot Modes", IDefaultMutableTreeNode.MSA_BOOTMODES, true, id));
|
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("System Tables", IDefaultMutableTreeNode.MSA_SYSTEMTABLES, true, id));
|
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Data Hubs", IDefaultMutableTreeNode.MSA_DATAHUBS, true, id));
|
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Hii Packages", IDefaultMutableTreeNode.MSA_HIIPACKAGES, true, id));
|
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Guids", IDefaultMutableTreeNode.MSA_GUIDS, true, id));
|
|
||||||
iTree
|
iTree
|
||||||
.addNode(new IDefaultMutableTreeNode("External Defintions", IDefaultMutableTreeNode.MSA_EXTERNS, true, id));
|
.addNode(new IDefaultMutableTreeNode("Package Dependencies",
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Pcd Coded", IDefaultMutableTreeNode.MSA_PCDS, true, id));
|
IDefaultMutableTreeNode.MSA_PACKAGEDEPENDENCIES, true, id, belongNode));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Protocols", IDefaultMutableTreeNode.MSA_PROTOCOLS, true, id,
|
||||||
|
belongNode));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Events", IDefaultMutableTreeNode.MSA_EVENTS, true, id, belongNode));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Hobs", IDefaultMutableTreeNode.MSA_HOBS, true, id, belongNode));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Ppis", IDefaultMutableTreeNode.MSA_PPIS, true, id, belongNode));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Variables", IDefaultMutableTreeNode.MSA_VARIABLES, true, id,
|
||||||
|
belongNode));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Boot Modes", IDefaultMutableTreeNode.MSA_BOOTMODES, true, id,
|
||||||
|
belongNode));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("System Tables", IDefaultMutableTreeNode.MSA_SYSTEMTABLES, true, id,
|
||||||
|
belongNode));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Data Hubs", IDefaultMutableTreeNode.MSA_DATAHUBS, true, id,
|
||||||
|
belongNode));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Hii Packages", IDefaultMutableTreeNode.MSA_HIIPACKAGES, true, id,
|
||||||
|
belongNode));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Guids", IDefaultMutableTreeNode.MSA_GUIDS, true, id, belongNode));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("External Defintions", IDefaultMutableTreeNode.MSA_EXTERNS, true, id,
|
||||||
|
belongNode));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Pcd Coded", IDefaultMutableTreeNode.MSA_PCDS, true, id, belongNode));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void insertPackageTreeNode(Identification id) {
|
private void insertPackageTreeNode(Identification id) {
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Package Header", IDefaultMutableTreeNode.SPD_HEADER, true, id));
|
IDefaultMutableTreeNode idmtTemp = this.dmtnPackageDescription;
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Package Header", IDefaultMutableTreeNode.SPD_HEADER, true, id,
|
||||||
|
idmtTemp));
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Library Class Declarations",
|
iTree.addNode(new IDefaultMutableTreeNode("Library Class Declarations",
|
||||||
IDefaultMutableTreeNode.SPD_LIBRARYCLASSDECLARATIONS, true, id));
|
IDefaultMutableTreeNode.SPD_LIBRARYCLASSDECLARATIONS, true, id,
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Msa Files", IDefaultMutableTreeNode.SPD_MSAFILES, false, id));
|
idmtTemp));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Msa Files", IDefaultMutableTreeNode.SPD_MSAFILES, false, id,
|
||||||
|
idmtTemp));
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Package Includes", IDefaultMutableTreeNode.SPD_PACKAGEHEADERS, true,
|
iTree.addNode(new IDefaultMutableTreeNode("Package Includes", IDefaultMutableTreeNode.SPD_PACKAGEHEADERS, true,
|
||||||
id));
|
id, idmtTemp));
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Guid Declarations", IDefaultMutableTreeNode.SPD_GUIDDECLARATIONS,
|
iTree.addNode(new IDefaultMutableTreeNode("Guid Declarations", IDefaultMutableTreeNode.SPD_GUIDDECLARATIONS,
|
||||||
true, id));
|
true, id, idmtTemp));
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Protocol Declarations",
|
iTree
|
||||||
IDefaultMutableTreeNode.SPD_PROTOCOLDECLARATIONS, true, id));
|
.addNode(new IDefaultMutableTreeNode("Protocol Declarations",
|
||||||
|
IDefaultMutableTreeNode.SPD_PROTOCOLDECLARATIONS, true, id, idmtTemp));
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Ppi Declarations", IDefaultMutableTreeNode.SPD_PPIDECLARATIONS,
|
iTree.addNode(new IDefaultMutableTreeNode("Ppi Declarations", IDefaultMutableTreeNode.SPD_PPIDECLARATIONS,
|
||||||
true, id));
|
true, id, idmtTemp));
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Pcd Declarations", IDefaultMutableTreeNode.SPD_PCDDECLARATIONS,
|
iTree.addNode(new IDefaultMutableTreeNode("Pcd Declarations", IDefaultMutableTreeNode.SPD_PCDDECLARATIONS,
|
||||||
true, id));
|
true, id, idmtTemp));
|
||||||
|
//
|
||||||
|
// Add modules in this package
|
||||||
|
//
|
||||||
|
IDefaultMutableTreeNode dmtnModulePackageLibrary = null;
|
||||||
|
IDefaultMutableTreeNode dmtnModulePackageModule = null;
|
||||||
|
|
||||||
|
dmtnModulePackageLibrary = new IDefaultMutableTreeNode("Library",
|
||||||
|
IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY, false,
|
||||||
|
id, idmtTemp);
|
||||||
|
dmtnModulePackageModule = new IDefaultMutableTreeNode("Module", IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
|
||||||
|
false, id, idmtTemp);
|
||||||
|
|
||||||
|
Vector<ModuleIdentification> vModule = wt.getAllModules(new PackageIdentification(id));
|
||||||
|
for (int indexJ = 0; indexJ < vModule.size(); indexJ++) {
|
||||||
|
if (vModule.get(indexJ).isLibrary()) {
|
||||||
|
dmtnModulePackageLibrary.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
|
||||||
|
IDefaultMutableTreeNode.MODULE, false,
|
||||||
|
vModule.get(indexJ), idmtTemp));
|
||||||
|
} else {
|
||||||
|
dmtnModulePackageModule.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
|
||||||
|
IDefaultMutableTreeNode.MODULE, false,
|
||||||
|
vModule.get(indexJ), idmtTemp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dmtnModulePackageModule.getChildCount() > 0) {
|
||||||
|
iTree.addNode(dmtnModulePackageModule);
|
||||||
|
}
|
||||||
|
if (dmtnModulePackageLibrary.getChildCount() > 0) {
|
||||||
|
iTree.addNode(dmtnModulePackageLibrary);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void insertPlatformTreeNode(Identification id) {
|
private void insertPlatformTreeNode(Identification id) {
|
||||||
|
IDefaultMutableTreeNode idmtTemp = this.dmtnPlatformDescription;
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Platform Header", IDefaultMutableTreeNode.FPD_PLATFORMHEADER, true,
|
iTree.addNode(new IDefaultMutableTreeNode("Platform Header", IDefaultMutableTreeNode.FPD_PLATFORMHEADER, true,
|
||||||
id));
|
id, idmtTemp));
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Platform Definitions",
|
iTree.addNode(new IDefaultMutableTreeNode("Platform Definitions",
|
||||||
IDefaultMutableTreeNode.FPD_PLATFORMDEFINITIONS, true, id));
|
IDefaultMutableTreeNode.FPD_PLATFORMDEFINITIONS, true, id, idmtTemp));
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Flash Information", IDefaultMutableTreeNode.FPD_FLASH, true, id));
|
iTree.addNode(new IDefaultMutableTreeNode("Flash Information", IDefaultMutableTreeNode.FPD_FLASH, true, id,
|
||||||
|
idmtTemp));
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Framework Modules", IDefaultMutableTreeNode.FPD_FRAMEWORKMODULES,
|
iTree.addNode(new IDefaultMutableTreeNode("Framework Modules", IDefaultMutableTreeNode.FPD_FRAMEWORKMODULES,
|
||||||
true, id));
|
true, id, idmtTemp));
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Dynamic PCD Build Declarations",
|
iTree.addNode(new IDefaultMutableTreeNode("Dynamic PCD Build Declarations",
|
||||||
IDefaultMutableTreeNode.FPD_PCDDYNAMICBUILDDECLARATIONS, true, id));
|
IDefaultMutableTreeNode.FPD_PCDDYNAMICBUILDDECLARATIONS, true, id,
|
||||||
iTree.addNode(new IDefaultMutableTreeNode("Build Options", IDefaultMutableTreeNode.FPD_BUILDOPTIONS, true, id));
|
idmtTemp));
|
||||||
|
iTree.addNode(new IDefaultMutableTreeNode("Build Options", IDefaultMutableTreeNode.FPD_BUILDOPTIONS, true, id,
|
||||||
|
idmtTemp));
|
||||||
|
|
||||||
|
//
|
||||||
|
// Add modules in this platform
|
||||||
|
//
|
||||||
|
IDefaultMutableTreeNode dmtnModulePackageLibrary = null;
|
||||||
|
IDefaultMutableTreeNode dmtnModulePackageModule = null;
|
||||||
|
|
||||||
|
dmtnModulePackageLibrary = new IDefaultMutableTreeNode("Library",
|
||||||
|
IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY, false,
|
||||||
|
id, idmtTemp);
|
||||||
|
dmtnModulePackageModule = new IDefaultMutableTreeNode("Module", IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
|
||||||
|
false, id, idmtTemp);
|
||||||
|
|
||||||
|
Vector<ModuleIdentification> vModule = wt.getAllModules(new PlatformIdentification(id));
|
||||||
|
for (int indexJ = 0; indexJ < vModule.size(); indexJ++) {
|
||||||
|
if (vModule.get(indexJ).isLibrary()) {
|
||||||
|
dmtnModulePackageLibrary.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
|
||||||
|
IDefaultMutableTreeNode.MODULE, false,
|
||||||
|
vModule.get(indexJ), idmtTemp));
|
||||||
|
} else {
|
||||||
|
dmtnModulePackageModule.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
|
||||||
|
IDefaultMutableTreeNode.MODULE, false,
|
||||||
|
vModule.get(indexJ), idmtTemp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dmtnModulePackageModule.getChildCount() > 0) {
|
||||||
|
iTree.addNode(dmtnModulePackageModule);
|
||||||
|
}
|
||||||
|
if (dmtnModulePackageLibrary.getChildCount() > 0) {
|
||||||
|
iTree.addNode(dmtnModulePackageLibrary);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2493,10 +2591,12 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
Identification id = null;
|
Identification id = null;
|
||||||
int intCategory = -1;
|
int intCategory = -1;
|
||||||
String path = null;
|
String path = null;
|
||||||
|
IDefaultMutableTreeNode belongNode = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
id = iTree.getSelectNode().getId();
|
id = iTree.getSelectNode().getId();
|
||||||
intCategory = iTree.getSelectCategory();
|
intCategory = iTree.getSelectCategory();
|
||||||
|
belongNode = iTree.getSelectNode().getBelongNode();
|
||||||
|
|
||||||
//
|
//
|
||||||
// If id is null, return directly
|
// If id is null, return directly
|
||||||
@ -2509,15 +2609,9 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
// If the node is not opened yet
|
// If the node is not opened yet
|
||||||
// Insert top level elements first
|
// Insert top level elements first
|
||||||
//
|
//
|
||||||
if (intCategory == IDefaultMutableTreeNode.MODULE) {
|
|
||||||
|
|
||||||
if (intCategory == IDefaultMutableTreeNode.MODULE) {
|
if (intCategory == IDefaultMutableTreeNode.MODULE) {
|
||||||
path = iTree.getSelectNode().getId().getPath();
|
path = iTree.getSelectNode().getId().getPath();
|
||||||
}
|
openModule(path, belongNode);
|
||||||
if (intCategory == IDefaultMutableTreeNode.PACKAGE) {
|
|
||||||
path = iTree.getSelectNode().getId().getPath();
|
|
||||||
}
|
|
||||||
openModule(path);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (intCategory == IDefaultMutableTreeNode.PACKAGE) {
|
if (intCategory == IDefaultMutableTreeNode.PACKAGE) {
|
||||||
@ -2558,8 +2652,9 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
.findIndexOfListById(new PlatformIdentification(
|
.findIndexOfListById(new PlatformIdentification(
|
||||||
id));
|
id));
|
||||||
}
|
}
|
||||||
} catch (RuntimeException e) {
|
} catch (Exception e) {
|
||||||
Log.err("double click category: " + intCategory);
|
Log.err("double click category: " + intCategory);
|
||||||
|
Log.err("double click belong node: " + belongNode.toString());
|
||||||
Log.err("double click id path: " + id);
|
Log.err("double click id path: " + id);
|
||||||
Log.err("double click exception: " + e.getMessage());
|
Log.err("double click exception: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -2801,7 +2896,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
//
|
//
|
||||||
// Open the node
|
// Open the node
|
||||||
//
|
//
|
||||||
this.openModule(mid.getPath());
|
this.openModule(mid.getPath(), this.dmtnModuleDescription);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (result == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
|
} else if (result == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
|
||||||
@ -2835,14 +2930,15 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
//
|
//
|
||||||
IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(pid.getName(),
|
IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(pid.getName(),
|
||||||
IDefaultMutableTreeNode.MODULE_PACKAGE,
|
IDefaultMutableTreeNode.MODULE_PACKAGE,
|
||||||
false, pid);
|
false, pid, this.dmtnModuleDescription);
|
||||||
|
|
||||||
iTree.addNode(dmtnModuleDescription, node);
|
iTree.addNode(dmtnModuleDescription, node);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add new SpdHeader node to the tree
|
// Add new SpdHeader node to the tree
|
||||||
//
|
//
|
||||||
node = new IDefaultMutableTreeNode(pid.getName(), IDefaultMutableTreeNode.PACKAGE, true, pid);
|
node = new IDefaultMutableTreeNode(pid.getName(), IDefaultMutableTreeNode.PACKAGE, true, pid,
|
||||||
|
this.dmtnPackageDescription);
|
||||||
iTree.addNode(dmtnPackageDescription, node);
|
iTree.addNode(dmtnPackageDescription, node);
|
||||||
|
|
||||||
this.openPackage(pid.getPath());
|
this.openPackage(pid.getPath());
|
||||||
@ -2878,7 +2974,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
//
|
//
|
||||||
IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(fid.getName(),
|
IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(fid.getName(),
|
||||||
IDefaultMutableTreeNode.PLATFORM, true,
|
IDefaultMutableTreeNode.PLATFORM, true,
|
||||||
fid);
|
fid, this.dmtnPlatformDescription);
|
||||||
iTree.addNode(dmtnPlatformDescription, node);
|
iTree.addNode(dmtnPlatformDescription, node);
|
||||||
this.openPlatform(fid.getPath());
|
this.openPlatform(fid.getPath());
|
||||||
}
|
}
|
||||||
@ -2907,7 +3003,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
String path = fc.getSelectedFile().getPath();
|
String path = fc.getSelectedFile().getPath();
|
||||||
String match = path.substring(path.length() - 4);
|
String match = path.substring(path.length() - 4);
|
||||||
if (match.equals(DataType.FILE_EXT_SEPARATOR + DataType.MODULE_SURFACE_AREA_EXT)) {
|
if (match.equals(DataType.FILE_EXT_SEPARATOR + DataType.MODULE_SURFACE_AREA_EXT)) {
|
||||||
openModule(path);
|
openModule(path, this.dmtnModuleDescription);
|
||||||
} else if (match.equals(DataType.FILE_EXT_SEPARATOR + DataType.PACKAGE_SURFACE_AREA_EXT)) {
|
} else if (match.equals(DataType.FILE_EXT_SEPARATOR + DataType.PACKAGE_SURFACE_AREA_EXT)) {
|
||||||
openPackage(path);
|
openPackage(path);
|
||||||
} else if (match.equals(DataType.FILE_EXT_SEPARATOR + DataType.PLATFORM_SURFACE_AREA_EXT)) {
|
} else if (match.equals(DataType.FILE_EXT_SEPARATOR + DataType.PLATFORM_SURFACE_AREA_EXT)) {
|
||||||
@ -2921,6 +3017,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
private void close() {
|
private void close() {
|
||||||
|
TreePath item = null;
|
||||||
switch (this.jTabbedPaneEditor.getSelectedIndex()) {
|
switch (this.jTabbedPaneEditor.getSelectedIndex()) {
|
||||||
//
|
//
|
||||||
// Current is module
|
// Current is module
|
||||||
@ -2939,9 +3036,19 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iTree
|
|
||||||
.removeNodeChildrenByPath(GlobalData.openingModuleList
|
//
|
||||||
.getTreePathByIndex(currentOpeningModuleIndex));
|
// Remove all tree paths for the module
|
||||||
|
//
|
||||||
|
Set<TreePath> openingTreePaths = GlobalData.openingModuleList
|
||||||
|
.getTreePathByIndex(currentOpeningModuleIndex);
|
||||||
|
Iterator<TreePath> openingTreePathsIter = openingTreePaths.iterator();
|
||||||
|
while (openingTreePathsIter.hasNext()) {
|
||||||
|
item = openingTreePathsIter.next();
|
||||||
|
iTree.getNodeByPath(item).setOpening(false);
|
||||||
|
iTree.removeNodeChildrenByPath(item);
|
||||||
|
}
|
||||||
|
|
||||||
GlobalData.openingModuleList.setModuleOpen(this.currentOpeningModuleIndex, false);
|
GlobalData.openingModuleList.setModuleOpen(this.currentOpeningModuleIndex, false);
|
||||||
this.cleanDesktopPaneModule();
|
this.cleanDesktopPaneModule();
|
||||||
this.currentOpeningModuleIndex = -1;
|
this.currentOpeningModuleIndex = -1;
|
||||||
@ -2964,9 +3071,19 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iTree
|
|
||||||
.removeNodeChildrenByPath(GlobalData.openingPackageList
|
//
|
||||||
.getTreePathByIndex(currentOpeningPackageIndex));
|
// Remove all tree paths for the module
|
||||||
|
//
|
||||||
|
Set<TreePath> openingTreePaths = GlobalData.openingPackageList
|
||||||
|
.getTreePathByIndex(currentOpeningPackageIndex);
|
||||||
|
Iterator<TreePath> openingTreePathsIter = openingTreePaths.iterator();
|
||||||
|
while (openingTreePathsIter.hasNext()) {
|
||||||
|
item = openingTreePathsIter.next();
|
||||||
|
iTree.getNodeByPath(item).setOpening(false);
|
||||||
|
iTree.removeNodeChildrenByPath(item);
|
||||||
|
}
|
||||||
|
|
||||||
GlobalData.openingPackageList.setPackageOpen(this.currentOpeningPackageIndex, false);
|
GlobalData.openingPackageList.setPackageOpen(this.currentOpeningPackageIndex, false);
|
||||||
this.cleanDesktopPanePackage();
|
this.cleanDesktopPanePackage();
|
||||||
this.currentOpeningPackageIndex = -1;
|
this.currentOpeningPackageIndex = -1;
|
||||||
@ -2989,9 +3106,19 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iTree
|
|
||||||
.removeNodeChildrenByPath(GlobalData.openingPlatformList
|
//
|
||||||
.getTreePathByIndex(currentOpeningPlatformIndex));
|
// Remove all tree paths for the module
|
||||||
|
//
|
||||||
|
Set<TreePath> openingTreePaths = GlobalData.openingPlatformList
|
||||||
|
.getTreePathByIndex(currentOpeningPlatformIndex);
|
||||||
|
Iterator<TreePath> openingTreePathsIter = openingTreePaths.iterator();
|
||||||
|
while (openingTreePathsIter.hasNext()) {
|
||||||
|
item = openingTreePathsIter.next();
|
||||||
|
iTree.getNodeByPath(item).setOpening(false);
|
||||||
|
iTree.removeNodeChildrenByPath(item);
|
||||||
|
}
|
||||||
|
|
||||||
GlobalData.openingPlatformList.setPlatformOpen(this.currentOpeningPlatformIndex, false);
|
GlobalData.openingPlatformList.setPlatformOpen(this.currentOpeningPlatformIndex, false);
|
||||||
this.cleanDesktopPanePlatform();
|
this.cleanDesktopPanePlatform();
|
||||||
this.currentOpeningPlatformIndex = -1;
|
this.currentOpeningPlatformIndex = -1;
|
||||||
@ -3292,23 +3419,20 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
}
|
}
|
||||||
int category = iTree.getSelectCategory();
|
int category = iTree.getSelectCategory();
|
||||||
Identification id = iTree.getSelectNode().getId();
|
Identification id = iTree.getSelectNode().getId();
|
||||||
if (category == IDefaultMutableTreeNode.MODULE || category == IDefaultMutableTreeNode.PACKAGE
|
|
||||||
|| category == IDefaultMutableTreeNode.PLATFORM) {
|
|
||||||
Log.wrn("Clone", "Please select a target to clone!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (category == IDefaultMutableTreeNode.WORKSPACE) {
|
if (category == IDefaultMutableTreeNode.WORKSPACE) {
|
||||||
mode = DataType.RETURN_TYPE_WORKSPACE;
|
mode = DataType.RETURN_TYPE_WORKSPACE;
|
||||||
id = null;
|
id = null;
|
||||||
}
|
}
|
||||||
if (category >= IDefaultMutableTreeNode.MSA_HEADER && category < IDefaultMutableTreeNode.SPD_HEADER) {
|
if ((category == IDefaultMutableTreeNode.MODULE)
|
||||||
|
|| (category >= IDefaultMutableTreeNode.MSA_HEADER && category < IDefaultMutableTreeNode.SPD_HEADER)) {
|
||||||
mode = DataType.RETURN_TYPE_MODULE_SURFACE_AREA;
|
mode = DataType.RETURN_TYPE_MODULE_SURFACE_AREA;
|
||||||
}
|
}
|
||||||
if (category >= IDefaultMutableTreeNode.SPD_HEADER && category < IDefaultMutableTreeNode.FPD_PLATFORMHEADER) {
|
if ((category == IDefaultMutableTreeNode.PACKAGE)
|
||||||
|
|| (category >= IDefaultMutableTreeNode.SPD_HEADER && category < IDefaultMutableTreeNode.FPD_PLATFORMHEADER)) {
|
||||||
mode = DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA;
|
mode = DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA;
|
||||||
}
|
}
|
||||||
if (category >= IDefaultMutableTreeNode.FPD_PLATFORMHEADER) {
|
if ((category == IDefaultMutableTreeNode.PLATFORM) || (category >= IDefaultMutableTreeNode.FPD_PLATFORMHEADER)) {
|
||||||
mode = DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA;
|
mode = DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3323,32 +3447,30 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
}
|
}
|
||||||
if (result == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
|
if (result == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
|
||||||
Tools.showInformationMessage("Module Clone Completed!");
|
Tools.showInformationMessage("Module Clone Completed!");
|
||||||
GlobalData.vModuleList.addElement(c.getMid());
|
|
||||||
addModuleToTree(c.getMid());
|
addModuleToTree(c.getMid());
|
||||||
}
|
}
|
||||||
if (result == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
|
if (result == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
|
||||||
Tools.showInformationMessage("Package Clone Completed!");
|
Tools.showInformationMessage("Package Clone Completed!");
|
||||||
GlobalData.vPackageList.addElement(c.getPid());
|
|
||||||
//
|
//
|
||||||
// Add new SpdHeader node to the tree
|
// Add new SpdHeader node to the tree
|
||||||
//
|
//
|
||||||
IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(GlobalData.vPackageList.lastElement().getName(),
|
IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(GlobalData.vPackageList.lastElement().getName(),
|
||||||
IDefaultMutableTreeNode.SPD_HEADER, true,
|
IDefaultMutableTreeNode.PACKAGE, false,
|
||||||
GlobalData.vPackageList.lastElement());
|
GlobalData.vPackageList.lastElement(),
|
||||||
iTree.addNode(dmtnPackageDescription, node);
|
this.dmtnPackageDescription);
|
||||||
|
iTree.addNode(this.dmtnPackageDescription, node);
|
||||||
}
|
}
|
||||||
if (result == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
|
if (result == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
|
||||||
Tools.showInformationMessage("Platform Surface Area Clone Finished");
|
Tools.showInformationMessage("Platform Surface Area Clone Finished");
|
||||||
GlobalData.vPlatformList.addElement(c.getFid());
|
|
||||||
//
|
//
|
||||||
// Add new SpdHeader node to the tree
|
// Add new SpdHeader node to the tree
|
||||||
//
|
//
|
||||||
IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(
|
IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(
|
||||||
GlobalData.vPlatformList.lastElement().getName(),
|
GlobalData.vPlatformList.lastElement().getName(),
|
||||||
IDefaultMutableTreeNode.FPD_PLATFORMHEADER,
|
IDefaultMutableTreeNode.PLATFORM,
|
||||||
true, GlobalData.vPlatformList.lastElement());
|
false, GlobalData.vPlatformList.lastElement(),
|
||||||
iTree.addNode(dmtnPlatformDescription, node);
|
this.dmtnPlatformDescription);
|
||||||
//this.openPlatform(c.getFid().getPath());
|
iTree.addNode(this.dmtnPlatformDescription, node);
|
||||||
}
|
}
|
||||||
if (result == DataType.RETURN_TYPE_OK) {
|
if (result == DataType.RETURN_TYPE_OK) {
|
||||||
|
|
||||||
@ -3401,8 +3523,9 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||||||
jMenuItemToolsClone.setEnabled(false);
|
jMenuItemToolsClone.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
int category = iTree.getSelectCategory();
|
int category = iTree.getSelectCategory();
|
||||||
if (category == IDefaultMutableTreeNode.MODULE || category == IDefaultMutableTreeNode.PACKAGE
|
if (category == IDefaultMutableTreeNode.MODULE_DESCRIPTION
|
||||||
|| category == IDefaultMutableTreeNode.PLATFORM
|
|| category == IDefaultMutableTreeNode.PACKAGE_DESCRIPTION
|
||||||
|
|| category == IDefaultMutableTreeNode.PLATFORM_DESCRIPTION
|
||||||
|| category == IDefaultMutableTreeNode.MODULE_PACKAGE
|
|| category == IDefaultMutableTreeNode.MODULE_PACKAGE
|
||||||
|| category == IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY
|
|| category == IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY
|
||||||
|| category == IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE) {
|
|| category == IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE) {
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
|
|
||||||
package org.tianocore.frameworkwizard.common.Identifications;
|
package org.tianocore.frameworkwizard.common.Identifications;
|
||||||
|
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.swing.tree.TreePath;
|
import javax.swing.tree.TreePath;
|
||||||
|
|
||||||
|
|
||||||
@ -28,16 +31,12 @@ public class OpeningFileType {
|
|||||||
|
|
||||||
private boolean isOpen = false;
|
private boolean isOpen = false;
|
||||||
|
|
||||||
private TreePath treePath = null;
|
private Set<TreePath> treePath = new LinkedHashSet<TreePath>();
|
||||||
|
|
||||||
public OpeningFileType() {
|
public OpeningFileType() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public OpeningFileType(TreePath treePathValue) {
|
|
||||||
this.treePath = treePathValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isNew() {
|
public boolean isNew() {
|
||||||
return isNew;
|
return isNew;
|
||||||
}
|
}
|
||||||
@ -54,14 +53,6 @@ public class OpeningFileType {
|
|||||||
this.isSaved = isSaved;
|
this.isSaved = isSaved;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreePath getTreePath() {
|
|
||||||
return treePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTreePath(TreePath treePath) {
|
|
||||||
this.treePath = treePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isOpen() {
|
public boolean isOpen() {
|
||||||
return isOpen;
|
return isOpen;
|
||||||
}
|
}
|
||||||
@ -69,4 +60,12 @@ public class OpeningFileType {
|
|||||||
public void setOpen(boolean isOpen) {
|
public void setOpen(boolean isOpen) {
|
||||||
this.isOpen = isOpen;
|
this.isOpen = isOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<TreePath> getTreePath() {
|
||||||
|
return treePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTreePath(Set<TreePath> treePath) {
|
||||||
|
this.treePath = treePath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
**/
|
**/
|
||||||
package org.tianocore.frameworkwizard.common.Identifications;
|
package org.tianocore.frameworkwizard.common.Identifications;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import javax.swing.tree.TreePath;
|
import javax.swing.tree.TreePath;
|
||||||
@ -27,6 +28,7 @@ public class OpeningModuleList {
|
|||||||
public OpeningModuleList() {
|
public OpeningModuleList() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector<OpeningModuleType> getVOpeningModuleList() {
|
public Vector<OpeningModuleType> getVOpeningModuleList() {
|
||||||
return vOpeningModuleList;
|
return vOpeningModuleList;
|
||||||
}
|
}
|
||||||
@ -138,14 +140,14 @@ public class OpeningModuleList {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTreePathById(ModuleIdentification id, TreePath treePath) {
|
public void setTreePathById(ModuleIdentification id, Set<TreePath> treePath) {
|
||||||
int index = findIndexOfListById(id);
|
int index = findIndexOfListById(id);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
vOpeningModuleList.elementAt(index).setTreePath(treePath);
|
vOpeningModuleList.elementAt(index).setTreePath(treePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreePath getTreePathById(ModuleIdentification id) {
|
public Set<TreePath> getTreePathById(ModuleIdentification id) {
|
||||||
int index = findIndexOfListById(id);
|
int index = findIndexOfListById(id);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
return vOpeningModuleList.elementAt(index).getTreePath();
|
return vOpeningModuleList.elementAt(index).getTreePath();
|
||||||
@ -153,7 +155,7 @@ public class OpeningModuleList {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreePath getTreePathByIndex(int index) {
|
public Set<TreePath> getTreePathByIndex(int index) {
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
return vOpeningModuleList.elementAt(index).getTreePath();
|
return vOpeningModuleList.elementAt(index).getTreePath();
|
||||||
}
|
}
|
||||||
@ -169,6 +171,22 @@ public class OpeningModuleList {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ModuleIdentification getIdByGuidVersion(String guid, String version) {
|
||||||
|
for (int index = 0; index < vOpeningModuleList.size(); index++) {
|
||||||
|
ModuleIdentification id = vOpeningModuleList.elementAt(index).getId();
|
||||||
|
if (version != null) {
|
||||||
|
if (id.getGuid().equals(guid) && id.getVersion().equals(version)) {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (id.getGuid().equals(guid)) {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public void setNew(ModuleIdentification id, boolean isNew) {
|
public void setNew(ModuleIdentification id, boolean isNew) {
|
||||||
int index = findIndexOfListById(id);
|
int index = findIndexOfListById(id);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
|
|
||||||
package org.tianocore.frameworkwizard.common.Identifications;
|
package org.tianocore.frameworkwizard.common.Identifications;
|
||||||
|
|
||||||
import javax.swing.tree.TreePath;
|
|
||||||
|
|
||||||
import org.tianocore.ModuleSurfaceAreaDocument;
|
import org.tianocore.ModuleSurfaceAreaDocument;
|
||||||
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
|
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
|
||||||
|
|
||||||
@ -37,13 +35,6 @@ public class OpeningModuleType extends OpeningFileType{
|
|||||||
this.xmlMsa = msa;
|
this.xmlMsa = msa;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OpeningModuleType(ModuleIdentification identification, ModuleSurfaceAreaDocument.ModuleSurfaceArea msa, TreePath treePath) {
|
|
||||||
super(treePath);
|
|
||||||
|
|
||||||
this.id = identification;
|
|
||||||
this.xmlMsa = msa;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ModuleSurfaceAreaDocument.ModuleSurfaceArea getXmlMsa() {
|
public ModuleSurfaceAreaDocument.ModuleSurfaceArea getXmlMsa() {
|
||||||
return xmlMsa;
|
return xmlMsa;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
**/
|
**/
|
||||||
package org.tianocore.frameworkwizard.common.Identifications;
|
package org.tianocore.frameworkwizard.common.Identifications;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import javax.swing.tree.TreePath;
|
import javax.swing.tree.TreePath;
|
||||||
@ -139,14 +140,14 @@ public class OpeningPackageList {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTreePathById(PackageIdentification id, TreePath treePath) {
|
public void setTreePathById(PackageIdentification id, Set<TreePath> treePath) {
|
||||||
int index = findIndexOfListById(id);
|
int index = findIndexOfListById(id);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
vOpeningPackageList.elementAt(index).setTreePath(treePath);
|
vOpeningPackageList.elementAt(index).setTreePath(treePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreePath getTreePathById(PackageIdentification id) {
|
public Set<TreePath> getTreePathById(PackageIdentification id) {
|
||||||
int index = findIndexOfListById(id);
|
int index = findIndexOfListById(id);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
return vOpeningPackageList.elementAt(index).getTreePath();
|
return vOpeningPackageList.elementAt(index).getTreePath();
|
||||||
@ -154,7 +155,7 @@ public class OpeningPackageList {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreePath getTreePathByIndex(int index) {
|
public Set<TreePath> getTreePathByIndex(int index) {
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
return vOpeningPackageList.elementAt(index).getTreePath();
|
return vOpeningPackageList.elementAt(index).getTreePath();
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,6 @@
|
|||||||
**/
|
**/
|
||||||
package org.tianocore.frameworkwizard.common.Identifications;
|
package org.tianocore.frameworkwizard.common.Identifications;
|
||||||
|
|
||||||
import javax.swing.tree.TreePath;
|
|
||||||
|
|
||||||
import org.tianocore.PackageSurfaceAreaDocument;
|
import org.tianocore.PackageSurfaceAreaDocument;
|
||||||
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
|
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
|
||||||
|
|
||||||
@ -36,13 +34,6 @@ public class OpeningPackageType extends OpeningFileType {
|
|||||||
this.xmlSpd = spd;
|
this.xmlSpd = spd;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OpeningPackageType(PackageIdentification identification, PackageSurfaceAreaDocument.PackageSurfaceArea spd, TreePath treePath) {
|
|
||||||
super(treePath);
|
|
||||||
|
|
||||||
this.id = identification;
|
|
||||||
this.xmlSpd = spd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PackageSurfaceAreaDocument.PackageSurfaceArea getXmlSpd() {
|
public PackageSurfaceAreaDocument.PackageSurfaceArea getXmlSpd() {
|
||||||
return xmlSpd;
|
return xmlSpd;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
**/
|
**/
|
||||||
package org.tianocore.frameworkwizard.common.Identifications;
|
package org.tianocore.frameworkwizard.common.Identifications;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import javax.swing.tree.TreePath;
|
import javax.swing.tree.TreePath;
|
||||||
@ -141,14 +142,14 @@ public class OpeningPlatformList {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTreePathById(PlatformIdentification id, TreePath treePath) {
|
public void setTreePathById(PlatformIdentification id, Set<TreePath> treePath) {
|
||||||
int index = findIndexOfListById(id);
|
int index = findIndexOfListById(id);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
vOpeningPlatformList.elementAt(index).setTreePath(treePath);
|
vOpeningPlatformList.elementAt(index).setTreePath(treePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreePath getTreePathById(PlatformIdentification id) {
|
public Set<TreePath> getTreePathById(PlatformIdentification id) {
|
||||||
int index = findIndexOfListById(id);
|
int index = findIndexOfListById(id);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
return vOpeningPlatformList.elementAt(index).getTreePath();
|
return vOpeningPlatformList.elementAt(index).getTreePath();
|
||||||
@ -156,7 +157,7 @@ public class OpeningPlatformList {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreePath getTreePathByIndex(int index) {
|
public Set<TreePath> getTreePathByIndex(int index) {
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
return vOpeningPlatformList.elementAt(index).getTreePath();
|
return vOpeningPlatformList.elementAt(index).getTreePath();
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,6 @@
|
|||||||
**/
|
**/
|
||||||
package org.tianocore.frameworkwizard.common.Identifications;
|
package org.tianocore.frameworkwizard.common.Identifications;
|
||||||
|
|
||||||
import javax.swing.tree.TreePath;
|
|
||||||
|
|
||||||
import org.tianocore.PlatformSurfaceAreaDocument;
|
import org.tianocore.PlatformSurfaceAreaDocument;
|
||||||
import org.tianocore.frameworkwizard.platform.PlatformIdentification;
|
import org.tianocore.frameworkwizard.platform.PlatformIdentification;
|
||||||
|
|
||||||
@ -36,12 +34,6 @@ public class OpeningPlatformType extends OpeningFileType {
|
|||||||
this.xmlFpd = fpd;
|
this.xmlFpd = fpd;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OpeningPlatformType(PlatformIdentification identification, PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd, TreePath treePath) {
|
|
||||||
super(treePath);
|
|
||||||
this.id = identification;
|
|
||||||
this.xmlFpd = fpd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PlatformSurfaceAreaDocument.PlatformSurfaceArea getXmlFpd() {
|
public PlatformSurfaceAreaDocument.PlatformSurfaceArea getXmlFpd() {
|
||||||
return xmlFpd;
|
return xmlFpd;
|
||||||
}
|
}
|
||||||
|
@ -60,8 +60,6 @@ public class IDefaultMutableTreeNode extends DefaultMutableTreeNode {
|
|||||||
|
|
||||||
public static final int MSA_DATAHUBS = 111;
|
public static final int MSA_DATAHUBS = 111;
|
||||||
|
|
||||||
//public static final int MSA_FORMSETS = 112;
|
|
||||||
|
|
||||||
public static final int MSA_HIIPACKAGES = 112;
|
public static final int MSA_HIIPACKAGES = 112;
|
||||||
|
|
||||||
public static final int MSA_GUIDS = 113;
|
public static final int MSA_GUIDS = 113;
|
||||||
@ -110,17 +108,23 @@ public class IDefaultMutableTreeNode extends DefaultMutableTreeNode {
|
|||||||
|
|
||||||
public static final int WORKSPACE = 0;
|
public static final int WORKSPACE = 0;
|
||||||
|
|
||||||
public static final int MODULE = 1;
|
public static final int MODULE_DESCRIPTION = 1;
|
||||||
|
|
||||||
public static final int PACKAGE = 2;
|
public static final int PACKAGE_DESCRIPTION = 2;
|
||||||
|
|
||||||
public static final int PLATFORM = 3;
|
public static final int PLATFORM_DESCRIPTION = 3;
|
||||||
|
|
||||||
public static final int MODULE_PACKAGE = 4;
|
public static final int MODULE = 4;
|
||||||
|
|
||||||
public static final int MODULE_PACKAGE_LIBRARY = 5;
|
public static final int PACKAGE = 5;
|
||||||
|
|
||||||
public static final int MODULE_PACKAGE_MODULE = 6;
|
public static final int PLATFORM = 6;
|
||||||
|
|
||||||
|
public static final int MODULE_PACKAGE = 7;
|
||||||
|
|
||||||
|
public static final int MODULE_PACKAGE_LIBRARY = 8;
|
||||||
|
|
||||||
|
public static final int MODULE_PACKAGE_MODULE = 9;
|
||||||
|
|
||||||
//
|
//
|
||||||
//Static final definitions for operation
|
//Static final definitions for operation
|
||||||
@ -146,26 +150,13 @@ public class IDefaultMutableTreeNode extends DefaultMutableTreeNode {
|
|||||||
//
|
//
|
||||||
private int category = 0;
|
private int category = 0;
|
||||||
|
|
||||||
private int operation = 0;
|
|
||||||
|
|
||||||
private int location = 0;
|
|
||||||
|
|
||||||
private String nodeName = "";
|
private String nodeName = "";
|
||||||
|
|
||||||
private boolean isOpening = false;
|
private boolean isOpening = false;
|
||||||
|
|
||||||
private Identification id = null;
|
private Identification id = null;
|
||||||
|
|
||||||
/**
|
private IDefaultMutableTreeNode belongNode = null;
|
||||||
Main class, reserved for test
|
|
||||||
|
|
||||||
@param args
|
|
||||||
|
|
||||||
**/
|
|
||||||
public static void main(String[] args) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This is the default constructor
|
This is the default constructor
|
||||||
@ -186,46 +177,13 @@ public class IDefaultMutableTreeNode extends DefaultMutableTreeNode {
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
public IDefaultMutableTreeNode(String strNodeName, int intCategory, boolean bolIsOpening,
|
public IDefaultMutableTreeNode(String strNodeName, int intCategory, boolean bolIsOpening,
|
||||||
Identification identification) {
|
Identification identification, IDefaultMutableTreeNode idmtBelongNode) {
|
||||||
super(strNodeName);
|
super(strNodeName);
|
||||||
this.nodeName = strNodeName;
|
this.nodeName = strNodeName;
|
||||||
this.category = intCategory;
|
this.category = intCategory;
|
||||||
this.isOpening = bolIsOpening;
|
this.isOpening = bolIsOpening;
|
||||||
this.id = identification;
|
this.id = identification;
|
||||||
}
|
this.belongNode = idmtBelongNode;
|
||||||
|
|
||||||
/**
|
|
||||||
This is the overrided constructor
|
|
||||||
Init clase members with input data
|
|
||||||
|
|
||||||
@param strNodeName The name of node
|
|
||||||
@param intCategory The category of node
|
|
||||||
@param intOperation The operation of node
|
|
||||||
|
|
||||||
**/
|
|
||||||
public IDefaultMutableTreeNode(String strNodeName, int intCategory, int intOperation) {
|
|
||||||
super(strNodeName);
|
|
||||||
this.nodeName = strNodeName;
|
|
||||||
this.category = intCategory;
|
|
||||||
this.operation = intOperation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
This is the overrided constructor
|
|
||||||
Init clase members with input data
|
|
||||||
|
|
||||||
@param strNodeName The name of node
|
|
||||||
@param intCategory The category of node
|
|
||||||
@param intOperation The operation of node
|
|
||||||
@param intLocation The location of node
|
|
||||||
|
|
||||||
**/
|
|
||||||
public IDefaultMutableTreeNode(String strNodeName, int intCategory, int intOperation, int intLocation) {
|
|
||||||
super(strNodeName);
|
|
||||||
this.nodeName = strNodeName;
|
|
||||||
this.category = intCategory;
|
|
||||||
this.operation = intOperation;
|
|
||||||
this.location = intLocation;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -268,46 +226,6 @@ public class IDefaultMutableTreeNode extends DefaultMutableTreeNode {
|
|||||||
this.nodeName = nodeName;
|
this.nodeName = nodeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
Get operation of node
|
|
||||||
|
|
||||||
@return The operation of node
|
|
||||||
|
|
||||||
**/
|
|
||||||
public int getOperation() {
|
|
||||||
return operation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Set operation of node
|
|
||||||
|
|
||||||
@param operation The input data of node operation
|
|
||||||
|
|
||||||
**/
|
|
||||||
public void setOperation(int operation) {
|
|
||||||
this.operation = operation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Get location of node
|
|
||||||
|
|
||||||
@return The location of node
|
|
||||||
|
|
||||||
**/
|
|
||||||
public int getLocation() {
|
|
||||||
return location;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Set location of node
|
|
||||||
|
|
||||||
@param location The input data of node location
|
|
||||||
|
|
||||||
**/
|
|
||||||
public void setLocation(int location) {
|
|
||||||
this.location = location;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get identification of node
|
Get identification of node
|
||||||
|
|
||||||
@ -347,4 +265,16 @@ public class IDefaultMutableTreeNode extends DefaultMutableTreeNode {
|
|||||||
public void setOpening(boolean isOpening) {
|
public void setOpening(boolean isOpening) {
|
||||||
this.isOpening = isOpening;
|
this.isOpening = isOpening;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return this.nodeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IDefaultMutableTreeNode getBelongNode() {
|
||||||
|
return belongNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBelongNode(IDefaultMutableTreeNode belongNode) {
|
||||||
|
this.belongNode = belongNode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,6 @@ import org.tianocore.frameworkwizard.common.Identifications.Identification;
|
|||||||
The class is used to override JTree to provides customized interfaces
|
The class is used to override JTree to provides customized interfaces
|
||||||
It extends JTree
|
It extends JTree
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
public class ITree extends JTree {
|
public class ITree extends JTree {
|
||||||
///
|
///
|
||||||
@ -58,7 +56,7 @@ public class ITree extends JTree {
|
|||||||
**/
|
**/
|
||||||
public ITree(IDefaultMutableTreeNode iDmtRoot) {
|
public ITree(IDefaultMutableTreeNode iDmtRoot) {
|
||||||
super(iDmtRoot);
|
super(iDmtRoot);
|
||||||
treeModel = (DefaultTreeModel)this.getModel();
|
treeModel = (DefaultTreeModel) this.getModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -75,44 +73,6 @@ public class ITree extends JTree {
|
|||||||
return intCategory;
|
return intCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
Get operation of selected node
|
|
||||||
|
|
||||||
@return The operation of selected node
|
|
||||||
|
|
||||||
**/
|
|
||||||
public int getSelectOperation() {
|
|
||||||
int intOperation = 0;
|
|
||||||
TreePath path = this.getSelectionPath();
|
|
||||||
IDefaultMutableTreeNode node = (IDefaultMutableTreeNode) path.getLastPathComponent();
|
|
||||||
intOperation = node.getOperation();
|
|
||||||
return intOperation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Get selectLoaction of selected node
|
|
||||||
|
|
||||||
@return The selectLoaction of selected node
|
|
||||||
|
|
||||||
**/
|
|
||||||
public int getSelectLoaction() {
|
|
||||||
int intLocation = 0;
|
|
||||||
TreePath path = this.getSelectionPath();
|
|
||||||
IDefaultMutableTreeNode node = (IDefaultMutableTreeNode) path.getLastPathComponent();
|
|
||||||
intLocation = node.getLocation();
|
|
||||||
return intLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Main class, reserved for test
|
|
||||||
|
|
||||||
@param args
|
|
||||||
|
|
||||||
**/
|
|
||||||
public static void main(String[] args) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Add input node as child node for current selected node
|
Add input node as child node for current selected node
|
||||||
|
|
||||||
@ -190,6 +150,21 @@ public class ITree extends JTree {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Return a node by input tree path
|
||||||
|
|
||||||
|
@param treePath
|
||||||
|
@return
|
||||||
|
|
||||||
|
**/
|
||||||
|
public IDefaultMutableTreeNode getNodeByPath(TreePath treePath) {
|
||||||
|
if (treePath != null) {
|
||||||
|
IDefaultMutableTreeNode selectionNode = (IDefaultMutableTreeNode) treePath.getLastPathComponent();
|
||||||
|
return selectionNode;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Remove all child nodes under current node
|
Remove all child nodes under current node
|
||||||
|
|
||||||
@ -198,7 +173,7 @@ public class ITree extends JTree {
|
|||||||
if (treePath != null) {
|
if (treePath != null) {
|
||||||
DefaultMutableTreeNode currentNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();
|
DefaultMutableTreeNode currentNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();
|
||||||
for (int index = currentNode.getChildCount() - 1; index > -1; index--) {
|
for (int index = currentNode.getChildCount() - 1; index > -1; index--) {
|
||||||
treeModel.removeNodeFromParent((DefaultMutableTreeNode)currentNode.getChildAt(index));
|
treeModel.removeNodeFromParent((DefaultMutableTreeNode) currentNode.getChildAt(index));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ import org.tianocore.IndustryStdIncludesDocument.IndustryStdIncludes;
|
|||||||
import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
|
import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
|
||||||
import org.tianocore.MsaFilesDocument.MsaFiles;
|
import org.tianocore.MsaFilesDocument.MsaFiles;
|
||||||
import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
|
import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
|
||||||
|
import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
|
||||||
import org.tianocore.SourceFilesDocument.SourceFiles;
|
import org.tianocore.SourceFilesDocument.SourceFiles;
|
||||||
import org.tianocore.frameworkwizard.common.DataType;
|
import org.tianocore.frameworkwizard.common.DataType;
|
||||||
import org.tianocore.frameworkwizard.common.GlobalData;
|
import org.tianocore.frameworkwizard.common.GlobalData;
|
||||||
@ -302,6 +303,39 @@ public class WorkspaceTools {
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get all module basic information from a platform
|
||||||
|
|
||||||
|
@param id Package id
|
||||||
|
@return A vector includes all modules' basic information
|
||||||
|
|
||||||
|
**/
|
||||||
|
public Vector<ModuleIdentification> getAllModules(PlatformIdentification fid) {
|
||||||
|
Vector<ModuleIdentification> v = new Vector<ModuleIdentification>();
|
||||||
|
PlatformSurfaceArea fpd = GlobalData.openingPlatformList.getOpeningPlatformById(fid).getXmlFpd();
|
||||||
|
if (fpd.getFrameworkModules() != null) {
|
||||||
|
for (int index = 0; index < fpd.getFrameworkModules().getModuleSAList().size(); index++) {
|
||||||
|
String guid = fpd.getFrameworkModules().getModuleSAList().get(index).getModuleGuid();
|
||||||
|
String version = fpd.getFrameworkModules().getModuleSAList().get(index).getModuleVersion();
|
||||||
|
ModuleIdentification id = GlobalData.openingModuleList.getIdByGuidVersion(guid, version);
|
||||||
|
if (id != null) {
|
||||||
|
boolean isFind = false;
|
||||||
|
for (int indexOfModules = 0; indexOfModules < v.size(); indexOfModules++) {
|
||||||
|
if (v.elementAt(indexOfModules).equals(id)) {
|
||||||
|
isFind = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isFind) {
|
||||||
|
v.addElement(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Sort.sortModules(v, DataType.SORT_TYPE_ASCENDING);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get all module basic information form the FrameworkDatabase.db file
|
Get all module basic information form the FrameworkDatabase.db file
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user