X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2Fcommon%2Fui%2FArchCheckBox.java;h=62d4a33cb22fea8e439bd3b72069838e83ab701a;hp=0e051d421b257269070cb1f94a560f1a49b37b16;hb=8a11d13aa30c03625afd77034603e4c9de090da5;hpb=ffebd360b80d91667e24aaf181ddbd1daf22d15f 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 0e051d421b..62d4a33cb2 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 @@ -17,15 +17,15 @@ package org.tianocore.frameworkwizard.common.ui; import java.util.Vector; -import javax.swing.JPanel; import javax.swing.JCheckBox; +import javax.swing.JPanel; import org.tianocore.frameworkwizard.common.DataType; public class ArchCheckBox extends JPanel { /// - /// + /// Define class members /// private static final long serialVersionUID = 4792669775676953990L; @@ -131,16 +131,6 @@ public class ArchCheckBox extends JPanel { return jCheckBoxPpc; } - /** - - @param args - - **/ - public static void main(String[] args) { - // TODO Auto-generated method stub - - } - /** * This is the default constructor */ @@ -165,7 +155,7 @@ public class ArchCheckBox extends JPanel { this.add(getJCheckBoxPpc(), null); this.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT); } - + public Vector getSelectedItemsVector() { Vector v = new Vector(); if (this.jCheckBoxIa32.isSelected()) { @@ -188,7 +178,7 @@ public class ArchCheckBox extends JPanel { } return v; } - + public String getSelectedItemsString() { String s = ""; if (this.jCheckBoxIa32.isSelected()) { @@ -211,7 +201,7 @@ public class ArchCheckBox extends JPanel { } return s.trim(); } - + public void setAllItemsSelected(boolean isSelected) { this.jCheckBoxIa32.setSelected(isSelected); this.jCheckBoxX64.setSelected(isSelected); @@ -220,7 +210,7 @@ public class ArchCheckBox extends JPanel { this.jCheckBoxArm.setSelected(isSelected); this.jCheckBoxPpc.setSelected(isSelected); } - + public void setSelectedItems(Vector v) { setAllItemsSelected(false); if (v != null) { @@ -252,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 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 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; + } + } + } + } }