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=e564ab5effb568b2d97d9e7749e9ad3c3d38c971;hb=8a11d13aa30c03625afd77034603e4c9de090da5;hpb=06a19ceec7b8b78f4698073ce4054b26dc4a74bd 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 e564ab5eff..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,13 +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; @@ -47,8 +49,9 @@ public class ArchCheckBox extends JPanel { private JCheckBox getJCheckBoxIa32() { if (jCheckBoxIa32 == null) { jCheckBoxIa32 = new JCheckBox(); - jCheckBoxIa32.setBounds(new java.awt.Rectangle(0, 0, 50, 20)); + jCheckBoxIa32.setBounds(new java.awt.Rectangle(0, 0, 55, 20)); jCheckBoxIa32.setText("IA32"); + jCheckBoxIa32.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT); } return jCheckBoxIa32; } @@ -61,8 +64,9 @@ public class ArchCheckBox extends JPanel { private JCheckBox getJCheckBoxX64() { if (jCheckBoxX64 == null) { jCheckBoxX64 = new JCheckBox(); - jCheckBoxX64.setBounds(new java.awt.Rectangle(50, 0, 50, 20)); + jCheckBoxX64.setBounds(new java.awt.Rectangle(55, 0, 53, 20)); jCheckBoxX64.setText("X64"); + jCheckBoxX64.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT); } return jCheckBoxX64; } @@ -75,8 +79,9 @@ public class ArchCheckBox extends JPanel { private JCheckBox getJCheckBoxIpf() { if (jCheckBoxIpf == null) { jCheckBoxIpf = new JCheckBox(); - jCheckBoxIpf.setBounds(new java.awt.Rectangle(100, 0, 50, 20)); + jCheckBoxIpf.setBounds(new java.awt.Rectangle(108, 0, 52, 20)); jCheckBoxIpf.setText("IPF"); + jCheckBoxIpf.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT); } return jCheckBoxIpf; } @@ -89,8 +94,9 @@ public class ArchCheckBox extends JPanel { private JCheckBox getJCheckBoxEbc() { if (jCheckBoxEbc == null) { jCheckBoxEbc = new JCheckBox(); - jCheckBoxEbc.setBounds(new java.awt.Rectangle(150, 0, 50, 20)); + jCheckBoxEbc.setBounds(new java.awt.Rectangle(160, 0, 53, 20)); jCheckBoxEbc.setText("EBC"); + jCheckBoxEbc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT); } return jCheckBoxEbc; } @@ -103,36 +109,28 @@ public class ArchCheckBox extends JPanel { private JCheckBox getJCheckBoxArm() { if (jCheckBoxArm == null) { jCheckBoxArm = new JCheckBox(); - jCheckBoxArm.setBounds(new java.awt.Rectangle(200, 0, 55, 20)); + jCheckBoxArm.setBounds(new java.awt.Rectangle(213, 0, 54, 20)); jCheckBoxArm.setText("ARM"); + jCheckBoxArm.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT); } return jCheckBoxArm; } /** - * This method initializes jCheckBoxPrc + * This method initializes jCheckBoxPpc * * @return javax.swing.JCheckBox */ private JCheckBox getJCheckBoxPpc() { if (jCheckBoxPpc == null) { jCheckBoxPpc = new JCheckBox(); - jCheckBoxPpc.setBounds(new java.awt.Rectangle(255, 0, 50, 20)); + jCheckBoxPpc.setBounds(new java.awt.Rectangle(267, 0, 53, 20)); jCheckBoxPpc.setText("PPC"); + jCheckBoxPpc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT); } return jCheckBoxPpc; } - /** - - @param args - - **/ - public static void main(String[] args) { - // TODO Auto-generated method stub - - } - /** * This is the default constructor */ @@ -155,8 +153,9 @@ public class ArchCheckBox extends JPanel { this.add(getJCheckBoxEbc(), null); this.add(getJCheckBoxArm(), null); this.add(getJCheckBoxPpc(), null); + this.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT); } - + public Vector getSelectedItemsVector() { Vector v = new Vector(); if (this.jCheckBoxIa32.isSelected()) { @@ -179,7 +178,7 @@ public class ArchCheckBox extends JPanel { } return v; } - + public String getSelectedItemsString() { String s = ""; if (this.jCheckBoxIa32.isSelected()) { @@ -202,8 +201,8 @@ public class ArchCheckBox extends JPanel { } return s.trim(); } - - public void setAllItmesSelected(boolean isSelected) { + + public void setAllItemsSelected(boolean isSelected) { this.jCheckBoxIa32.setSelected(isSelected); this.jCheckBoxX64.setSelected(isSelected); this.jCheckBoxIpf.setSelected(isSelected); @@ -211,9 +210,9 @@ public class ArchCheckBox extends JPanel { this.jCheckBoxArm.setSelected(isSelected); this.jCheckBoxPpc.setSelected(isSelected); } - + public void setSelectedItems(Vector v) { - setAllItmesSelected(false); + setAllItemsSelected(false); if (v != null) { for (int index = 0; index < v.size(); index++) { if (v.get(index).equals(this.jCheckBoxIa32.getText())) { @@ -243,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; + } + } + } + } }