KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > views > properties > IPropertySheetEntry


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.ui.views.properties;
12
13 import org.eclipse.jface.viewers.CellEditor;
14 import org.eclipse.swt.graphics.Image;
15 import org.eclipse.swt.widgets.Composite;
16
17 /**
18  * <code>IPropertySheetEntry</code> describes the model interface for the
19  * property sheet.
20  * <p>
21  * May be implemented when supplying a custom root entry to a property page.
22  * </p>
23  */

24 public interface IPropertySheetEntry {
25
26     /**
27      * The filter id for expert properties
28      */

29     public String JavaDoc FILTER_ID_EXPERT = "org.eclipse.ui.views.properties.expert"; //$NON-NLS-1$
30

31     /**
32      * Adds the given listener to this entry's collection of listeners.
33      *
34      * @param listener
35      * the listener to add
36      */

37     public void addPropertySheetEntryListener(
38             IPropertySheetEntryListener listener);
39
40     /**
41      * Apply the current cell editor value.
42      */

43     public void applyEditorValue();
44
45     /**
46      * Called when the entry is no longer needed
47      */

48     public void dispose();
49
50     /**
51      * Returns the entry's category.
52      *
53      * @return the entry's category
54      */

55     public String JavaDoc getCategory();
56
57     /**
58      * Returns the child entries for this entry.
59      *
60      * @return the child entries for this entry
61      */

62     public IPropertySheetEntry[] getChildEntries();
63
64     /**
65      * Return a short description of the property sheet entry. Typically this
66      * description is shown in a status line when the entry is selected.
67      *
68      * @return the entry's description
69      */

70     public String JavaDoc getDescription();
71
72     /**
73      * Returns the name used to display the property.
74      *
75      * @return the name used to display the property
76      */

77     public String JavaDoc getDisplayName();
78
79     /**
80      * Return the <code>CellEditor</code> used to edit the property.
81      *
82      * @param parent
83      * the parent widget for the editor
84      * @return the <code>CellEditor</code> used to edit the property
85      */

86     CellEditor getEditor(Composite parent);
87
88     /**
89      * Returns the error text to display if the value is invalid.
90      *
91      * @return the error text to display when the value is invalid or
92      * <code>null</code>
93      */

94     public String JavaDoc getErrorText();
95
96     /**
97      * Return the filter ids used to group entries into levels such as Expert.
98      * Valid values are defined as constants on this interface.
99      *
100      * @return the filter ids used to group entries into levels such as Expert.
101      */

102     public String JavaDoc[] getFilters();
103
104     /**
105      * Returns the help context id for this entry, or <code>null</code> if
106      * this entry has no help context id.
107      * <p>
108      * NOTE: Help support system API's changed since 2.0 and arrays of contexts
109      * are no longer supported.
110      * </p>
111      * <p>
112      * Thus the only valid non- <code>null</code> return type for this method
113      * is a <code>String</code> representing a context id. The previously
114      * valid return types are deprecated. The plural name for this method is
115      * unfortunate.
116      * </p>
117      *
118      * @return the help context id for this entry
119      */

120     public Object JavaDoc getHelpContextIds();
121
122     /**
123      * Returns the image for the property value, if there is one. This image is
124      * managed by the entry it came from. Callers of this method must never
125      * dispose the returned image.
126      *
127      * @return the image for this property value or <code>null</code>
128      */

129     public Image getImage();
130
131     /**
132      * Returns the value of the objects expressed as a String.
133      *
134      * @return the value of the objects expressed as a String
135      */

136     public String JavaDoc getValueAsString();
137
138     /**
139      * Returns <code>true</code> if the entry has children.
140      *
141      * @return <code>true</code> if the entry has children
142      */

143     public boolean hasChildEntries();
144
145     /**
146      * Removes the given listener from this entry's collection of listeners.
147      *
148      * @param listener
149      * the listener to remove
150      */

151     public void removePropertySheetEntryListener(
152             IPropertySheetEntryListener listener);
153
154     /**
155      * Resets the property value to its default value if it has been changed.
156      * <p>
157      * Does nothing if the notion of a default value is not meaningful for
158      * the property.
159      * </p>
160      */

161     void resetPropertyValue();
162
163     /**
164      * Sets the objects which represent the property values for this entry. In
165      * the case of the root entry these objects are the input to the viewer.
166      *
167      * @param values the values for this entry
168      */

169     public void setValues(Object JavaDoc[] values);
170 }
171
Popular Tags