KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > core > plugin > IPluginParent


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.core.plugin;
12
13 import org.eclipse.core.runtime.CoreException;
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 JavaDoc P_SIBLING_ORDER = "sibling_order"; //$NON-NLS-1$
24
/**
25      * Adds a child object at the specified index.
26      * This method may throw a CoreException if
27      * the model is not editable.
28      *
29      * @param index the location of the child
30      * @param child the object to add
31      */

32     void add(int index, IPluginObject child) throws CoreException;
33     /**
34      * Adds a child object.
35      * This method may throw a CoreException if
36      * the model is not editable.
37      *
38      * @param child the object to add
39      */

40     void add(IPluginObject child) throws CoreException;
41     /**
42      * Returns the number of children
43      * currently owned by this parent. Returns 0 if this is a lightweight model.
44      *
45      * @return the number of children
46      */

47     int getChildCount();
48     
49     /**
50      * Returns the position of the child in this parent.
51      * @param child a child of this parent
52      * @return a 0-based index of the child
53      */

54     int getIndexOf(IPluginObject child);
55     /**
56      * Swaps the position of of the provided siblings
57      * in the parent.
58      * @param child1 the first child
59      * @param child2 the second child
60      * @throws CoreException thrown if the model is not editable.
61      */

62     void swap(IPluginObject child1, IPluginObject child2) throws CoreException;
63     /**
64      * Returns the children owned by this parent. Returns an empty array
65      * if this is a lightweight model.
66      *
67      * @return an array of children
68      */

69     IPluginObject[] getChildren();
70     /**
71      * Removes a child object.
72      * This method may throw a CoreException if
73      * the model is not editable.
74      *
75      * @param child the object to remove
76      */

77     void remove(IPluginObject child) throws CoreException;
78 }
79
Popular Tags