import javax.swing.JFrame;\r
import javax.swing.JOptionPane;\r
import javax.swing.JPanel;\r
-import javax.swing.JDialog;\r
import javax.swing.JSplitPane;\r
import javax.swing.JLabel;\r
import javax.swing.JScrollPane;\r
import javax.swing.table.DefaultTableModel;\r
\r
import org.tianocore.PlatformSurfaceAreaDocument;\r
+import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;\r
import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
import org.tianocore.frameworkwizard.platform.ui.global.GlobalData;\r
import org.tianocore.frameworkwizard.platform.ui.id.ModuleIdentification;\r
\r
public class FpdFrameworkModules extends IInternalFrame {\r
\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = 1L;\r
static JFrame frame;\r
private JSplitPane jSplitPane = null;\r
private JPanel jPanel = null;\r
private FpdModuleSA settingDlg = null;\r
\r
private FpdFileContents ffc = null;\r
- \r
+ private OpeningPlatformType docConsole = null;\r
private Map<String, String> fpdMsa = null;\r
\r
private ArrayList<ModuleIdentification> miList = null;\r
if (jTable == null) {\r
model = new NonEditableTableModel();\r
jTable = new JTable(model);\r
+ jTable.setRowHeight(20);\r
model.addColumn("ModuleName");\r
model.addColumn("ModuleGUID");\r
model.addColumn("ModuleVersion");\r
fpdMsa.put(mg + mv + pg + pv, null);\r
\r
String[] row = {" ", mg, mv, pg, pv};\r
- if (getModuleId(mg + " " + mv + " " + pg + " " + pv) != null) {\r
- row[0] = getModuleId(mg + " " + mv + " " + pg + " " + pv).getName();\r
+ ModuleIdentification mi = getModuleId(mg + " " + mv + " " + pg + " " + pv);\r
+ if (mi != null) {\r
+ row[0] = mi.getName();\r
+ row[2] = mi.getVersion();\r
+ row[4] = mi.getPackage().getVersion();\r
}\r
model1.addRow(row);\r
- ffc.addFrameworkModulesPcdBuildDefs(miList.get(selectedRow), null);\r
+ \r
+ docConsole.setSaved(false);\r
+ try{\r
+ ffc.addFrameworkModulesPcdBuildDefs(miList.get(selectedRow), null);\r
+ }\r
+ catch (Exception exception) {\r
+ JOptionPane.showMessageDialog(frame, "PCD Insertion Fail. " + exception.getMessage());\r
+ }\r
+ JOptionPane.showMessageDialog(frame, "This Module Added Successfully.");\r
+ jTable1.changeSelection(model1.getRowCount()-1, 0, false, false);\r
}\r
});\r
}\r
if (jTable1 == null) {\r
model1 = new NonEditableTableModel();\r
jTable1 = new JTable(model1);\r
+ jTable1.setRowHeight(20);\r
model1.addColumn("ModuleName");\r
model1.addColumn("ModuleGUID");\r
model1.addColumn("ModuleVersion"); \r
if (settingDlg == null) {\r
settingDlg = new FpdModuleSA(ffc);\r
}\r
- \r
- String mg = model1.getValueAt(selectedRow, 1).toString();\r
- String mv = model1.getValueAt(selectedRow, 2).toString();\r
- String pg = model1.getValueAt(selectedRow, 3).toString();\r
- String pv = model1.getValueAt(selectedRow, 4).toString();\r
+ docConsole.setSaved(false);\r
+ String mg = model1.getValueAt(selectedRow, 1)+"";\r
+ String mv = model1.getValueAt(selectedRow, 2)+"";\r
+ String pg = model1.getValueAt(selectedRow, 3)+"";\r
+ String pv = model1.getValueAt(selectedRow, 4)+"";\r
settingDlg.setKey(mg + " " + mv + " " + pg + " " + pv);\r
settingDlg.setVisible(true);\r
}\r
String pv = model1.getValueAt(selectedRow, 4).toString();\r
model1.removeRow(selectedRow);\r
fpdMsa.remove(mg+mv+pg+pv);\r
+ docConsole.setSaved(false);\r
ffc.removeModuleSA(selectedRow);\r
}\r
});\r
\r
}\r
\r
+ public FpdFrameworkModules(OpeningPlatformType opt) {\r
+ this(opt.getXmlFpd());\r
+ docConsole = opt;\r
+ }\r
+ \r
private void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {\r
try {\r
GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", System.getenv("WORKSPACE"));\r
String[][] saa = new String[ffc.getFrameworkModulesCount()][5];\r
ffc.getFrameworkModulesInfo(saa);\r
for (int i = 0; i < saa.length; ++i) {\r
- if (getModuleId(saa[i][1]+ " "+saa[i][2]+" "+saa[i][3]+" "+saa[i][4]) != null) {\r
- saa[i][0] = getModuleId(saa[i][1]+ " "+saa[i][2]+" "+saa[i][3]+" "+saa[i][4]).getName();\r
+ ModuleIdentification mi = getModuleId(saa[i][1]+ " "+saa[i][2]+" "+saa[i][3]+" "+saa[i][4]);\r
+ if (mi != null) {\r
+ saa[i][0] = mi.getName();\r
+ saa[i][2] = mi.getVersion();\r
+ saa[i][4] = mi.getPackage().getVersion();\r
}\r
model1.addRow(saa[i]);\r
fpdMsa.put(saa[i][1]+saa[i][2]+saa[i][3]+saa[i][4], saa[i][0]);\r
\r
while(ispi.hasNext()) {\r
PackageIdentification pi = (PackageIdentification)ispi.next();\r
- if ( !pi.getGuid().equals(keyPart[2]) || !pi.getVersion().equals(keyPart[3])){\r
+ if ( !pi.getGuid().equals(keyPart[2])){ \r
+// || !pi.getVersion().equals(keyPart[3])){\r
continue;\r
}\r
Set<ModuleIdentification> smi = GlobalData.getModules(pi);\r
Iterator ismi = smi.iterator();\r
while(ismi.hasNext()) {\r
ModuleIdentification mi = (ModuleIdentification)ismi.next();\r
- if (mi.getGuid().equals(keyPart[0]) && mi.getVersion().equals(keyPart[1])){\r
+ if (mi.getGuid().equals(keyPart[0])){\r
+// && mi.getVersion().equals(keyPart[1])){\r
+\r
return mi;\r
}\r
}\r
} // @jve:decl-index=0:visual-constraint="10,10"\r
\r
class NonEditableTableModel extends DefaultTableModel {\r
+ /**\r
+ * \r
+ */\r
+ private static final long serialVersionUID = 1L;\r
+\r
public boolean isCellEditable(int row, int col) {\r
return false;\r
}\r