change table column positions in tables of FrameworkModules and horizontal scrollbar will appear when needed.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1259 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jlin16 2006-08-14 20:23:11 +00:00
parent d653c17a85
commit 93fd07b176
2 changed files with 82 additions and 66 deletions

View File

@ -80,20 +80,28 @@ public class FpdFrameworkModules extends IInternalFrame {
private ArrayList<ModuleIdentification> miList = null; private ArrayList<ModuleIdentification> miList = null;
private final int ModNameCol = 0; private final int ModNameColForAllModTable = 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 PkgNameColForAllModTable = 1;
private final int PathColForAllModTable = 2;
private final int PkgVerColForAllModTable = 3;
private final int ModVerColForAllModTable = 4;
private final int ModNameColForFpdModTable = 0;
private final int PkgNameColForFpdModTable = 1;
private final int PathColForFpdModTable = 2;
private final int ArchColForFpdModTable = 3;
private final int PkgVerColForFpdModTable = 4;
private final int ModVerColForFpdModTable = 5;
private final int ModNameMinWidth = 168; private final int ModNameMinWidth = 168;
private final int ModNamePrefWidth = 200; private final int ModNamePrefWidth = 200;
@ -199,31 +207,33 @@ public class FpdFrameworkModules extends IInternalFrame {
sorter.setTableHeader(jTableAllModules.getTableHeader()); sorter.setTableHeader(jTableAllModules.getTableHeader());
jTableAllModules.setRowHeight(20); jTableAllModules.setRowHeight(20);
modelAllModules.addColumn("<html>Module<br>Name</html>"); 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>Name</html>");
modelAllModules.addColumn("<html>Package<br>Version</html>");
modelAllModules.addColumn("Path"); modelAllModules.addColumn("Path");
modelAllModules.addColumn("<html>Package<br>Version</html>");
modelAllModules.addColumn("<html>Module<br>Version</html>");
javax.swing.table.TableColumn column = null; javax.swing.table.TableColumn column = null;
column = jTableAllModules.getColumnModel().getColumn(ModNameCol); column = jTableAllModules.getColumnModel().getColumn(ModNameColForAllModTable);
column.setPreferredWidth(ModNamePrefWidth); column.setPreferredWidth(ModNamePrefWidth);
column.setMinWidth(ModNameMinWidth); column.setMinWidth(ModNameMinWidth);
column = jTableAllModules.getColumnModel().getColumn(ModVerCol); column = jTableAllModules.getColumnModel().getColumn(ModVerColForAllModTable);
column.setPreferredWidth(VerPrefWidth); column.setPreferredWidth(VerPrefWidth);
column.setMaxWidth(VerMaxWidth); column.setMaxWidth(VerMaxWidth);
column.setMinWidth(VerMinWidth); column.setMinWidth(VerMinWidth);
column = jTableAllModules.getColumnModel().getColumn(PkgNameCol); column = jTableAllModules.getColumnModel().getColumn(PkgNameColForAllModTable);
column.setPreferredWidth(PkgNamePrefWidth); column.setPreferredWidth(PkgNamePrefWidth);
column.setMinWidth(PkgNameMinWidth); column.setMinWidth(PkgNameMinWidth);
column.setMaxWidth(PkgNameMaxWidth); column.setMaxWidth(PkgNameMaxWidth);
column = jTableAllModules.getColumnModel().getColumn(PkgVerCol); column = jTableAllModules.getColumnModel().getColumn(PkgVerColForAllModTable);
column.setPreferredWidth(VerPrefWidth); column.setPreferredWidth(VerPrefWidth);
column.setMaxWidth(VerMaxWidth); column.setMaxWidth(VerMaxWidth);
column.setMinWidth(VerMinWidth); column.setMinWidth(VerMinWidth);
column = jTableAllModules.getColumnModel().getColumn(Path4Col); column = jTableAllModules.getColumnModel().getColumn(PathColForAllModTable);
column.setPreferredWidth(PathPrefWidth); column.setPreferredWidth(PathPrefWidth);
column.setMinWidth(PathMinWidth); column.setMinWidth(PathMinWidth);
jTableAllModules.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jTableAllModules.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTableAllModules.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
} }
return jTableAllModules; return jTableAllModules;
} }
@ -263,7 +273,7 @@ public class FpdFrameworkModules extends IInternalFrame {
TableSorter sorter = (TableSorter) jTableAllModules.getModel(); TableSorter sorter = (TableSorter) jTableAllModules.getModel();
selectedRow = sorter.modelIndex(selectedRow); selectedRow = sorter.modelIndex(selectedRow);
String path = modelAllModules.getValueAt(selectedRow, Path4Col) + ""; String path = modelAllModules.getValueAt(selectedRow, PathColForAllModTable) + "";
ModuleIdentification mi = miList.get(selectedRow); ModuleIdentification mi = miList.get(selectedRow);
Vector<String> vArchs = null; Vector<String> vArchs = null;
try { try {
@ -305,11 +315,15 @@ public class FpdFrameworkModules extends IInternalFrame {
String arch = vArchs.get(i); String arch = vArchs.get(i);
al.add(arch); al.add(arch);
archsAdded += arch + " "; archsAdded += arch + " ";
String[] row = { "", mv, "", pv, arch, path }; String[] row = { "", "", "", "", "", "" };
if (mi != null) { if (mi != null) {
row[ModNameCol] = mi.getName(); row[ModNameColForFpdModTable] = mi.getName();
row[PkgNameCol] = mi.getPackage().getName(); row[PkgNameColForFpdModTable] = mi.getPackage().getName();
row[PathColForFpdModTable] = path;
row[ArchColForFpdModTable] = arch;
row[PkgVerColForFpdModTable] = pv;
row[ModVerColForFpdModTable] = mv;
} }
modelFpdModules.addRow(row); modelFpdModules.addRow(row);
@ -319,7 +333,7 @@ public class FpdFrameworkModules extends IInternalFrame {
//ToDo : specify archs need to add. //ToDo : specify archs need to add.
ffc.addFrameworkModulesPcdBuildDefs(mi, arch, null); ffc.addFrameworkModulesPcdBuildDefs(mi, arch, null);
} catch (Exception exception) { } catch (Exception exception) {
JOptionPane.showMessageDialog(frame, "Adding " + row[ModNameCol] + " with SupArch " + arch JOptionPane.showMessageDialog(frame, "Adding " + row[ModNameColForFpdModTable] + " with SupArch " + arch
+ ": " + exception.getMessage()); + ": " + exception.getMessage());
errorOccurred = true; errorOccurred = true;
} }
@ -383,36 +397,38 @@ public class FpdFrameworkModules extends IInternalFrame {
sorter.setTableHeader(jTableFpdModules.getTableHeader()); sorter.setTableHeader(jTableFpdModules.getTableHeader());
jTableFpdModules.setRowHeight(20); jTableFpdModules.setRowHeight(20);
modelFpdModules.addColumn("<html>Module<br>Name</html>"); 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>Name</html>");
modelFpdModules.addColumn("<html>Package<br>Version</html>");
modelFpdModules.addColumn("<html>Supported<br>Architectures</html>");
modelFpdModules.addColumn("Path"); modelFpdModules.addColumn("Path");
modelFpdModules.addColumn("<html>Supported<br>Architectures</html>");
modelFpdModules.addColumn("<html>Package<br>Version</html>");
modelFpdModules.addColumn("<html>Module<br>Version</html>");
javax.swing.table.TableColumn column = null; javax.swing.table.TableColumn column = null;
column = jTableFpdModules.getColumnModel().getColumn(ModNameCol); column = jTableFpdModules.getColumnModel().getColumn(ModNameColForFpdModTable);
column.setPreferredWidth(ModNamePrefWidth); column.setPreferredWidth(ModNamePrefWidth);
column.setMinWidth(ModNameMinWidth); column.setMinWidth(ModNameMinWidth);
column = jTableFpdModules.getColumnModel().getColumn(ModVerCol); column = jTableFpdModules.getColumnModel().getColumn(ModVerColForFpdModTable);
column.setPreferredWidth(VerPrefWidth); column.setPreferredWidth(VerPrefWidth);
column.setMaxWidth(VerMaxWidth); column.setMaxWidth(VerMaxWidth);
column.setMinWidth(VerMinWidth); column.setMinWidth(VerMinWidth);
column = jTableFpdModules.getColumnModel().getColumn(PkgNameCol); column = jTableFpdModules.getColumnModel().getColumn(PkgNameColForFpdModTable);
column.setPreferredWidth(PkgNamePrefWidth); column.setPreferredWidth(PkgNamePrefWidth);
column.setMinWidth(PkgNameMinWidth); column.setMinWidth(PkgNameMinWidth);
column.setMaxWidth(PkgNameMaxWidth); column.setMaxWidth(PkgNameMaxWidth);
column = jTableFpdModules.getColumnModel().getColumn(PkgVerCol); column = jTableFpdModules.getColumnModel().getColumn(PkgVerColForFpdModTable);
column.setPreferredWidth(VerPrefWidth); column.setPreferredWidth(VerPrefWidth);
column.setMaxWidth(VerMaxWidth); column.setMaxWidth(VerMaxWidth);
column.setMinWidth(VerMinWidth); column.setMinWidth(VerMinWidth);
column = jTableFpdModules.getColumnModel().getColumn(ArchCol); column = jTableFpdModules.getColumnModel().getColumn(ArchColForFpdModTable);
column.setPreferredWidth(ArchPrefWidth); column.setPreferredWidth(ArchPrefWidth);
column.setMaxWidth(ArchMaxWidth); column.setMaxWidth(ArchMaxWidth);
column.setMinWidth(ArchMinWidth); column.setMinWidth(ArchMinWidth);
column = jTableFpdModules.getColumnModel().getColumn(Path5Col); column = jTableFpdModules.getColumnModel().getColumn(PathColForFpdModTable);
column.setPreferredWidth(PathPrefWidth); column.setPreferredWidth(PathPrefWidth);
column.setMinWidth(PathMinWidth); column.setMinWidth(PathMinWidth);
jTableFpdModules.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jTableFpdModules.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTableFpdModules.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
} }
return jTableFpdModules; return jTableFpdModules;
} }
@ -452,11 +468,11 @@ public class FpdFrameworkModules extends IInternalFrame {
String[] sa = new String[5]; String[] sa = new String[5];
ffc.getFrameworkModuleInfo(selectedRow, sa); ffc.getFrameworkModuleInfo(selectedRow, sa);
String mg = sa[ModNameCol]; String mg = sa[0];
String mv = sa[ModVerCol]; String mv = sa[1];
String pg = sa[PkgNameCol]; String pg = sa[2];
String pv = sa[PkgVerCol]; String pv = sa[3];
String arch = sa[ArchCol]; String arch = sa[4];
settingDlg.setKey(mg + " " + mv + " " + pg + " " + pv + " " + arch, selectedRow, docConsole); settingDlg.setKey(mg + " " + mv + " " + pg + " " + pv + " " + arch, selectedRow, docConsole);
settingDlg.setVisible(true); settingDlg.setVisible(true);
} }
@ -487,14 +503,14 @@ public class FpdFrameworkModules extends IInternalFrame {
String[] sa = new String[5]; String[] sa = new String[5];
ffc.getFrameworkModuleInfo(selectedRow, sa); ffc.getFrameworkModuleInfo(selectedRow, sa);
String mg = sa[ModNameCol]; String mg = sa[0];
String mv = sa[ModVerCol]; String mv = sa[1];
String pg = sa[PkgNameCol]; String pg = sa[2];
String pv = sa[PkgVerCol]; String pv = sa[3];
String arch = sa[ArchCol]; String arch = sa[4];
ModuleIdentification mi = GlobalData.getModuleId(sa[ModNameCol] + " " + sa[ModVerCol] + " " ModuleIdentification mi = GlobalData.getModuleId(sa[0] + " " + sa[1] + " "
+ sa[PkgNameCol] + " " + sa[PkgVerCol] + " " + sa[2] + " " + sa[3] + " "
+ sa[ArchCol]); + sa[4]);
mv = mi.getVersion(); mv = mi.getVersion();
pv = mi.getPackage().getVersion(); pv = mi.getPackage().getVersion();
modelFpdModules.removeRow(selectedRow); modelFpdModules.removeRow(selectedRow);
@ -565,17 +581,17 @@ public class FpdFrameworkModules extends IInternalFrame {
String[][] saa = new String[ffc.getFrameworkModulesCount()][5]; String[][] saa = new String[ffc.getFrameworkModulesCount()][5];
ffc.getFrameworkModulesInfo(saa); ffc.getFrameworkModulesInfo(saa);
for (int i = 0; i < saa.length; ++i) { for (int i = 0; i < saa.length; ++i) {
ModuleIdentification mi = GlobalData.getModuleId(saa[i][ModNameCol] + " " + saa[i][ModVerCol] + " " ModuleIdentification mi = GlobalData.getModuleId(saa[i][0] + " " + saa[i][1] + " "
+ saa[i][PkgNameCol] + " " + saa[i][PkgVerCol]); + saa[i][2] + " " + saa[i][3]);
String[] row = { "", "", "", "", "", "" }; String[] row = { "", "", "", "", "", "" };
if (mi != null) { if (mi != null) {
row[ModNameCol] = mi.getName(); row[ModNameColForFpdModTable] = mi.getName();
row[ModVerCol] = mi.getVersion(); row[ModVerColForFpdModTable] = mi.getVersion();
row[PkgNameCol] = mi.getPackage().getName(); row[PkgNameColForFpdModTable] = mi.getPackage().getName();
row[PkgVerCol] = mi.getPackage().getVersion(); row[PkgVerColForFpdModTable] = mi.getPackage().getVersion();
row[ArchCol] = saa[i][ArchCol]; row[ArchColForFpdModTable] = saa[i][4];
try { try {
row[Path5Col] = GlobalData.getMsaFile(mi).getPath().substring( row[PathColForFpdModTable] = GlobalData.getMsaFile(mi).getPath().substring(
System.getenv("WORKSPACE") System.getenv("WORKSPACE")
.length() + 1); .length() + 1);
} catch (Exception e) { } catch (Exception e) {
@ -583,13 +599,13 @@ public class FpdFrameworkModules extends IInternalFrame {
} }
} }
modelFpdModules.addRow(row); modelFpdModules.addRow(row);
ArrayList<String> al = fpdMsa.get(saa[i][ModNameCol] + row[ModVerCol] + saa[i][PkgNameCol] ArrayList<String> al = fpdMsa.get(saa[i][0] + saa[i][1]
+ row[PkgVerCol]); + saa[i][2] + saa[i][3]);
if (al == null) { if (al == null) {
al = new ArrayList<String>(); al = new ArrayList<String>();
fpdMsa.put(saa[i][ModNameCol] + row[ModVerCol] + saa[i][PkgNameCol] + row[PkgVerCol], al); fpdMsa.put(saa[i][0] + saa[i][1] + saa[i][2] + saa[i][3], al);
} }
al.add(saa[i][Path4Col]); al.add(saa[i][4]);
} }
} }
@ -614,12 +630,12 @@ public class FpdFrameworkModules extends IInternalFrame {
Iterator ismi = smi.iterator(); Iterator ismi = smi.iterator();
while (ismi.hasNext()) { while (ismi.hasNext()) {
ModuleIdentification mi = (ModuleIdentification) ismi.next(); ModuleIdentification mi = (ModuleIdentification) ismi.next();
s[ModNameCol] = mi.getName(); s[ModNameColForAllModTable] = mi.getName();
s[ModVerCol] = mi.getVersion(); s[ModVerColForAllModTable] = mi.getVersion();
s[PkgNameCol] = pi.getName(); s[PkgNameColForAllModTable] = pi.getName();
s[PkgVerCol] = pi.getVersion(); s[PkgVerColForAllModTable] = pi.getVersion();
try { try {
s[Path4Col] = GlobalData.getMsaFile(mi).getPath() s[PathColForAllModTable] = GlobalData.getMsaFile(mi).getPath()
.substring(System.getenv("WORKSPACE").length() + 1); .substring(System.getenv("WORKSPACE").length() + 1);
} catch (Exception e) { } catch (Exception e) {
JOptionPane.showMessageDialog(frame, "Show All Modules:" + e.getMessage()); JOptionPane.showMessageDialog(frame, "Show All Modules:" + e.getMessage());

View File

@ -369,13 +369,13 @@ public class SurfaceAreaQuery {
while(ispi.hasNext()) { while(ispi.hasNext()) {
PackageIdentification pi = ispi.next(); PackageIdentification pi = ispi.next();
if (packageVersion != null) { if (packageVersion != null) {
if (pi.getGuid().equals(packageGuid) && pi.getVersion().equals(packageVersion)) { if (pi.getGuid().equalsIgnoreCase(packageGuid) && pi.getVersion().equals(packageVersion)) {
packageIdList[i] = pi; packageIdList[i] = pi;
break; break;
} }
} }
else { else {
if (pi.getGuid().equals(packageGuid)) { if (pi.getGuid().equalsIgnoreCase(packageGuid)) {
if (pi.getVersion() != null && pi.getVersion().compareTo(ver) > 0){ if (pi.getVersion() != null && pi.getVersion().compareTo(ver) > 0){
ver = pi.getVersion(); ver = pi.getVersion();
packageIdList[i] = pi; packageIdList[i] = pi;