01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.elements;
11:
12: import java.util.Vector;
13:
14: import org.eclipse.swt.graphics.Image;
15:
16: public class ElementList extends NamedElement {
17: private Vector children = new Vector();
18:
19: public ElementList(String name) {
20: super (name);
21: }
22:
23: public ElementList(String name, Image icon) {
24: super (name, icon);
25: }
26:
27: public ElementList(String name, Image icon, IPDEElement parent) {
28: super (name, icon, parent);
29: }
30:
31: public void add(IPDEElement child) {
32: children.addElement(child);
33: }
34:
35: public Object[] getChildren() {
36: if (children.size() == 0)
37: return new Object[0];
38: Object[] result = new Object[children.size()];
39: children.copyInto(result);
40: return result;
41: }
42:
43: public void remove(IPDEElement child) {
44: children.remove(child);
45: }
46:
47: public int size() {
48: return children.size();
49: }
50:
51: public String toString() {
52: return children.toString();
53: }
54: }
|