diff options
author | jlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-11-24 08:39:20 +0000 |
---|---|---|
committer | jlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-11-24 08:39:20 +0000 |
commit | 85d9e5b10de1b5eee480a55211e31cc2e0fb8d3a (patch) | |
tree | 12d27b69feadd4b0a31669022a5a9cab177ddea0 | |
parent | c25aaa00aa0e39ed1242a29576703cffedef850a (diff) | |
download | edk2-85d9e5b10de1b5eee480a55211e31cc2e0fb8d3a.zip edk2-85d9e5b10de1b5eee480a55211e31cc2e0fb8d3a.tar.gz edk2-85d9e5b10de1b5eee480a55211e31cc2e0fb8d3a.tar.bz2 |
Fix Sku Info update UI refresh to update the dynamic pcd value for selected sku id.
Fix the phenomena of endless warning message when opening FrameworkModules pane after changing workspace.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2010 6f19259b-4bc3-4df7-8a09-765794883524
6 files changed, 82 insertions, 58 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java index b6de4eb..0bdcfc8 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java @@ -52,6 +52,7 @@ import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
+import org.tianocore.frameworkwizard.workspace.Workspace;
import java.io.File;
import java.util.ArrayList;
@@ -1956,7 +1957,7 @@ public class FpdBuildOptions extends IInternalFrame { //
// Select files from current workspace
//
- String dirPrefix = System.getenv("WORKSPACE");
+ String dirPrefix = Workspace.getCurrentWorkspace();
JFileChooser chooser = new JFileChooser(dirPrefix);
File theFile = null;
String headerDest = null;
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java index 04fc791..c7a455e 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java @@ -191,7 +191,9 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame { // should display default sku info here, as no selection event of table1 will be triggered when change selection of rows in table.
//
private void displayDetails(int i) {
- jTableSkuInfo.changeSelection(0, 1, false, false);
+ int defaultSkuRow = getDefaultSkuInfoRow();
+ jTableSkuInfo.changeSelection(defaultSkuRow, 0, false, false);
+
int skuCount = ffc.getDynamicPcdSkuInfoCount(i);
String defaultVal = ffc.getDynamicPcdBuildDataValue(i);
if (defaultVal != null) {
@@ -237,34 +239,49 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame { }
- private void displaySkuInfoDetails(int i) {
+ private void displaySkuInfoDetails(String id) {
int pcdSelected = jTableDynPcd.getSelectedRow();
if (pcdSelected < 0) {
return;
}
- String[][] saa = new String[ffc.getDynamicPcdSkuInfoCount(pcdSelected)][7];
+ int skuInfoCount = ffc.getDynamicPcdSkuInfoCount(pcdSelected);
+ String[][] saa = new String[skuInfoCount][7];
ffc.getDynamicPcdSkuInfos(pcdSelected, saa);
-
- if (saa[i][5] != null){
- jRadioButtonVpd.setSelected(true);
- jTextFieldVpdOffset.setText(saa[i][5]);
- }
-
- else if (saa[i][1] != null) {
- jRadioButtonHii.setSelected(true);
- String varDisplayName = Tools.convertUnicodeHexStringToString(saa[i][1]);
- jTextFieldVarName.setText(varDisplayName);
- jTextFieldVarGuid.setText(saa[i][2]);
- jTextFieldVarOffset.setText(saa[i][3]);
- jTextFieldHiiDefaultValue.setText(saa[i][4]);
- }
-
- else{
- jRadioButtonDefaultValue.setSelected(true);
- jTextFieldDefaultValue.setText(saa[i][6]);
+ int i = 0;
+ while (i < skuInfoCount) {
+ if (id.equals(saa[i][0])) {
+ if (saa[i][5] != null){
+ jRadioButtonVpd.setSelected(true);
+ jTextFieldVpdOffset.setText(saa[i][5]);
+ }
+
+ else if (saa[i][1] != null) {
+ jRadioButtonHii.setSelected(true);
+ String varDisplayName = Tools.convertUnicodeHexStringToString(saa[i][1]);
+ jTextFieldVarName.setText(varDisplayName);
+ jTextFieldVarGuid.setText(saa[i][2]);
+ jTextFieldVarOffset.setText(saa[i][3]);
+ jTextFieldHiiDefaultValue.setText(saa[i][4]);
+ }
+
+ else{
+ jRadioButtonDefaultValue.setSelected(true);
+ jTextFieldDefaultValue.setText(saa[i][6]);
+ }
+ return;
+ }
+ ++i;
}
-
+ }
+
+ private int getDefaultSkuInfoRow () {
+ for (int i = 0; i < modelSku.getRowCount(); ++i) {
+ if (modelSku.getValueAt(i, 0).equals("0")) {
+ return i;
+ }
+ }
+ return 0;
}
/**
@@ -300,6 +317,10 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame { jCheckBoxSkuEnable.setText("SKU Enable");
jCheckBoxSkuEnable.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent e) {
+ if (!jCheckBoxSkuEnable.isSelected()) {
+ int defaultSkuRow = getDefaultSkuInfoRow();
+ jTableSkuInfo.changeSelection(defaultSkuRow, 0, false, false);
+ }
jTableSkuInfo.setEnabled(jCheckBoxSkuEnable.isSelected());
}
});
@@ -450,7 +471,7 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame { jTableSkuInfo = new JTable(modelSku);
modelSku.addColumn("SKU ID");
modelSku.addColumn("SKU Name");
-
+ jTableSkuInfo.setEnabled(false);
jTableSkuInfo.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTableSkuInfo.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
public void valueChanged(ListSelectionEvent e) {
@@ -472,7 +493,8 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame { jTextFieldVarOffset.setText("");
jTextFieldHiiDefaultValue.setText("");
int selected = lsm.getMinSelectionIndex();
- displaySkuInfoDetails(selected);
+ String skuId = modelSku.getValueAt(selected, 0)+"";
+ displaySkuInfoDetails(skuId);
}
}
});
@@ -602,7 +624,7 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame { if (skuCount == 1) {
for (int i = 1; i < jTableSkuInfo.getRowCount(); ++i) {
- ffc.genDynamicPcdBuildDataSkuInfo(jTableSkuInfo.getValueAt(i, 0)+"", varName, varGuid, varOffset, hiiDefault, vpdOffset, value, pcdSelected);
+ ffc.genDynamicPcdBuildDataSkuInfo(modelSku.getValueAt(i, 0)+"", varName, varGuid, varOffset, hiiDefault, vpdOffset, value, pcdSelected);
}
}
else {
@@ -610,7 +632,7 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame { if (row < 0) {
return;
}
- ffc.updateDynamicPcdBuildDataSkuInfo(jTableSkuInfo.getValueAt(row, 0)+"", varName, varGuid, varOffset, hiiDefault, vpdOffset, value, pcdSelected);
+ ffc.updateDynamicPcdBuildDataSkuInfo(modelSku.getValueAt(row, 0)+"", varName, varGuid, varOffset, hiiDefault, vpdOffset, value, pcdSelected);
}
}
}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java index f7de3a7..67b7ad8 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java @@ -62,6 +62,7 @@ import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile; import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
+import org.tianocore.frameworkwizard.workspace.Workspace;
/**
This class processes fpd file contents such as add remove xml elements.
@@ -829,7 +830,7 @@ public class FpdFileContents { XmlCursor cursor = instance.newCursor();
try{
String comment = "Pkg: " + pn + " Mod: " + mn
- + " Path: " + libMi.getPath().substring(System.getenv("WORKSPACE").length() + 1);
+ + " Path: " + libMi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1);
cursor.insertComment(comment);
}
catch (Exception e){
@@ -1232,7 +1233,7 @@ public class FpdFileContents { XmlCursor cursor = msa.newCursor();
try{
String comment = "Mod: " + mi.getName() + " Type: " + SurfaceAreaQuery.getModuleType(mi) + " Path: "
- + mi.getPath().substring(System.getenv("WORKSPACE").length() + 1);
+ + mi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1);
cursor.insertComment(comment);
}
catch(Exception e){
@@ -1507,7 +1508,7 @@ public class FpdFileContents { saa[i][1] = dynPcd.getToken().toString();
saa[i][2] = dynPcd.getTokenSpaceGuidCName();
saa[i][3] = dynPcd.getMaxDatumSize()+"";
- saa[i][4] = dynPcd.getDatumType().toString();
+ saa[i][4] = dynPcd.getDatumType()+"";
++i;
}
@@ -1732,9 +1733,10 @@ public class FpdFileContents { return;
}
else {
- QName qSkuInfo = new QName(xmlNs, "SkuInfo");
- cursor.toChild(qSkuInfo);
- cursor.removeXml();
+ pcdData.getSkuInfoList().clear();
+// QName qSkuInfo = new QName(xmlNs, "SkuInfo");
+// cursor.toChild(qSkuInfo);
+// cursor.removeXml();
}
}
cursor.dispose();
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFlash.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFlash.java index 5717b3b..af164d7 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFlash.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFlash.java @@ -31,6 +31,7 @@ import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;
+import org.tianocore.frameworkwizard.workspace.Workspace;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
@@ -1024,7 +1025,7 @@ public class FpdFlash extends IInternalFrame { public void componentShown(ComponentEvent e) {
// if (ffc.getFlashDefinitionFile() != null) {
// jTextFieldFdf.setText(ffc.getFlashDefinitionFile());
-// initFvInFdfTable(System.getenv("WORKSPACE") + File.separator + jTextFieldFdf.getText());
+// initFvInFdfTable(Workspace.getCurrenetWorkspace() + File.separator + jTextFieldFdf.getText());
//
// }
}
@@ -1112,7 +1113,7 @@ public class FpdFlash extends IInternalFrame { public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
- String wsDir = System.getenv("WORKSPACE");
+ String wsDir = Workspace.getCurrentWorkspace();
JFileChooser chooser = new JFileChooser(wsDir);
chooser.setMultiSelectionEnabled(false);
chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
@@ -2292,7 +2293,7 @@ public class FpdFlash extends IInternalFrame { if (fdfFile != null && fdfFile.length() > 0) {
jCheckBoxFdf.setSelected(true);
jTextFieldFdf.setText(fdfFile);
- String fdfPath = System.getenv("WORKSPACE") + File.separator + fdfFile;
+ String fdfPath = Workspace.getCurrentWorkspace() + File.separator + fdfFile;
initFvInFdfTable(fdfPath);
}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java index 1f1bf21..2d8b237 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java @@ -37,6 +37,7 @@ import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery;
import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;
+import org.tianocore.frameworkwizard.workspace.Workspace;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import java.awt.FlowLayout;
@@ -893,7 +894,7 @@ public class FpdFrameworkModules extends IInternalFrame { row[pkgVerColForFpdModTable] = mi.getPackageId().getVersion();
row[archColForFpdModTable] = saa[i][ffcModArch];
try {
- row[pathColForFpdModTable] = mi.getPath().substring(System.getenv("WORKSPACE").length() + 1);
+ row[pathColForFpdModTable] = mi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1);
} catch (Exception e) {
JOptionPane.showMessageDialog(frame, "Show FPD Modules:" + e.getMessage());
}
@@ -960,7 +961,7 @@ public class FpdFrameworkModules extends IInternalFrame { s[pkgNameColForAllModTable] = mi.getPackageId().getName();
s[pkgVerColForAllModTable] = mi.getPackageId().getVersion();
try {
- s[pathColForAllModTable] = mi.getPath().substring(System.getenv("WORKSPACE").length() + 1);
+ s[pathColForAllModTable] = mi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1);
} catch (Exception e) {
JOptionPane.showMessageDialog(frame, "Show All Modules:" + e.getMessage());
}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java index e46a9bb..72da8bd 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java @@ -1695,25 +1695,22 @@ private JComboBox getJComboBoxItemType() { if (jComboBoxItemType == null) {
jComboBoxItemType = new JComboBox();
jComboBoxItemType.setPreferredSize(new java.awt.Dimension(200,20));
-// jComboBoxItemType.addItemListener(new java.awt.event.ItemListener() {
-// public void itemStateChanged(java.awt.event.ItemEvent e) {
-//
-// int row = jTablePcd.getSelectedRow();
-// if (row < 0 || model.getValueAt(row, 2).equals(jComboBoxItemType.getSelectedItem())) {
-// return;
-// }
-// if (!jComboBoxItemType.getSelectedItem().equals("DYNAMIC")) {
-//
-// if (jComboBoxItemType.getSelectedItem().equals("FIXED_AT_BUILD")) {
-// jTextFieldPcdDefault.setText("");
-// jTextFieldPcdDefault.setEnabled(true);
-// }
-// }
-// else{
-//
-// }
-// }
-// });
+ jComboBoxItemType.addItemListener(new java.awt.event.ItemListener() {
+ public void itemStateChanged(java.awt.event.ItemEvent e) {
+
+ int row = jTablePcd.getSelectedRow();
+ if (row < 0 || model.getValueAt(row, 2).equals(jComboBoxItemType.getSelectedItem())) {
+ return;
+ }
+
+ if (jComboBoxItemType.getSelectedItem().equals("FIXED_AT_BUILD")) {
+ jTextFieldPcdDefault.setEnabled(true);
+ }
+ else {
+ jTextFieldPcdDefault.setEnabled(false);
+ }
+ }
+ });
}
return jComboBoxItemType;
}
@@ -1752,7 +1749,7 @@ private void pcdNonDynamicToDynamic(String cName, String tsGuid) { al.set(i, mKey + " " + itemType);
}
try{
- ffc.addDynamicPcdBuildData(cName, jTablePcd.getValueAt(jTablePcd.getSelectedRow(), 3), tsGuid, "DYNAMIC", jTablePcd.getValueAt(jTablePcd.getSelectedRow(), 5)+"", jTextFieldPcdDefault.isVisible() ? jTextFieldPcdDefault.getText() : jComboBoxFeatureFlagValue.getSelectedItem()+"");
+ ffc.addDynamicPcdBuildData(cName, model.getValueAt(jTablePcd.getSelectedRow(), 3), tsGuid, "DYNAMIC", model.getValueAt(jTablePcd.getSelectedRow(), 5)+"", jTextFieldPcdDefault.isVisible() ? jTextFieldPcdDefault.getText() : jComboBoxFeatureFlagValue.getSelectedItem()+"");
}
catch(Exception e){
JOptionPane.showMessageDialog(frame, "PCD value format: " + e.getMessage());
|