Project

General

Profile

Download (7.92 KB) Statistics
| Branch: | Tag: | Revision:
1
package eu.etaxonomy.taxeditor.singlesource.editor.name.container;
2

    
3
import javax.naming.OperationNotSupportedException;
4

    
5
import org.eclipse.swt.SWTException;
6
import org.eclipse.swt.events.FocusListener;
7
import org.eclipse.swt.events.ModifyListener;
8
import org.eclipse.swt.events.MouseListener;
9
import org.eclipse.swt.events.VerifyListener;
10
import org.eclipse.swt.graphics.Color;
11
import org.eclipse.swt.graphics.Font;
12
import org.eclipse.swt.graphics.Image;
13
import org.eclipse.swt.widgets.Control;
14
import org.eclipse.swt.widgets.Menu;
15
import org.eclipse.swt.widgets.Widget;
16
import org.eclipse.ui.IEditorSite;
17

    
18
import eu.etaxonomy.taxeditor.singlesource.org.eclipse.jface.text.IPosition;
19

    
20

    
21
public interface INameViewer {
22

    
23
	/** Constant <code>RULER_WIDTH=16</code> */
24
	public static final int RULER_WIDTH = 16;
25

    
26
	/**
27
	 * <p>setLayoutData</p>
28
	 *
29
	 * @param layoutData the new layout data for the receiver.
30
	 */
31
	public abstract void setLayoutData(Object layoutData);
32

    
33
	/**
34
	 * Sets the layout data associated with the receiver to the argument.
35
	 *
36
	 * @param color a {@link org.eclipse.swt.graphics.Color} object.
37
	 */
38
	public abstract void setBackground(Color color);
39

    
40
	/**
41
	 * <p>setForeground</p>
42
	 *
43
	 * @param color a {@link org.eclipse.swt.graphics.Color} object.
44
	 */
45
	public abstract void setForeground(Color color);
46

    
47
	/**
48
	 * <p>setFocus</p>
49
	 *
50
	 * @return true if the control got focus, and false if it was unable to. 
51
	 */
52
	public abstract boolean setFocus();
53

    
54
	/**
55
	 * Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.
56
	 *
57
	 * @param font the new font (or null) 
58
	 */
59
	public abstract void setFont(Font font);
60

    
61
	/**
62
	 * <p>setIcon</p>
63
	 *
64
	 * @param icon a {@link org.eclipse.swt.graphics.Image} object.
65
	 */
66
	public abstract void setIcon(Image icon);
67

    
68
	/**
69
	 * <p>getText</p>
70
	 *
71
	 * @return text a {@link java.lang.String} object.
72
	 */
73
	public abstract String getText();
74

    
75
	/**
76
	 * <p>setText</p>
77
	 *
78
	 * @param text a {@link java.lang.String} object.
79
	 */
80
	public abstract void setText(String text);
81

    
82
	/**
83
	 * <p>setMenu</p>
84
	 *
85
	 * @param menu a {@link org.eclipse.swt.widgets.Menu} object.
86
	 */
87
	public abstract void setMenu(Menu menu);
88

    
89
	/**
90
	 * Adds the listener to the collection of listeners who will be notified when the NameViewer gains or loses focus, by sending it one of the messages defined in the FocusListener interface.
91
	 *     
92
	 * @param listener the listener which should be notified
93
	 * 
94
	 */
95
	public abstract void addFocusListener(FocusListener listener);
96

    
97
	/**
98
	 * Removes the listener to the collection of listeners who will be notified when the NameViewer gains or loses focus, by sending it one of the messages defined in the FocusListener interface.
99
	 *     
100
	 * @param listener the listener which should be notified
101
	 * 
102
	 * @throws IllegalArgumentException
103
	 * @throws SWTException
104
	 */
105
	public abstract void removeFocusListener(FocusListener listener);
106

    
107
	/**
108
	 * Adds the listener to the collection of listeners who will be notified when mouse buttons are pressed and released.
109
	 *     
110
	 * @param listener the listener which should be notified
111
	 * 
112
	 */
113
	public abstract void addMouseListener(MouseListener listener);
114

    
115
	/**
116
	 * Removes the listener to the collection of listeners who will be notified when mouse buttons are pressed and released.
117
	 *     
118
	 * @param listener the listener which should be notified
119
	 * 
120
	 */
121
	public abstract void removeMouseListener(MouseListener listener);
122

    
123
	/**
124
	 * Adds the listener to the collection of listeners who will be notified when the text is modified.
125
	 *     
126
	 * @param listener the listener which should be notified
127
	 * 
128
	 */
129
	public abstract void addModifyListener(ModifyListener listener);
130

    
131
	/**
132
	 * Removes the listener to the collection of listeners who will be notified when the text is modified.
133
	 *     
134
	 * @param listener the listener which should be notified
135
	 * 
136
	 */
137
	public abstract void removeModifyListener(ModifyListener listener);
138

    
139
	/**
140
	 * Adds the listener to the collection of listeners who will be notified when the text is about to be modified.
141
	 *     
142
	 * @param listener the listener which should be notified
143
	 * 
144
	 */
145
	public abstract void addVerifyListener(VerifyListener listener);
146

    
147
	/**
148
	 * Removes the listener to the collection of listeners who will be notified when the text is about to be modified.
149
	 *     
150
	 * @param listener the listener which should be notified
151
	 * 
152
	 */
153
	public abstract void removeVerifyListener(VerifyListener listener);
154

    
155
	/**
156
	 * <p>getRulerControl</p>
157
	 *
158
	 * @return a {@link org.eclipse.swt.widgets.Control} object.
159
	 */
160
	public abstract Control getVerticalRulerControl() throws OperationNotSupportedException;
161

    
162
	/**
163
	 * <p>clearAnnotations</p>
164
	 */
165
	public abstract void clearAnnotations() throws OperationNotSupportedException;
166

    
167
	public abstract void addAnnotation(IEditorAnnotation annotation, IPosition position) throws OperationNotSupportedException;
168

    
169
	/**
170
	 * Sets the editable state.
171
	 * 
172
	 * @param editable the editable state
173
	 * @link org.eclipse.jface.text.ITextViewer
174
	 */
175
	public abstract void setEditable(boolean editable) throws OperationNotSupportedException;
176

    
177
	/**
178
	 * Enables the receiver if the argument is true, and disables it otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.
179
	 *
180
	 * @param enabled the new enabled state
181
	 * 
182
	 * @link org.eclipse.swt.widgets.Control 
183
	 */
184
	public abstract void setEnabled(boolean enabled) throws OperationNotSupportedException;
185
	
186
	/**
187
	 * Gets the control, which is supposed to be draggable
188
	 * @return draggable control
189
	 */
190
	public abstract Control getDraggableControl();
191

    
192
	/**
193
	 * Gets the StyledTextWidget, if implemented
194
	 * @return text widget
195
	 * 
196
	 * @throws OperationNotSupportedException if functionality is not available (in RAP)
197
	 */
198
	public abstract Widget getStyledText() throws OperationNotSupportedException;
199

    
200
	/**
201
	 * Gets the SourceViewer's document text, if implemented
202
	 * @return document
203
	 * 
204
	 * @throws OperationNotSupportedException if functionality is not available (in RAP)
205
	 */
206
	public abstract String getDocumentAsString() throws OperationNotSupportedException;
207

    
208
	/**
209
	 * Sets the SourceViewer's document text, if implemented
210
	 * @param text
211
	 * 
212
	 * @throws OperationNotSupportedException if functionality is not available (in RAP)
213
	 */
214
	public abstract void setDocumentAsString(String text) throws OperationNotSupportedException;
215

    
216
	/**
217
	 * Gets the SourceViewer's document, if implemented
218
	 * @return document
219
	 * 
220
	 * @throws OperationNotSupportedException if functionality is not available (in RAP)
221
	 */
222
	public abstract int getDocumentLength() throws OperationNotSupportedException;
223

    
224

    
225
	/**
226
	 * <p>setCursorToEOL</p>
227
	 * @throws OperationNotSupportedException if functionality is not available (in RAP)
228
	 */
229
	public abstract void setCursorToEOL() throws OperationNotSupportedException;
230

    
231
	/**
232
	 * <p>getCursorPosition</p>
233
	 *
234
	 * @return a int.
235
	 * @throws OperationNotSupportedException if functionality is not available (in RAP)
236
	 */
237
	public abstract int getCursorPosition() throws OperationNotSupportedException;
238

    
239
	/**
240
	 * <p>setCursorPosition</p>
241
	 *
242
	 * @param offset a int.
243
	 * @throws OperationNotSupportedException if functionality is not available (in RAP)
244
	 */
245
	public abstract void setCursorPosition(int offset) throws OperationNotSupportedException;
246

    
247
	/**
248
	 * <p>createUndoSupport</p>
249
	 *
250
	 * @param editorSite a {@link org.eclipse.ui.IEditorSite} object.
251
	 * @throws OperationNotSupportedException if functionality is not available (in RAP)
252
	 */
253
	public abstract void createUndoSupport(IEditorSite editorSite) throws OperationNotSupportedException;
254

    
255
	/**
256
	 * <p>createUndoSupport_</p>
257
	 *
258
	 * @param editorSite a {@link org.eclipse.ui.IEditorSite} object.
259
	 * @throws OperationNotSupportedException if functionality is not available (in RAP)
260
	 */
261
	public abstract void createUndoSupport_(IEditorSite editorSite) throws OperationNotSupportedException;
262

    
263
}
(4-4/7)