KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > elements > ElementList


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.pde.internal.ui.elements;
12
13 import java.util.Vector JavaDoc;
14
15 import org.eclipse.swt.graphics.Image;
16
17
18 public class ElementList extends NamedElement {
19     private Vector JavaDoc children = new Vector JavaDoc();
20
21 public ElementList(String JavaDoc name) {
22     super(name);
23 }
24 public ElementList(String JavaDoc name, Image icon) {
25     super(name, icon);
26 }
27 public ElementList(String JavaDoc name, Image icon, IPDEElement parent) {
28     super(name, icon, parent);
29 }
30 public void add(IPDEElement child) {
31     children.addElement(child);
32 }
33 public Object JavaDoc[] getChildren() {
34     if (children.size()==0) return new Object JavaDoc[0];
35     Object JavaDoc[] result = new Object JavaDoc[children.size()];
36     children.copyInto(result);
37     return result;
38 }
39 public void remove(IPDEElement child) {
40     children.remove(child);
41 }
42 public int size() {
43     return children.size();
44 }
45 public String JavaDoc toString() {
46     return children.toString();
47 }
48 }
49
Popular Tags