]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListModel.java
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@671 6f19259b...
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / common / ui / iCheckBoxList / ICheckBoxListModel.java
1 /** @file
2
3 The file is used to override DefaultListModel to create ICheckBoxListModel
4
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15 package org.tianocore.frameworkwizard.common.ui.iCheckBoxList;
16
17 import javax.swing.*;
18 import java.util.Vector;
19
20 public class ICheckBoxListModel extends DefaultListModel {
21 ///
22 /// Define class Serial Version UID
23 ///
24 private static final long serialVersionUID = -8617800969723991017L;
25
26 /**
27 This is the default Constructor for the CheckBoxListModel object
28
29 **/
30 public ICheckBoxListModel() {
31 }
32
33 /**
34 override DefaultListModel's add method
35
36 @param index
37 @param item
38
39 **/
40 public void add(int index, ICheckBoxListItem item) {
41 super.add(index, item);
42 }
43
44 /**
45 Add one item at tail
46
47 @param item
48
49 **/
50 public void addElement(ICheckBoxListItem item) {
51 super.addElement(item);
52 }
53
54 /**
55 Get all elements of the list
56
57 **/
58 public Vector<ICheckBoxListItem> getAllElements() {
59 Vector<ICheckBoxListItem> items = new Vector<ICheckBoxListItem>();
60 ICheckBoxListItem[] objs = new ICheckBoxListItem[this.size()];
61 this.copyInto(objs);
62 for (int i = 0; i < size(); i++) {
63 items.addElement(objs[i]);
64 }
65 return items;
66 }
67 }