KickJava   Java API By Example, From Geeks To Geeks.

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


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 model the
16  * XML elements found in the plug-in model.
17  */

18 public interface IPluginElement extends IPluginParent {
19     /**
20      * A property name that will be used to notify
21      * about element body text change.
22      */

23     String JavaDoc P_TEXT = "text"; //$NON-NLS-1$
24
/**
25      * A property name that will be used to notify
26      * about global replacement of the element's attributes.
27      */

28     String JavaDoc P_ATTRIBUTES = "attributes"; //$NON-NLS-1$
29

30     /**
31      * A property name that will be used to notify individual
32      * change in an element's attribute.
33      */

34     String JavaDoc P_ATTRIBUTE = "attribute"; //$NON-NLS-1$
35
/**
36      * Creates an identical copy of this XML element.
37      * The new element will share the same model and
38      * the parent.
39      *
40      * @return a copy of this element
41      */

42     IPluginElement createCopy();
43     /**
44      * Returns an attribute object whose name
45      * matches the provided name.
46      * @param name the name of the attribute
47      * @return the attribute object, or <samp>null</samp> if not found
48      */

49     IPluginAttribute getAttribute(String JavaDoc name);
50     /**
51      * Returns all attributes currently defined in this element
52      * @return an array of attribute objects that belong to this element
53      */

54     IPluginAttribute[] getAttributes();
55     /**
56      * Returns the number of attributes in this element.
57      * @return number of attributes defined in this element
58      */

59     int getAttributeCount();
60     /**
61      * Returns the body text of this element.
62      *
63      * @return body text of this element or <samp>null</samp> if not set.
64      */

65     String JavaDoc getText();
66     /**
67      * Returns the schema for this element.
68      * <p>This information is exposed here as implementation side-effect
69      * and should not be used by clients.
70      *
71      * @return the schema for this element or <samp>null</samp> if not found.
72      */

73     Object JavaDoc getElementInfo();
74     /**
75      * Sets the attribute with the provided name
76      * to the provided value. If attribute object
77      * is not found, a new one will be created and
78      * its value set to the provided value.
79      * This method will throw a CoreException if
80      * the model is not editable.
81      *
82      * @param name the name of the attribute
83      * @param value the value to be set
84      */

85     void setAttribute(String JavaDoc name, String JavaDoc value) throws CoreException;
86     /**
87      * Sets the body text of this element
88      * to the provided value. This method
89      * will throw a CoreException if the
90      * model is not editable.
91      *
92      * @param text the new body text of this element
93      */

94     void setText(String JavaDoc text) throws CoreException;
95 }
96
Popular Tags