Lines 13-147
Link Here
|
13 |
import org.eclipse.jface.viewers.CellEditor; |
13 |
import org.eclipse.jface.viewers.CellEditor; |
14 |
import org.eclipse.swt.graphics.Image; |
14 |
import org.eclipse.swt.graphics.Image; |
15 |
import org.eclipse.swt.widgets.Composite; |
15 |
import org.eclipse.swt.widgets.Composite; |
|
|
16 |
|
16 |
/** |
17 |
/** |
17 |
* <code>IPropertySheetEntry</code> describes the model interface for the |
18 |
* <code>IPropertySheetEntry</code> describes the model interface for the |
18 |
* property sheet. |
19 |
* property sheet. |
19 |
* <p> |
20 |
* <p> |
20 |
* May be implemented when supplying a custom root entry |
21 |
* May be implemented when supplying a custom root entry to a property page. |
21 |
* to a property page. |
|
|
22 |
* </p> |
22 |
* </p> |
23 |
*/ |
23 |
*/ |
24 |
public interface IPropertySheetEntry { |
24 |
public interface IPropertySheetEntry { |
25 |
/** |
25 |
|
26 |
* The filter id for expert properties |
26 |
/** |
27 |
*/ |
27 |
* The filter id for expert properties |
28 |
public String FILTER_ID_EXPERT = "org.eclipse.ui.views.properties.expert"; //$NON-NLS-1$ |
28 |
*/ |
29 |
/** |
29 |
public String FILTER_ID_EXPERT = "org.eclipse.ui.views.properties.expert"; //$NON-NLS-1$ |
30 |
* Adds the given listener to this entry's collection |
30 |
|
31 |
* of listeners. |
31 |
/** |
32 |
* |
32 |
* Adds the given listener to this entry's collection of listeners. |
33 |
* @param listener the listener to add |
33 |
* |
34 |
*/ |
34 |
* @param listener |
35 |
public void addPropertySheetEntryListener(IPropertySheetEntryListener listener); |
35 |
* the listener to add |
36 |
/** |
36 |
*/ |
37 |
* Apply the current cell editor value. |
37 |
public void addPropertySheetEntryListener( |
38 |
*/ |
38 |
IPropertySheetEntryListener listener); |
39 |
public void applyEditorValue(); |
39 |
|
40 |
/** |
40 |
/** |
41 |
* Called when the entry is no longer needed |
41 |
* Apply the current cell editor value. |
42 |
*/ |
42 |
*/ |
43 |
public void dispose(); |
43 |
public void applyEditorValue(); |
44 |
/** |
44 |
|
45 |
* Returns the entry's category. |
45 |
/** |
46 |
* |
46 |
* Called when the entry is no longer needed |
47 |
* @return the entry's category |
47 |
*/ |
48 |
*/ |
48 |
public void dispose(); |
49 |
public String getCategory(); |
49 |
|
50 |
/** |
50 |
/** |
51 |
* Returns the child entries for this entry. |
51 |
* Returns the entry's category. |
52 |
* |
52 |
* |
53 |
* @return the child entries for this entry |
53 |
* @return the entry's category |
54 |
*/ |
54 |
*/ |
55 |
public IPropertySheetEntry[] getChildEntries(); |
55 |
public String getCategory(); |
56 |
/** |
56 |
|
57 |
* Return a short description of the property sheet entry. |
57 |
/** |
58 |
* Typically this description is shown in a status line |
58 |
* Returns the child entries for this entry. |
59 |
* when the entry is selected. |
59 |
* |
60 |
* |
60 |
* @return the child entries for this entry |
61 |
* @return the entry's description |
61 |
*/ |
62 |
*/ |
62 |
public IPropertySheetEntry[] getChildEntries(); |
63 |
public String getDescription(); |
63 |
|
64 |
/** |
64 |
/** |
65 |
* Returns the name used to display the property. |
65 |
* Return a short description of the property sheet entry. Typically this |
66 |
* |
66 |
* description is shown in a status line when the entry is selected. |
67 |
* @return the name used to display the property |
67 |
* |
68 |
*/ |
68 |
* @return the entry's description |
69 |
public String getDisplayName(); |
69 |
*/ |
70 |
/** |
70 |
public String getDescription(); |
71 |
* Return the <code>CellEditor</code> used to edit the property. |
71 |
|
72 |
* |
72 |
/** |
73 |
* @param parent the parent widget for the editor |
73 |
* Returns the name used to display the property. |
74 |
* @return the <code>CellEditor</code> used to edit the property |
74 |
* |
75 |
*/ |
75 |
* @return the name used to display the property |
76 |
CellEditor getEditor(Composite parent); |
76 |
*/ |
77 |
/** |
77 |
public String getDisplayName(); |
78 |
* Returns the error text to display if the value is invalid. |
78 |
|
79 |
* |
79 |
/** |
80 |
* @return the error text to display when the value is invalid |
80 |
* Return the <code>CellEditor</code> used to edit the property. |
81 |
* or <code>null</code> |
81 |
* |
82 |
*/ |
82 |
* @param parent |
83 |
public String getErrorText(); |
83 |
* the parent widget for the editor |
84 |
/** |
84 |
* @return the <code>CellEditor</code> used to edit the property |
85 |
* Return the filter ids used to group entries into levels such as Expert. |
85 |
*/ |
86 |
* Valid values are defined as constants on this interface. |
86 |
CellEditor getEditor(Composite parent); |
87 |
* |
87 |
|
88 |
* @return the filter ids used to group entries into levels such as Expert. |
88 |
/** |
89 |
*/ |
89 |
* Returns the error text to display if the value is invalid. |
90 |
public String[] getFilters(); |
90 |
* |
91 |
/** |
91 |
* @return the error text to display when the value is invalid or |
92 |
* Returns the help context id for this entry, |
92 |
* <code>null</code> |
93 |
* or <code>null</code> if this entry has no help context id. |
93 |
*/ |
94 |
* <p> |
94 |
public String getErrorText(); |
95 |
* NOTE: Help support system API's changed since 2.0 and arrays |
95 |
|
96 |
* of contexts are no longer supported. |
96 |
/** |
97 |
* </p> |
97 |
* Return the filter ids used to group entries into levels such as Expert. |
98 |
* <p> |
98 |
* Valid values are defined as constants on this interface. |
99 |
* Thus the only valid non-<code>null</code> return type for this method |
99 |
* |
100 |
* is a <code>String</code> representing a context id. The previously |
100 |
* @return the filter ids used to group entries into levels such as Expert. |
101 |
* valid return types are deprecated. The plural name for this method |
101 |
*/ |
102 |
* is unfortunate. |
102 |
public String[] getFilters(); |
103 |
* </p> |
103 |
|
104 |
* |
104 |
/** |
105 |
* @return the help context id for this entry |
105 |
* Returns the help context id for this entry, or <code>null</code> if |
106 |
*/ |
106 |
* this entry has no help context id. |
107 |
public Object getHelpContextIds(); |
107 |
* <p> |
108 |
/** |
108 |
* NOTE: Help support system API's changed since 2.0 and arrays of contexts |
109 |
* Returns the image for the property value, if there is one. |
109 |
* are no longer supported. |
110 |
* This image is managed by the entry it came from. Callers |
110 |
* </p> |
111 |
* of this method must never dispose the returned image. |
111 |
* <p> |
112 |
* |
112 |
* Thus the only valid non- <code>null</code> return type for this method |
113 |
* @return the image for this property value or <code>null</code> |
113 |
* is a <code>String</code> representing a context id. The previously |
114 |
*/ |
114 |
* valid return types are deprecated. The plural name for this method is |
115 |
public Image getImage(); |
115 |
* unfortunate. |
116 |
/** |
116 |
* </p> |
117 |
* Returns the value of the objects expressed as a String. |
117 |
* |
118 |
* |
118 |
* @return the help context id for this entry |
119 |
* @return the value of the objects expressed as a String |
119 |
*/ |
120 |
*/ |
120 |
public Object getHelpContextIds(); |
121 |
public String getValueAsString(); |
121 |
|
122 |
/** |
122 |
/** |
123 |
* Returns <code>true</code> if the entry has children. |
123 |
* Returns the image for the property value, if there is one. This image is |
124 |
* |
124 |
* managed by the entry it came from. Callers of this method must never |
125 |
* @return <code>true</code> if the entry has children |
125 |
* dispose the returned image. |
126 |
*/ |
126 |
* |
127 |
public boolean hasChildEntries(); |
127 |
* @return the image for this property value or <code>null</code> |
128 |
/** |
128 |
*/ |
129 |
* Removes the given listener from this entry's collection |
129 |
public Image getImage(); |
130 |
* of listeners. |
130 |
|
131 |
* |
131 |
/** |
132 |
* @param listener the listener to remove |
132 |
* Returns the value of the objects expressed as a String. |
133 |
*/ |
133 |
* |
134 |
public void removePropertySheetEntryListener(IPropertySheetEntryListener listener); |
134 |
* @return the value of the objects expressed as a String |
135 |
/** |
135 |
*/ |
136 |
* Resets the property value to its default value if it has been changed. |
136 |
public String getValueAsString(); |
137 |
*/ |
137 |
|
138 |
void resetPropertyValue(); |
138 |
/** |
139 |
/* |
139 |
* Returns <code>true</code> if the entry has children. |
140 |
* Sets the objects which represent the property values for |
140 |
* |
141 |
* this entry. In the case of the root entry these objects |
141 |
* @return <code>true</code> if the entry has children |
142 |
* are the input to the viewer. |
142 |
*/ |
143 |
* |
143 |
public boolean hasChildEntries(); |
144 |
* @param values the values for this entry |
144 |
|
145 |
*/ |
145 |
/** |
146 |
public void setValues(Object[] values); |
146 |
* Removes the given listener from this entry's collection of listeners. |
147 |
} |
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[] values); |
170 |
} |