import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;\r
import org.tianocore.frameworkwizard.platform.ui.ListEditor;\r
-import org.tianocore.frameworkwizard.platform.ui.global.GlobalData;\r
+import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;\r
import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery;\r
import org.tianocore.frameworkwizard.platform.ui.id.ModuleIdentification;\r
import org.tianocore.frameworkwizard.platform.ui.id.PackageIdentification;\r
\r
private JPanel jContentPane = null;\r
\r
- private JTextField jTextFieldAdd = null;\r
+ private JTextField jTextFieldClass = null;\r
\r
private JComboBox jComboBoxSelect = null;\r
\r
\r
private ICheckBoxList iCheckBoxListModules = null;\r
\r
- private ICheckBoxList iCheckBoxList = null;\r
+ private ICheckBoxList iCheckBoxListArch = null;\r
\r
private JComboBox jComboBox = null;\r
\r
\r
@return javax.swing.JTextField \r
**/\r
- private JTextField getJTextFieldAdd() {\r
- if (jTextFieldAdd == null) {\r
- jTextFieldAdd = new JTextField();\r
- jTextFieldAdd.setBounds(new java.awt.Rectangle(122,6,390,20));\r
- jTextFieldAdd.setPreferredSize(new java.awt.Dimension(260,20));\r
- jTextFieldAdd.setEnabled(true);\r
+ private JTextField getJTextFieldClass() {\r
+ if (jTextFieldClass == null) {\r
+ jTextFieldClass = new JTextField();\r
+ jTextFieldClass.setBounds(new java.awt.Rectangle(122,6,390,20));\r
+ jTextFieldClass.setPreferredSize(new java.awt.Dimension(260,20));\r
+ jTextFieldClass.setEnabled(true);\r
}\r
- return jTextFieldAdd;\r
+ return jTextFieldClass;\r
}\r
\r
/**\r
private JScrollPane getJScrollPane() {\r
if (jScrollPane == null) {\r
jScrollPane = new JScrollPane();\r
- jScrollPane.setBounds(new java.awt.Rectangle(12,351,608,253));\r
- jScrollPane.setPreferredSize(new java.awt.Dimension(500,419));\r
+ jScrollPane.setBounds(new java.awt.Rectangle(12,351,400,253));\r
jScrollPane.setViewportView(getJTable());\r
}\r
return jScrollPane;\r
if (name != null && name.length() > 0) {\r
getLibInstances(lib);\r
guid = nameToGuid(name);\r
+ if (guid == null){\r
+ JOptionPane.showMessageDialog(frame, "Recommended Instance NOT exists.");\r
+ return;\r
+ }\r
}\r
\r
String[] sa = new String[7];\r
jContentPane.add(jLabelHdr, null);\r
jContentPane.add(jStarLabel1, null);\r
jContentPane.add(jStarLabel2, null);\r
- jContentPane.add(getJTextFieldAdd(), null);\r
+ jContentPane.add(getJTextFieldClass(), null);\r
jContentPane.add(getJComboBoxSelect(), null);\r
jContentPane.add(getJScrollPane(), null);\r
jContentPane.add(getJButtonAdd(), null);\r
//ToDo: check before add\r
// LAH WAS String[] row = {null, null, null, jComboBox.getSelectedItem()+"", jTextField2RecInstVer.getText(), null, null};\r
String[] row = {null, null, null, null, null, null, null};\r
- row[cnClassName] = jTextFieldAdd.getText();\r
+ row[cnClassName] = jTextFieldClass.getText();\r
row[cnHdrFile] = jTextFieldHdr.getText().replace('\\', '/');\r
row[cnHelpText] = jTextFieldHelp.getText();\r
row[cnRecInstName] = jComboBox.getSelectedItem()+"";\r
row[cnRecInstVer] = jTextField2RecInstVer.getText();\r
- row[cnSupArch] = vectorToString(iCheckBoxList.getAllCheckedItemsString());\r
+ row[cnSupArch] = vectorToString(iCheckBoxListArch.getAllCheckedItemsString());\r
if (row[cnSupArch].length() == 0) {\r
row[cnSupArch] = null;\r
}\r
//\r
getLibInstances(row[cnClassName]);\r
String recommendGuid = nameToGuid(row[cnRecInstName]);\r
+ if (row[cnRecInstName].equals("null")) {\r
+ row[cnRecInstName] = null;\r
+ }\r
+ else{\r
+ if (recommendGuid == null) {\r
+ JOptionPane.showMessageDialog(frame, "Recommended Instance NOT exists.");\r
+ return;\r
+ }\r
+ }\r
\r
sfc.genSpdLibClassDeclarations(row[cnClassName], recommendGuid, row[cnHdrFile], row[cnHelpText], row[cnSupArch], null, null, row[cnRecInstVer], null, row[cnSupMod]);\r
model.addRow(row);\r
public void componentResized(ComponentEvent arg0) {\r
int intPreferredWidth = 500;\r
\r
- resizeComponentWidth(this.jTextFieldAdd, this.getWidth(), intPreferredWidth);\r
- resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth);\r
- resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth-10);\r
+ Tools.resizeComponentWidth(this.jTextFieldClass, this.getWidth(), intPreferredWidth);\r
+ Tools.resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth);\r
+ Tools.resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth-10);\r
\r
}\r
/**\r
jScrollPane1Arch = new JScrollPane();\r
jScrollPane1Arch.setBounds(new java.awt.Rectangle(218,170,293,73));\r
jScrollPane1Arch.setPreferredSize(new java.awt.Dimension(320, 80));\r
- jScrollPane1Arch.setViewportView(getICheckBoxList());\r
+ jScrollPane1Arch.setViewportView(getICheckBoxListArch());\r
}\r
return jScrollPane1Arch;\r
}\r
* \r
* @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList \r
*/\r
- private ICheckBoxList getICheckBoxList() {\r
- if (iCheckBoxList == null) {\r
- iCheckBoxList = new ICheckBoxList();\r
- iCheckBoxList.setBounds(new java.awt.Rectangle(218,171,292,66));\r
+ private ICheckBoxList getICheckBoxListArch() {\r
+ if (iCheckBoxListArch == null) {\r
+ iCheckBoxListArch = new ICheckBoxList();\r
+ iCheckBoxListArch.setBounds(new java.awt.Rectangle(218,171,292,66));\r
Vector<String> v = new Vector<String>();\r
v.add("IA32");\r
v.add("X64");\r
v.add("EBC");\r
v.add("ARM");\r
v.add("PPC");\r
- iCheckBoxList.setAllItems(v);\r
+ iCheckBoxListArch.setAllItems(v);\r
}\r
- return iCheckBoxList;\r
+ return iCheckBoxListArch;\r
}\r
\r
/**\r
jComboBox.setLocation(new java.awt.Point(218,111));\r
jComboBox.addFocusListener(new java.awt.event.FocusAdapter() {\r
public void focusGained(java.awt.event.FocusEvent e) {\r
- if (jTextFieldAdd.getText().length() == 0) {\r
+ if (jTextFieldClass.getText().length() == 0) {\r
return;\r
}\r
jComboBox.removeAllItems();\r
- getLibInstances(jTextFieldAdd.getText());\r
+ getLibInstances(jTextFieldClass.getText());\r
Set<String> libNames = libNameGuidMap.keySet();\r
Iterator<String> si = libNames.iterator();\r
while(si.hasNext()) {\r
private void getLibInstances(String libClass){\r
libNameGuidMap.clear();\r
try {\r
- GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", System.getenv("WORKSPACE"));\r
+ WorkspaceProfile.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", System.getenv("WORKSPACE"));\r
\r
- Set<PackageIdentification> spi = GlobalData.getPackageList();\r
+ Set<PackageIdentification> spi = WorkspaceProfile.getPackageList();\r
Iterator ispi = spi.iterator();\r
\r
while (ispi.hasNext()) {\r
PackageIdentification pi = (PackageIdentification) ispi.next();\r
\r
- Set<ModuleIdentification> smi = GlobalData.getModules(pi);\r
+ Set<ModuleIdentification> smi = WorkspaceProfile.getModules(pi);\r
Iterator ismi = smi.iterator();\r
while (ismi.hasNext()) {\r
ModuleIdentification mi = (ModuleIdentification) ismi.next();\r
- Map<String, XmlObject> m = GlobalData.getNativeMsa(mi);\r
+ Map<String, XmlObject> m = WorkspaceProfile.getNativeMsa(mi);\r
SurfaceAreaQuery.setDoc(m);\r
- String[] classProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED");\r
- for (int i = 0; i < classProduced.length; ++i) {\r
- if (classProduced[i].equals(libClass)) {\r
+ Vector<String> classProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi);\r
+ for (int i = 0; i < classProduced.size(); ++i) {\r
+ if (classProduced.get(i).equals(libClass)) {\r
libNameGuidMap.put(mi.getName(), mi.getGuid());\r
}\r
}\r
private String nameToGuid(String name) {\r
String s = null;\r
if (!libNameGuidMap.containsKey(name)) {\r
- JOptionPane.showMessageDialog(frame, "Recommended Instance NOT exists.");\r
return s;\r
}\r
\r