summaryrefslogtreecommitdiff
path: root/Tools/Source/FrameworkWizard
diff options
context:
space:
mode:
authorlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-22 20:41:52 +0000
committerlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-22 20:41:52 +0000
commit8a11d13aa30c03625afd77034603e4c9de090da5 (patch)
tree8b1ad1f90d658941cd3c93fe408db799d026c5dd /Tools/Source/FrameworkWizard
parentcdffd38d375b85483e64fac3d86963eaa85573cd (diff)
downloadedk2-8a11d13aa30c03625afd77034603e4c9de090da5.zip
edk2-8a11d13aa30c03625afd77034603e4c9de090da5.tar.gz
edk2-8a11d13aa30c03625afd77034603e4c9de090da5.tar.bz2
Updated ArchCheckBox.java and Preferences.java to support enable, disable of individual checkboxes. The Preferences will now enable the Architectures which have tools defined in tools_def.txt. If no tool is defined for an architecture, the checkbox is disabled.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1354 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Source/FrameworkWizard')
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java83
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/Preferences.java29
2 files changed, 103 insertions, 9 deletions
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java
index 76c29da..62d4a33 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java
@@ -40,7 +40,7 @@ public class ArchCheckBox extends JPanel {
private JCheckBox jCheckBoxArm = null;
private JCheckBox jCheckBoxPpc = null;
-
+
/**
* This method initializes jCheckBoxIa32
*
@@ -155,7 +155,7 @@ public class ArchCheckBox extends JPanel {
this.add(getJCheckBoxPpc(), null);
this.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
}
-
+
public Vector<String> getSelectedItemsVector() {
Vector<String> v = new Vector<String>();
if (this.jCheckBoxIa32.isSelected()) {
@@ -178,7 +178,7 @@ public class ArchCheckBox extends JPanel {
}
return v;
}
-
+
public String getSelectedItemsString() {
String s = "";
if (this.jCheckBoxIa32.isSelected()) {
@@ -201,7 +201,7 @@ public class ArchCheckBox extends JPanel {
}
return s.trim();
}
-
+
public void setAllItemsSelected(boolean isSelected) {
this.jCheckBoxIa32.setSelected(isSelected);
this.jCheckBoxX64.setSelected(isSelected);
@@ -210,7 +210,7 @@ public class ArchCheckBox extends JPanel {
this.jCheckBoxArm.setSelected(isSelected);
this.jCheckBoxPpc.setSelected(isSelected);
}
-
+
public void setSelectedItems(Vector<String> v) {
setAllItemsSelected(false);
if (v != null) {
@@ -242,4 +242,77 @@ public class ArchCheckBox extends JPanel {
}
}
}
+
+ public void setAllItemsEnabled(boolean isEnabled) {
+ this.jCheckBoxIa32.setEnabled(isEnabled);
+ this.jCheckBoxX64.setEnabled(isEnabled);
+ this.jCheckBoxIpf.setEnabled(isEnabled);
+ this.jCheckBoxEbc.setEnabled(isEnabled);
+ this.jCheckBoxArm.setEnabled(isEnabled);
+ this.jCheckBoxPpc.setEnabled(isEnabled);
+ }
+
+ public void setEnabledItems(Vector<String> v) {
+ setAllItemsEnabled(false);
+ if (v != null) {
+ for (int index = 0; index < v.size(); index++) {
+ if (v.get(index).equals(this.jCheckBoxIa32.getText())) {
+ this.jCheckBoxIa32.setEnabled(true);
+ continue;
+ }
+ if (v.get(index).equals(this.jCheckBoxIpf.getText())) {
+ this.jCheckBoxIpf.setEnabled(true);
+ continue;
+ }
+ if (v.get(index).equals(this.jCheckBoxX64.getText())) {
+ this.jCheckBoxX64.setEnabled(true);
+ continue;
+ }
+ if (v.get(index).equals(this.jCheckBoxEbc.getText())) {
+ this.jCheckBoxEbc.setEnabled(true);
+ continue;
+ }
+ if (v.get(index).equals(this.jCheckBoxArm.getText())) {
+ this.jCheckBoxArm.setEnabled(true);
+ continue;
+ }
+ if (v.get(index).equals(this.jCheckBoxPpc.getText())) {
+ this.jCheckBoxPpc.setEnabled(true);
+ continue;
+ }
+ }
+ }
+ }
+
+ public void setDisabledItems(Vector<String> v) {
+ setAllItemsEnabled(true);
+ if (v != null) {
+ for (int index = 0; index < v.size(); index++) {
+ if (v.get(index).equals(this.jCheckBoxIa32.getText())) {
+ this.jCheckBoxIa32.setEnabled(false);
+ continue;
+ }
+ if (v.get(index).equals(this.jCheckBoxIpf.getText())) {
+ this.jCheckBoxIpf.setEnabled(false);
+ continue;
+ }
+ if (v.get(index).equals(this.jCheckBoxX64.getText())) {
+ this.jCheckBoxX64.setEnabled(false);
+ continue;
+ }
+ if (v.get(index).equals(this.jCheckBoxEbc.getText())) {
+ this.jCheckBoxEbc.setEnabled(false);
+ continue;
+ }
+ if (v.get(index).equals(this.jCheckBoxArm.getText())) {
+ this.jCheckBoxArm.setEnabled(false);
+ continue;
+ }
+ if (v.get(index).equals(this.jCheckBoxPpc.getText())) {
+ this.jCheckBoxPpc.setEnabled(false);
+ continue;
+ }
+ }
+ }
+ }
}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/Preferences.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/Preferences.java
index ded198d..1082cc3 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/Preferences.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/Preferences.java
@@ -198,6 +198,8 @@ public class Preferences extends IFrame {
private Vector<String> vArchList = null;
+ private Vector<String> vDisableArchList = null;
+
//
// Not used by UI
//
@@ -246,7 +248,8 @@ public class Preferences extends IFrame {
jComboBoxActivePlatform.setBounds(new java.awt.Rectangle(valueColumn, activePlatformRow, valueWidth,
oneRowHeight));
jComboBoxActivePlatform.setPreferredSize(new java.awt.Dimension(valueWidth, oneRowHeight));
- jComboBoxActivePlatform.setToolTipText("<html>Select &quot;Do Not Set&quot; if you want to build a platform"
+ jComboBoxActivePlatform
+ .setToolTipText("<html>Select &quot;Do Not Set&quot; if you want to build a platform"
+ "<br>from the directory where the FPD file exists,"
+ "<br>otherwise scroll down to select the platform.</html>");
@@ -299,7 +302,7 @@ public class Preferences extends IFrame {
private ICheckBoxList getICheckBoxListTagName() {
if (iCheckBoxListTagName == null) {
iCheckBoxListTagName = new ICheckBoxList();
-
+
if (toolsDefTagNames != null) {
toolsDefTagNames.trim();
String aTagNames[] = toolsDefTagNames.trim().split(" ");
@@ -312,7 +315,7 @@ public class Preferences extends IFrame {
Vector<String> defaultTags = stringToVector("MYTOOLS");
iCheckBoxListTagName.setAllItems(defaultTags);
}
-
+
iCheckBoxListTagName.setAllItemsUnchecked();
iCheckBoxListTagName.setToolTipText("<html>"
+ "Specify the TagName(s) from the tool configuration file to use"
@@ -358,7 +361,7 @@ public class Preferences extends IFrame {
private ICheckBoxList getICheckBoxListBuildTarget() {
if (iCheckBoxListBuildTarget == null) {
-
+
String aBuildTargets[] = toolsDefTargetNames.trim().split(" ");
Vector<String> vBuildTargets = new Vector<String>();
for (int i = 0; i < aBuildTargets.length; i++) {
@@ -613,6 +616,23 @@ public class Preferences extends IFrame {
lineCounter++;
}
reader.close();
+ // Only enable Architecture selection based on tool chain installations
+ String turnOff = "";
+ if (!toolsDefArchNames.contains("EBC"))
+ turnOff = "EBC ";
+ if (!toolsDefArchNames.contains("PPC"))
+ turnOff += "PPC ";
+ if (!toolsDefArchNames.contains("IPF"))
+ turnOff += "IPF ";
+ if (!toolsDefArchNames.contains("X64"))
+ turnOff += "X64 ";
+ if (!toolsDefArchNames.contains("IA32"))
+ turnOff += "X64 ";
+ if (!toolsDefArchNames.contains("ARM"))
+ turnOff += "ARM ";
+ turnOff = turnOff.trim();
+ vDisableArchList = stringToVector(turnOff);
+
if (!toolsDefTargetNames.matches("[A-Z]+")) {
toolsDefTargetNames = toolsDefTargetNames.replace("* ", "").trim();
if (Debug)
@@ -751,6 +771,7 @@ public class Preferences extends IFrame {
jContentPane.add(jLabelTargetArch, null);
+ jArchCheckBox.setDisabledItems(vDisableArchList);
jArchCheckBox.setSelectedItems(vArchList);
jContentPane.add(jArchCheckBox, null);