Project

General

Profile

Download (7.84 KB) Statistics
| Branch: | Tag: | Revision:
1
package eu.etaxonomy.taxeditor.editor.singlesource.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.editor.name.container.EditorAnnotation;
19

    
20
public interface INameViewer {
21

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

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

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

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

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

    
53
	/**
54
	 * 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.
55
	 *
56
	 * @param font the new font (or null) 
57
	 */
58
	public abstract void setFont(Font font);
59

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

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

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

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

    
88
	/**
89
	 * 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.
90
	 *     
91
	 * @param listener the listener which should be notified
92
	 * 
93
	 */
94
	public abstract void addFocusListener(FocusListener listener);
95

    
96
	/**
97
	 * 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.
98
	 *     
99
	 * @param listener the listener which should be notified
100
	 * 
101
	 * @throws IllegalArgumentException
102
	 * @throws SWTException
103
	 */
104
	public abstract void removeFocusListener(FocusListener listener);
105

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

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

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

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

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

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

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

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

    
166
	public abstract void addAnnotation(EditorAnnotation annotation,	Object position) throws OperationNotSupportedException;
167

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

    
176
	/**
177
	 * 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.
178
	 *
179
	 * @param enabled the new enabled state
180
	 * 
181
	 * @link org.eclipse.swt.widgets.Control 
182
	 */
183
	public abstract void setEnabled(boolean enabled);
184
	
185
	/**
186
	 * Gets the control, which is supposed to be draggable
187
	 * @return draggable control
188
	 */
189
	public abstract Control getDraggableControl();
190

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

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

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

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

    
223

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

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

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

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

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

    
262
}
(2-2/4)