]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java
Restructuring for better separation of Tool packages.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / common / ui / iCheckBoxList / ICheckBoxList.java
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java
deleted file mode 100644 (file)
index 2361c77..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/** @file\r
\r
- The file is used to override JList to create a List with CheckBox item \r
\r
- Copyright (c) 2006, Intel Corporation\r
- All rights reserved. This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution.  The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
- **/\r
-package org.tianocore.frameworkwizard.common.ui.iCheckBoxList;\r
-\r
-import java.util.Vector;\r
-\r
-import javax.swing.JList;\r
-\r
-public class ICheckBoxList extends JList {\r
-    ///\r
-    /// Define class Serial Version UID\r
-    ///\r
-    private static final long serialVersionUID = -2843059688070447632L;\r
-\r
-    protected ICheckBoxListCellRenderer cellrenderer = new ICheckBoxListCellRenderer();\r
-\r
-    protected ICheckBoxListener listener = new ICheckBoxListener(this);\r
-\r
-    protected ICheckBoxListModel model = new ICheckBoxListModel();\r
-\r
-    /**\r
-     This the default Constructor\r
-     \r
-     **/\r
-    public ICheckBoxList() {\r
-        this(null);\r
-    }\r
-\r
-    /**\r
-     This the override constructor to create checkbox item with input vector\r
-     \r
-     @param options\r
-     \r
-     **/\r
-    public ICheckBoxList(Vector<ICheckBoxListItem> items) {\r
-        if (items != null) {\r
-            for (int index = 0; index < items.size(); index++) {\r
-                model.addElement(items.elementAt(index));\r
-            }\r
-        }\r
-        this.setCellRenderer(cellrenderer);\r
-        this.setModel(model);\r
-        this.addMouseListener(listener);\r
-        this.addKeyListener(listener);\r
-    }\r
-\r
-    /**\r
-     Set all items of the CheckBoxList component.\r
-     \r
-     @param items\r
-     \r
-     **/\r
-    public void setAllItems(Vector<String> items) {\r
-        if (items != null) {\r
-            model.removeAllElements();\r
-            for (int index = 0; index < items.size(); index++) {\r
-                model.addElement(new ICheckBoxListItem(items.elementAt(index)));\r
-            }\r
-        }\r
-    }\r
-\r
-    /**\r
-     Get All Checked Items of the CheckBoxList component.\r
-     \r
-     @return    All Checked Items\r
-     **/\r
-    public Vector<ICheckBoxListItem> getAllCheckedItems() {\r
-        Vector<ICheckBoxListItem> result = new Vector<ICheckBoxListItem>();\r
-\r
-        for (int i = 0; i < this.getModel().getSize(); i++) {\r
-            if (((ICheckBoxListItem) this.getModel().getElementAt(i)).isChecked()) {\r
-                result.addElement((ICheckBoxListItem) this.getModel().getElementAt(i));\r
-            }\r
-        }\r
-        return result;\r
-    }\r
-    \r
-    /**\r
-    Get All Checked Items index of the CheckBoxList component.\r
-    \r
-    @return    All Checked Items index\r
-    **/\r
-   public Vector<Integer> getAllCheckedItemsIndex() {\r
-       Vector<Integer> result = new Vector<Integer>();\r
-\r
-       for (int i = 0; i < this.getModel().getSize(); i++) {\r
-           if (((ICheckBoxListItem) this.getModel().getElementAt(i)).isChecked()) {\r
-               result.addElement(i);\r
-           }\r
-       }\r
-       return result;\r
-   }\r
-\r
-    /**\r
-     Get All Checked Items String of the CheckBoxList component.\r
-     \r
-     @return Vector\r
-     **/\r
-    public Vector<String> getAllCheckedItemsString() {\r
-        Vector<String> result = new Vector<String>();\r
-\r
-        for (int i = 0; i < this.getModel().getSize(); i++) {\r
-            if (((ICheckBoxListItem) this.getModel().getElementAt(i)).isChecked()) {\r
-                result.addElement(((ICheckBoxListItem) this.getModel().getElementAt(i)).text);\r
-            }\r
-        }\r
-        return result;\r
-    }\r
-    \r
-    /**\r
-    Get All Items String of the CheckBoxList component.\r
-    \r
-    @return Vector\r
-    **/\r
-   public Vector<String> getAllItemsString() {\r
-       Vector<String> result = new Vector<String>();\r
-\r
-       for (int i = 0; i < this.getModel().getSize(); i++) {\r
-           result.addElement(((ICheckBoxListItem) this.getModel().getElementAt(i)).text);\r
-       }\r
-       return result;\r
-   }\r
-\r
-    /**\r
-     Set Checked status for all input items.\r
-     \r
-     **/\r
-    public void initCheckedItem(boolean bool, Vector<String> items) {\r
-        if (items != null && items.size() != 0) {\r
-            for (int indexI = 0; indexI < items.size(); indexI++) {\r
-                for (int indexJ = 0; indexJ < model.size(); indexJ++) {\r
-                    if (items.elementAt(indexI).equals(model.getAllElements().elementAt(indexJ).getText())) {\r
-                        ICheckBoxListItem listItem = (ICheckBoxListItem) model.get(indexJ);\r
-                        listItem.setChecked(bool);\r
-                        break;\r
-                    }\r
-                }\r
-            }\r
-        }\r
-        this.validate();\r
-    }\r
-    \r
-    /**\r
-    Set all items of the compontent checked\r
-    \r
-    **/\r
-    public void setAllItemsChecked() {\r
-        initCheckedItem(true, this.getAllItemsString());\r
-    }\r
-    \r
-    /**\r
-    Set all items of the compontent unchecked\r
-    \r
-    **/\r
-    public void setAllItemsUnchecked() {\r
-        initCheckedItem(false, this.getAllItemsString());\r
-    }\r
-\r
-    /**\r
-     Remove all items of list\r
-     \r
-     **/\r
-    public void removeAllItem() {\r
-        model.removeAllElements();\r
-    }\r
-}\r