KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > cheatsheets > data > RepeatedSubItem


1 /*******************************************************************************
2  * Copyright (c) 2002, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.cheatsheets.data;
12
13 import java.util.ArrayList JavaDoc;
14
15 public class RepeatedSubItem extends AbstractSubItem implements ISubItemItem {
16     private String JavaDoc values;
17     private ArrayList JavaDoc subItems;
18
19     /**
20      * Constructor for RepeatedSubItem.
21      */

22     public RepeatedSubItem() {
23         super();
24     }
25     
26     public RepeatedSubItem(String JavaDoc values) {
27         super();
28         this.values = values;
29     }
30     
31     /**
32      * Returns the values.
33      * @return String
34      */

35     public String JavaDoc getValues() {
36         return values;
37     }
38
39     /**
40      * Sets the values.
41      * @param newValues The new values to set
42      */

43     public void setValues(String JavaDoc newValues) {
44         this.values = newValues;
45     }
46
47     /**
48      * @param subItem the SubItem to add.
49      */

50     public void addSubItem(AbstractSubItem subItem) {
51         if(subItems == null) {
52             subItems = new ArrayList JavaDoc();
53         }
54         subItems.add(subItem);
55     }
56
57     /**
58      * Returns a list which will always only contain at most 1 entry.
59      * @return Returns the subItems.
60      */

61     public ArrayList JavaDoc getSubItems() {
62         return subItems;
63     }
64 }
65
Popular Tags