KickJava   Java API By Example, From Geeks To Geeks.

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


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 import org.eclipse.core.runtime.IAdaptable;
15 import org.eclipse.pde.core.IWritable;
16 /**
17  * A base interface for all the objects in the plug-in model.
18  */

19 public interface IPluginObject extends IWritable, IAdaptable {
20     /**
21      * A property name that will be used to notify
22      * that the "name" field has changed.
23      */

24     String JavaDoc P_NAME = "name"; //$NON-NLS-1$
25
/**
26      * Returns the model that owns this object.
27      * @return the model instance
28      */

29     ISharedPluginModel getModel();
30     
31     /**
32      * Returns the model that owns this object.
33      * @return the model instance
34      */

35     IPluginModelBase getPluginModel();
36     /**
37      * Returns the name of this model object
38      *@return the object name
39      */

40     String JavaDoc getName();
41
42     /**
43      * Returns true if this object is currently part of a model.
44      * It is useful to ignore modification events of objects
45      * that have not yet being added to the model or if they
46      * have been removed.
47      */

48     boolean isInTheModel();
49     
50     /**
51      * Set the value indicating whether the object is currently part of a model.
52      * It is useful to ignore modification events of objects
53      * that have not yet being added to the model or if they
54      * have been removed.
55      */

56     void setInTheModel(boolean inModel);
57
58     /**
59      * Returns the translated name of this model object using
60      * the result of 'getName()' call as a resource key.
61      * @return the translated name or the original name if not found
62      */

63     String JavaDoc getTranslatedName();
64
65     /**
66      * Returns the parent of this model object.
67      *
68      * @return the object's parent
69      */

70     IPluginObject getParent();
71     /**
72      * Returns the top-level model object.
73      *
74      * @return the top-level model object
75      */

76     IPluginBase getPluginBase();
77     /**
78      * Returns a string by locating the provided
79      * key in the resource bundle associated with
80      * the model.
81      *
82      * @param key the name to use for resource bundle lookup
83      * @return value in the resource bundle for
84      * the provided key, or the key itself if
85      * not found.
86      */

87     String JavaDoc getResourceString(String JavaDoc key);
88     /**
89      * Chances the name of this model object.
90      * This method may throw a CoreException
91      * if the model is not editable.
92      *
93      * @param name the new object name
94      */

95     void setName(String JavaDoc name) throws CoreException;
96     /**
97      * Returns <samp>true</samp> if this object has all
98      * the required attributes set, <samp>false</samp> otherwise.
99      * @return <samp>true</samp> if all the required attributes are set.
100      */

101     boolean isValid();
102 }
103
Popular Tags