mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
cdffd38d37
commit
8a11d13aa3
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 "Do Not Set" if you want to build a platform"
|
||||
jComboBoxActivePlatform
|
||||
.setToolTipText("<html>Select "Do Not Set" 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>");
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue