Fixed grammar and column widths (set min, preferred and max widths for version and arch)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1218 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -35,32 +35,91 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
static JFrame frame;
|
||||
|
||||
private JSplitPane jSplitPane = null;
|
||||
|
||||
private JPanel jPanelTop = null;
|
||||
|
||||
private JPanel jPanelBottom = null;
|
||||
|
||||
private JLabel jLabel = null;
|
||||
|
||||
private JScrollPane jScrollPaneAllModules = null;
|
||||
|
||||
private JTable jTableAllModules = null;
|
||||
|
||||
private JPanel jPanelTopSouth = null;
|
||||
|
||||
private JButton jButtonAddModule = null;
|
||||
|
||||
private JLabel jLabelModulesAdded = null;
|
||||
|
||||
private JPanel jPanelBottomSouth = null;
|
||||
|
||||
private JScrollPane jScrollPaneFpdModules = null;
|
||||
|
||||
private JTable jTableFpdModules = null;
|
||||
|
||||
private JButton jButtonSettings = null;
|
||||
|
||||
private JButton jButtonRemoveModule = null;
|
||||
|
||||
private NonEditableTableModel modelAllModules = null;
|
||||
|
||||
private NonEditableTableModel modelFpdModules = null;
|
||||
|
||||
private FpdModuleSA settingDlg = null;
|
||||
|
||||
private FpdFileContents ffc = null;
|
||||
|
||||
private OpeningPlatformType docConsole = null;
|
||||
|
||||
private Map<String, ArrayList<String>> fpdMsa = null;
|
||||
|
||||
private ArrayList<ModuleIdentification> miList = null;
|
||||
|
||||
private final int ModNameCol = 0;
|
||||
|
||||
private final int ModVerCol = 1;
|
||||
|
||||
private final int PkgNameCol = 2;
|
||||
|
||||
private final int PkgVerCol = 3;
|
||||
|
||||
private final int ArchCol = 4;
|
||||
|
||||
private final int Path4Col = 4;
|
||||
|
||||
private final int Path5Col = 5;
|
||||
|
||||
private final int ModNameMinWidth = 168;
|
||||
|
||||
private final int ModNamePrefWidth = 200;
|
||||
|
||||
private final int PkgNameMinWidth = 100;
|
||||
|
||||
private final int PkgNamePrefWidth = 110;
|
||||
|
||||
private final int PkgNameMaxWidth = 150;
|
||||
|
||||
private final int VerMinWidth = 50;
|
||||
|
||||
private final int VerMaxWidth = 80;
|
||||
|
||||
private final int VerPrefWidth = 60;
|
||||
|
||||
private final int PathPrefWidth = 320;
|
||||
|
||||
private final int PathMinWidth = 280;
|
||||
|
||||
private final int ArchPrefWidth = 80;
|
||||
|
||||
private final int ArchMinWidth = 60;
|
||||
|
||||
private final int ArchMaxWidth = 100;
|
||||
|
||||
/**
|
||||
* This method initializes jSplitPane
|
||||
*
|
||||
@ -139,11 +198,30 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
jTableAllModules = new JTable(sorter);
|
||||
sorter.setTableHeader(jTableAllModules.getTableHeader());
|
||||
jTableAllModules.setRowHeight(20);
|
||||
modelAllModules.addColumn("ModuleName");
|
||||
modelAllModules.addColumn("ModuleVersion");
|
||||
modelAllModules.addColumn("PackageName");
|
||||
modelAllModules.addColumn("PackageVersion");
|
||||
modelAllModules.addColumn("<html>Module<br>Name</html>");
|
||||
modelAllModules.addColumn("<html>Module<br>Version</html>");
|
||||
modelAllModules.addColumn("<html>Package<br>Name</html>");
|
||||
modelAllModules.addColumn("<html>Package<br>Version</html>");
|
||||
modelAllModules.addColumn("Path");
|
||||
javax.swing.table.TableColumn column = null;
|
||||
column = jTableAllModules.getColumnModel().getColumn(ModNameCol);
|
||||
column.setPreferredWidth(ModNamePrefWidth);
|
||||
column.setMinWidth(ModNameMinWidth);
|
||||
column = jTableAllModules.getColumnModel().getColumn(ModVerCol);
|
||||
column.setPreferredWidth(VerPrefWidth);
|
||||
column.setMaxWidth(VerMaxWidth);
|
||||
column.setMinWidth(VerMinWidth);
|
||||
column = jTableAllModules.getColumnModel().getColumn(PkgNameCol);
|
||||
column.setPreferredWidth(PkgNamePrefWidth);
|
||||
column.setMinWidth(PkgNameMinWidth);
|
||||
column.setMaxWidth(PkgNameMaxWidth);
|
||||
column = jTableAllModules.getColumnModel().getColumn(PkgVerCol);
|
||||
column.setPreferredWidth(VerPrefWidth);
|
||||
column.setMaxWidth(VerMaxWidth);
|
||||
column.setMinWidth(VerMinWidth);
|
||||
column = jTableAllModules.getColumnModel().getColumn(Path4Col);
|
||||
column.setPreferredWidth(PathPrefWidth);
|
||||
column.setMinWidth(PathMinWidth);
|
||||
|
||||
jTableAllModules.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
}
|
||||
@ -185,7 +263,7 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
|
||||
TableSorter sorter = (TableSorter) jTableAllModules.getModel();
|
||||
selectedRow = sorter.modelIndex(selectedRow);
|
||||
String path = modelAllModules.getValueAt(selectedRow, 4)+"";
|
||||
String path = modelAllModules.getValueAt(selectedRow, Path4Col) + "";
|
||||
ModuleIdentification mi = miList.get(selectedRow);
|
||||
Vector<String> vArchs = null;
|
||||
try {
|
||||
@ -196,7 +274,7 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
}
|
||||
|
||||
if (vArchs == null) {
|
||||
JOptionPane.showMessageDialog(frame, "No supported Archs specified in MSA file.");
|
||||
JOptionPane.showMessageDialog(frame, "No Supported Architectures specified in MSA file.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -218,7 +296,7 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
// Archs this Module supported have already been added.
|
||||
//
|
||||
if (vArchs.size() == 0) {
|
||||
JOptionPane.showMessageDialog(frame, "This Module Already Added.");
|
||||
JOptionPane.showMessageDialog(frame, "This Module has already been added.");
|
||||
return;
|
||||
}
|
||||
//ToDo put Arch instead of null
|
||||
@ -230,8 +308,8 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
String[] row = { "", mv, "", pv, arch, path };
|
||||
|
||||
if (mi != null) {
|
||||
row[0] = mi.getName();
|
||||
row[2] = mi.getPackage().getName();
|
||||
row[ModNameCol] = mi.getName();
|
||||
row[PkgNameCol] = mi.getPackage().getName();
|
||||
|
||||
}
|
||||
modelFpdModules.addRow(row);
|
||||
@ -240,19 +318,18 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
try {
|
||||
//ToDo : specify archs need to add.
|
||||
ffc.addFrameworkModulesPcdBuildDefs(mi, arch, null);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
JOptionPane.showMessageDialog(frame, "Adding " + row[0] + " with SupArch " + arch + ": "+ exception.getMessage());
|
||||
} catch (Exception exception) {
|
||||
JOptionPane.showMessageDialog(frame, "Adding " + row[ModNameCol] + " with SupArch " + arch
|
||||
+ ": " + exception.getMessage());
|
||||
errorOccurred = true;
|
||||
}
|
||||
}
|
||||
|
||||
String s = "This Module with Arch "+ archsAdded;
|
||||
String s = "This Module with Architecture " + archsAdded;
|
||||
if (errorOccurred) {
|
||||
s += " Added with Error. Platform may NOT Be Built.";
|
||||
}
|
||||
else {
|
||||
s += " Added Successfully.";
|
||||
s += " was added with Error. Platform may NOT Build.";
|
||||
} else {
|
||||
s += " was added Successfully.";
|
||||
}
|
||||
JOptionPane.showMessageDialog(frame, s);
|
||||
jTableFpdModules.changeSelection(modelFpdModules.getRowCount() - 1, 0, false, false);
|
||||
@ -305,12 +382,35 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
jTableFpdModules = new JTable(sorter);
|
||||
sorter.setTableHeader(jTableFpdModules.getTableHeader());
|
||||
jTableFpdModules.setRowHeight(20);
|
||||
modelFpdModules.addColumn("ModuleName");
|
||||
modelFpdModules.addColumn("ModuleVersion");
|
||||
modelFpdModules.addColumn("PackageName");
|
||||
modelFpdModules.addColumn("PackageVersion");
|
||||
modelFpdModules.addColumn("SupportedArch");
|
||||
modelFpdModules.addColumn("<html>Module<br>Name</html>");
|
||||
modelFpdModules.addColumn("<html>Module<br>Version</html>");
|
||||
modelFpdModules.addColumn("<html>Package<br>Name</html>");
|
||||
modelFpdModules.addColumn("<html>Package<br>Version</html>");
|
||||
modelFpdModules.addColumn("<html>Supported<br>Architectures</html>");
|
||||
modelFpdModules.addColumn("Path");
|
||||
javax.swing.table.TableColumn column = null;
|
||||
column = jTableFpdModules.getColumnModel().getColumn(ModNameCol);
|
||||
column.setPreferredWidth(ModNamePrefWidth);
|
||||
column.setMinWidth(ModNameMinWidth);
|
||||
column = jTableFpdModules.getColumnModel().getColumn(ModVerCol);
|
||||
column.setPreferredWidth(VerPrefWidth);
|
||||
column.setMaxWidth(VerMaxWidth);
|
||||
column.setMinWidth(VerMinWidth);
|
||||
column = jTableFpdModules.getColumnModel().getColumn(PkgNameCol);
|
||||
column.setPreferredWidth(PkgNamePrefWidth);
|
||||
column.setMinWidth(PkgNameMinWidth);
|
||||
column.setMaxWidth(PkgNameMaxWidth);
|
||||
column = jTableFpdModules.getColumnModel().getColumn(PkgVerCol);
|
||||
column.setPreferredWidth(VerPrefWidth);
|
||||
column.setMaxWidth(VerMaxWidth);
|
||||
column.setMinWidth(VerMinWidth);
|
||||
column = jTableFpdModules.getColumnModel().getColumn(ArchCol);
|
||||
column.setPreferredWidth(ArchPrefWidth);
|
||||
column.setMaxWidth(ArchMaxWidth);
|
||||
column.setMinWidth(ArchMinWidth);
|
||||
column = jTableFpdModules.getColumnModel().getColumn(Path5Col);
|
||||
column.setPreferredWidth(PathPrefWidth);
|
||||
column.setMinWidth(PathMinWidth);
|
||||
|
||||
jTableFpdModules.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
}
|
||||
@ -352,11 +452,11 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
|
||||
String[] sa = new String[5];
|
||||
ffc.getFrameworkModuleInfo(selectedRow, sa);
|
||||
String mg = sa[0];
|
||||
String mv = sa[1];
|
||||
String pg = sa[2];
|
||||
String pv = sa[3];
|
||||
String arch = sa[4];
|
||||
String mg = sa[ModNameCol];
|
||||
String mv = sa[ModVerCol];
|
||||
String pg = sa[PkgNameCol];
|
||||
String pv = sa[PkgVerCol];
|
||||
String arch = sa[ArchCol];
|
||||
settingDlg.setKey(mg + " " + mv + " " + pg + " " + pv + " " + arch, selectedRow, docConsole);
|
||||
settingDlg.setVisible(true);
|
||||
}
|
||||
@ -365,7 +465,6 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
return jButtonSettings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method initializes jButton2
|
||||
*
|
||||
@ -388,20 +487,21 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
|
||||
String[] sa = new String[5];
|
||||
ffc.getFrameworkModuleInfo(selectedRow, sa);
|
||||
String mg = sa[0];
|
||||
String mv = sa[1];
|
||||
String pg = sa[2];
|
||||
String pv = sa[3];
|
||||
String arch = sa[4];
|
||||
ModuleIdentification mi = GlobalData.getModuleId(sa[0] + " " + sa[1] + " " + sa[2] + " " + sa[3] + " " + sa[4]);
|
||||
String mg = sa[ModNameCol];
|
||||
String mv = sa[ModVerCol];
|
||||
String pg = sa[PkgNameCol];
|
||||
String pv = sa[PkgVerCol];
|
||||
String arch = sa[ArchCol];
|
||||
ModuleIdentification mi = GlobalData.getModuleId(sa[ModNameCol] + " " + sa[ModVerCol] + " "
|
||||
+ sa[PkgNameCol] + " " + sa[PkgVerCol] + " "
|
||||
+ sa[ArchCol]);
|
||||
mv = mi.getVersion();
|
||||
pv = mi.getPackage().getVersion();
|
||||
modelFpdModules.removeRow(selectedRow);
|
||||
if (arch == null) {
|
||||
// if no arch specified in ModuleSA
|
||||
fpdMsa.remove(mg + mv + pg + pv);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
ArrayList<String> al = fpdMsa.get(mg + mv + pg + pv);
|
||||
al.remove(arch);
|
||||
if (al.size() == 0) {
|
||||
@ -409,7 +509,6 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
docConsole.setSaved(false);
|
||||
ffc.removeModuleSA(selectedRow);
|
||||
}
|
||||
@ -466,28 +565,31 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
String[][] saa = new String[ffc.getFrameworkModulesCount()][5];
|
||||
ffc.getFrameworkModulesInfo(saa);
|
||||
for (int i = 0; i < saa.length; ++i) {
|
||||
ModuleIdentification mi = GlobalData.getModuleId(saa[i][0]+ " "+saa[i][1]+" "+saa[i][2]+" "+saa[i][3]);
|
||||
ModuleIdentification mi = GlobalData.getModuleId(saa[i][ModNameCol] + " " + saa[i][ModVerCol] + " "
|
||||
+ saa[i][PkgNameCol] + " " + saa[i][PkgVerCol]);
|
||||
String[] row = { "", "", "", "", "", "" };
|
||||
if (mi != null) {
|
||||
row[0] = mi.getName();
|
||||
row[1] = mi.getVersion();
|
||||
row[2] = mi.getPackage().getName();
|
||||
row[3] = mi.getPackage().getVersion();
|
||||
row[4] = saa[i][4];
|
||||
row[ModNameCol] = mi.getName();
|
||||
row[ModVerCol] = mi.getVersion();
|
||||
row[PkgNameCol] = mi.getPackage().getName();
|
||||
row[PkgVerCol] = mi.getPackage().getVersion();
|
||||
row[ArchCol] = saa[i][ArchCol];
|
||||
try {
|
||||
row[5] = GlobalData.getMsaFile(mi).getPath().substring(System.getenv("WORKSPACE").length() + 1);
|
||||
}
|
||||
catch (Exception e) {
|
||||
row[Path5Col] = GlobalData.getMsaFile(mi).getPath().substring(
|
||||
System.getenv("WORKSPACE")
|
||||
.length() + 1);
|
||||
} catch (Exception e) {
|
||||
JOptionPane.showMessageDialog(frame, "Show FPD Modules:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
modelFpdModules.addRow(row);
|
||||
ArrayList<String> al = fpdMsa.get(saa[i][0]+row[1]+saa[i][2]+row[3]);
|
||||
ArrayList<String> al = fpdMsa.get(saa[i][ModNameCol] + row[ModVerCol] + saa[i][PkgNameCol]
|
||||
+ row[PkgVerCol]);
|
||||
if (al == null) {
|
||||
al = new ArrayList<String>();
|
||||
fpdMsa.put(saa[i][0]+row[1]+saa[i][2]+row[3], al);
|
||||
fpdMsa.put(saa[i][ModNameCol] + row[ModVerCol] + saa[i][PkgNameCol] + row[PkgVerCol], al);
|
||||
}
|
||||
al.add(saa[i][4]);
|
||||
al.add(saa[i][Path4Col]);
|
||||
|
||||
}
|
||||
}
|
||||
@ -512,14 +614,14 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
Iterator ismi = smi.iterator();
|
||||
while (ismi.hasNext()) {
|
||||
ModuleIdentification mi = (ModuleIdentification) ismi.next();
|
||||
s[0] = mi.getName();
|
||||
s[1] = mi.getVersion();
|
||||
s[2] = pi.getName();
|
||||
s[3] = pi.getVersion();
|
||||
s[ModNameCol] = mi.getName();
|
||||
s[ModVerCol] = mi.getVersion();
|
||||
s[PkgNameCol] = pi.getName();
|
||||
s[PkgVerCol] = pi.getVersion();
|
||||
try {
|
||||
s[4] = GlobalData.getMsaFile(mi).getPath().substring(System.getenv("WORKSPACE").length() + 1);
|
||||
}
|
||||
catch (Exception e) {
|
||||
s[Path4Col] = GlobalData.getMsaFile(mi).getPath()
|
||||
.substring(System.getenv("WORKSPACE").length() + 1);
|
||||
} catch (Exception e) {
|
||||
JOptionPane.showMessageDialog(frame, "Show All Modules:" + e.getMessage());
|
||||
}
|
||||
modelAllModules.addRow(s);
|
||||
@ -527,6 +629,7 @@ public class FpdFrameworkModules extends IInternalFrame {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes this
|
||||
*
|
||||
|
Reference in New Issue
Block a user