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.core.plugin;
11:
12: import org.eclipse.core.runtime.CoreException;
13:
14: /**
15: * Classes that implement this interface are
16: * capable of containing other plug-in objects.
17: */
18: public interface IPluginParent extends IPluginObject {
19: /**
20: * A property that will be used when firing notification
21: * of the sibling swap.
22: */
23: String P_SIBLING_ORDER = "sibling_order"; //$NON-NLS-1$
24:
25: /**
26: * Adds a child object at the specified index.
27: * This method may throw a CoreException if
28: * the model is not editable.
29: *
30: * @param index the location of the child
31: * @param child the object to add
32: */
33: void add(int index, IPluginObject child) throws CoreException;
34:
35: /**
36: * Adds a child object.
37: * This method may throw a CoreException if
38: * the model is not editable.
39: *
40: * @param child the object to add
41: */
42: void add(IPluginObject child) throws CoreException;
43:
44: /**
45: * Returns the number of children
46: * currently owned by this parent. Returns 0 if this is a lightweight model.
47: *
48: * @return the number of children
49: */
50: int getChildCount();
51:
52: /**
53: * Returns the position of the child in this parent.
54: * @param child a child of this parent
55: * @return a 0-based index of the child
56: */
57: int getIndexOf(IPluginObject child);
58:
59: /**
60: * Swaps the position of of the provided siblings
61: * in the parent.
62: * @param child1 the first child
63: * @param child2 the second child
64: * @throws CoreException thrown if the model is not editable.
65: */
66: void swap(IPluginObject child1, IPluginObject child2)
67: throws CoreException;
68:
69: /**
70: * Returns the children owned by this parent. Returns an empty array
71: * if this is a lightweight model.
72: *
73: * @return an array of children
74: */
75: IPluginObject[] getChildren();
76:
77: /**
78: * Removes a child object.
79: * This method may throw a CoreException if
80: * the model is not editable.
81: *
82: * @param child the object to remove
83: */
84: void remove(IPluginObject child) throws CoreException;
85: }
|