1
|
/*******************************************************************************
|
2
|
* Copyright (c) 2000, 2010 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.gef;
|
12
|
|
13
|
import java.beans.PropertyChangeListener;
|
14
|
import java.util.Collection;
|
15
|
import java.util.List;
|
16
|
import java.util.Map;
|
17
|
|
18
|
import org.eclipse.swt.graphics.Cursor;
|
19
|
import org.eclipse.swt.widgets.Composite;
|
20
|
import org.eclipse.swt.widgets.Control;
|
21
|
|
22
|
import org.eclipse.jface.action.MenuManager;
|
23
|
import org.eclipse.jface.resource.JFaceResources;
|
24
|
import org.eclipse.jface.resource.ResourceManager;
|
25
|
import org.eclipse.jface.util.TransferDragSourceListener;
|
26
|
import org.eclipse.jface.util.TransferDropTargetListener;
|
27
|
import org.eclipse.jface.viewers.ISelection;
|
28
|
|
29
|
import org.eclipse.draw2d.geometry.Point;
|
30
|
|
31
|
/**
|
32
|
* An adapter on an SWT {@link org.eclipse.swt.widgets.Control} that manages the
|
33
|
* {@link org.eclipse.gef.EditPart EditParts}. The viewer is responsible for the
|
34
|
* editpart lifecycle. Editparts have <i>visuals</i>, such as
|
35
|
* <code>TreeItems</code> or <code>Figures</code>, which are hosted by the
|
36
|
* viewer and its control. The viewer provides targeting of editparts via their
|
37
|
* visuals.
|
38
|
*
|
39
|
* <P>
|
40
|
* A viewer is a {@link org.eclipse.jface.viewers.ISelectionProvider}. It
|
41
|
* maintains a list of selected editparts. The last member of this list is the
|
42
|
* <i>primary</i> member of the selection. The list should never be empty; when
|
43
|
* no editparts are selected, the viewer's contents editpart is used.
|
44
|
*
|
45
|
* <P>
|
46
|
* A viewer is populated by setting its <i>contents</i>. This can be done by
|
47
|
* passing the model corresponding to the contents. The viewer's
|
48
|
* {@link org.eclipse.gef.EditPartFactory EditPartFactory} is then used to
|
49
|
* create the contents editpart, and add it to the <i>root</i> editpart.
|
50
|
* Alternatively, the contents editpart itself can be provided. Once the
|
51
|
* contents editpart is parented, it will populate the rest of the viewer by
|
52
|
* calling its {@link EditPart#refresh()} method.
|
53
|
*
|
54
|
* <P>
|
55
|
* The Root editpart does not correspond to anything in the model, it is used to
|
56
|
* bootstrap the viewer, and to parent the contents. Depending on the type of
|
57
|
* viewer being used, it may be common to replace the root editpart. See
|
58
|
* implementations of {@link org.eclipse.gef.RootEditPart}.
|
59
|
*
|
60
|
* <P>
|
61
|
* An editpart's lifecycle is managed by the viewer. When the Viewer is
|
62
|
* realized, meaning it has an SWT <code>Control</code>, it activates its root,
|
63
|
* which in turn activates all editparts. Editparts are deactivated when they
|
64
|
* are removed from the viewer. When the viewer's control is disposed, all
|
65
|
* editparts are similarly deactivated by decativating the root.
|
66
|
*
|
67
|
* <P>
|
68
|
* A Viewer has an arbitrary collection of keyed properties that can be set and
|
69
|
* queried. A value of <code>null</code> is used to remove a key from the
|
70
|
* property map. A viewer will fire property change notification whenever these
|
71
|
* values are updated.
|
72
|
*
|
73
|
* <P>
|
74
|
* WARNING: This interface is not intended to be implemented. Clients should
|
75
|
* extend {@link org.eclipse.gef.ui.parts.AbstractEditPartViewer}.
|
76
|
*/
|
77
|
public interface EditPartViewer extends
|
78
|
org.eclipse.jface.viewers.ISelectionProvider {
|
79
|
|
80
|
/**
|
81
|
* An object which evaluates an EditPart for an arbitrary property.
|
82
|
* Conditionals are used when querying a viewer for an editpart.
|
83
|
*
|
84
|
* @author hudsonr
|
85
|
*/
|
86
|
interface Conditional {
|
87
|
/**
|
88
|
* Returns <code>true</code> if the editpart meets this condition.
|
89
|
*
|
90
|
* @param editpart
|
91
|
* the editpart being evaluated
|
92
|
* @return <code>true</code> if the editpart meets the condition
|
93
|
*/
|
94
|
boolean evaluate(EditPart editpart);
|
95
|
}
|
96
|
|
97
|
/**
|
98
|
* Provided for compatibility with existing code.
|
99
|
*
|
100
|
* @param listener
|
101
|
* a drag source listener
|
102
|
* @see #addDragSourceListener(TransferDragSourceListener)
|
103
|
*/
|
104
|
void addDragSourceListener(
|
105
|
org.eclipse.gef.dnd.TransferDragSourceListener listener);
|
106
|
|
107
|
/**
|
108
|
* Adds a <code>TransferDragSourceListener</code> to this viewer. This has
|
109
|
* the side-effect of creating a {@link org.eclipse.swt.dnd.DragSource} on
|
110
|
* the viewer's Control. A Control can only have a single DragSource.
|
111
|
* Clients must not create their own DragSource when using this method.
|
112
|
*
|
113
|
* @param listener
|
114
|
* the listener
|
115
|
*/
|
116
|
void addDragSourceListener(TransferDragSourceListener listener);
|
117
|
|
118
|
/**
|
119
|
* Provided for compatibility with existing code.
|
120
|
*
|
121
|
* @param listener
|
122
|
* the listener
|
123
|
* @see #addDropTargetListener(TransferDropTargetListener)
|
124
|
*/
|
125
|
void addDropTargetListener(
|
126
|
org.eclipse.gef.dnd.TransferDropTargetListener listener);
|
127
|
|
128
|
/**
|
129
|
* Adds a <code>TransferDropTargetListener</code> to this viewer. This has
|
130
|
* the side-effect of creating a {@link org.eclipse.swt.dnd.DropTarget} on
|
131
|
* the viewer's Control. A Control can only have a single DropTarget.
|
132
|
* Clients must not create their own DropTarget when using this method.
|
133
|
*
|
134
|
* @param listener
|
135
|
* the listener
|
136
|
*/
|
137
|
void addDropTargetListener(TransferDropTargetListener listener);
|
138
|
|
139
|
/**
|
140
|
* Adds a listener to be notified of viewer property changes.
|
141
|
*
|
142
|
* @param listener
|
143
|
* the listener
|
144
|
*/
|
145
|
void addPropertyChangeListener(PropertyChangeListener listener);
|
146
|
|
147
|
/**
|
148
|
* Appends the specified <code>EditPart</code> to the viewer's
|
149
|
* <i>selection</i>. The EditPart becomes the new primary selection. Fires
|
150
|
* selection changed to all
|
151
|
* {@link org.eclipse.jface.viewers.ISelectionChangedListener}s.
|
152
|
*
|
153
|
* @param editpart
|
154
|
* the EditPart to append
|
155
|
*/
|
156
|
void appendSelection(EditPart editpart);
|
157
|
|
158
|
/**
|
159
|
* Optionally creates the default {@link org.eclipse.swt.widgets.Control
|
160
|
* Control} using the default style. The Control can also be created
|
161
|
* externally and then set into the Viewer.
|
162
|
*
|
163
|
* @param composite
|
164
|
* the parent in which create the SWT <code>Control</code>
|
165
|
* @see #setControl(Control)
|
166
|
* @return the created Control for convenience
|
167
|
*/
|
168
|
Control createControl(Composite composite);
|
169
|
|
170
|
/**
|
171
|
* Removes the specified <code>EditPart</code> from the current selection.
|
172
|
* If the selection becomes empty, the viewer's {@link #getContents()
|
173
|
* contents} becomes the current selected part. The last EditPart in the new
|
174
|
* selection is made {@link EditPart#SELECTED_PRIMARY primary}.
|
175
|
* <P>
|
176
|
* Fires selection changed to
|
177
|
* {@link org.eclipse.jface.viewers.ISelectionChangedListener}s.
|
178
|
*
|
179
|
* @param editpart
|
180
|
* the <code>EditPart</code> to deselect
|
181
|
*/
|
182
|
void deselect(EditPart editpart);
|
183
|
|
184
|
/**
|
185
|
* Deselects all EditParts. The viewer's {@link #getContents() contents}
|
186
|
* becomes the current selection. Fires selection changed to
|
187
|
* {@link org.eclipse.jface.viewers.ISelectionChangedListener}s.
|
188
|
*/
|
189
|
void deselectAll();
|
190
|
|
191
|
/**
|
192
|
* Returns <code>null</code> or the <code>EditPart</code> associated with
|
193
|
* the specified location. The location is relative to the client area of
|
194
|
* the Viewer's <code>Control</code>. An EditPart is not directly visible.
|
195
|
* It is targeted using its <i>visual part</i> which it registered using the
|
196
|
* {@link #getVisualPartMap() visual part map}. What constitutes a <i>visual
|
197
|
* part</i> is viewer-specific. Examples include Figures and TreeItems.
|
198
|
*
|
199
|
* @param location
|
200
|
* The location
|
201
|
* @return <code>null</code> or an EditPart
|
202
|
*/
|
203
|
EditPart findObjectAt(Point location);
|
204
|
|
205
|
/**
|
206
|
* Returns <code>null</code> or the <code>EditPart</code> at the specified
|
207
|
* location, excluding the specified set. This method behaves similarly to
|
208
|
* {@link #findObjectAt(Point)}.
|
209
|
*
|
210
|
* @param location
|
211
|
* The mouse location
|
212
|
* @param exclusionSet
|
213
|
* The set of EditParts to be excluded
|
214
|
* @return <code>null</code> or an EditPart
|
215
|
*/
|
216
|
EditPart findObjectAtExcluding(Point location, Collection exclusionSet);
|
217
|
|
218
|
/**
|
219
|
* Returns <code>null</code> or the <code>EditPart</code> at the specified
|
220
|
* location, using the given exclusion set and conditional. This method
|
221
|
* behaves similarly to {@link #findObjectAt(Point)}.
|
222
|
*
|
223
|
* @param location
|
224
|
* The mouse location
|
225
|
* @param exclusionSet
|
226
|
* The set of EditParts to be excluded
|
227
|
* @param conditional
|
228
|
* the Conditional used to evaluate a potential hit
|
229
|
* @return <code>null</code> or an EditPart
|
230
|
*/
|
231
|
EditPart findObjectAtExcluding(Point location, Collection exclusionSet,
|
232
|
Conditional conditional);
|
233
|
|
234
|
/**
|
235
|
* Flushes all pending updates to the Viewer.
|
236
|
*/
|
237
|
void flush();
|
238
|
|
239
|
/**
|
240
|
* Returns the <i>contents</i> of this Viewer. The contents is the EditPart
|
241
|
* associated with the top-level model object. It is considered to be
|
242
|
* "The Diagram". If the user has nothing selected, the <i>contents</i> is
|
243
|
* implicitly the selected object.
|
244
|
* <P>
|
245
|
* The <i>Root</i> of the Viewer is different. By constrast, the root is
|
246
|
* never selected or targeted, and does not correspond to something in the
|
247
|
* model.
|
248
|
*
|
249
|
* @see #getRootEditPart()
|
250
|
* @return the <i>contents</i> <code>EditPart</code>
|
251
|
*/
|
252
|
EditPart getContents();
|
253
|
|
254
|
/**
|
255
|
* Returns <code>null</code> or the MenuManager for this viewer. The menu
|
256
|
* manager is set using {@link #setContextMenu(MenuManager)}.
|
257
|
*
|
258
|
* @return <code>null</code> or a MenuManager
|
259
|
*/
|
260
|
MenuManager getContextMenu();
|
261
|
|
262
|
/**
|
263
|
* Returns <code>null</code> or the SWT <code>Control</code> for this
|
264
|
* viewer. The control is either set explicitly or can be created by the
|
265
|
* viewer.
|
266
|
*
|
267
|
* @see #setControl(Control)
|
268
|
* @see #createControl(Composite)
|
269
|
* @return the SWT <code>Control</code>
|
270
|
*/
|
271
|
Control getControl();
|
272
|
|
273
|
/**
|
274
|
* Returns the {@link EditDomain EditDomain} to which this viewer belongs.
|
275
|
*
|
276
|
* @return the viewer's EditDomain
|
277
|
*/
|
278
|
EditDomain getEditDomain();
|
279
|
|
280
|
/**
|
281
|
* Returns the <code>EditPartFactory</code> for this viewer. The
|
282
|
* EditPartFactory is used to create the <i>contents</i> EditPart when
|
283
|
* {@link #setContents(Object)} is called. It is made available so that
|
284
|
* other EditParts can use it to create their children or connection
|
285
|
* editparts.
|
286
|
*
|
287
|
* @return EditPartFactory
|
288
|
*/
|
289
|
EditPartFactory getEditPartFactory();
|
290
|
|
291
|
/**
|
292
|
* Returns the {@link Map} for registering <code>EditParts</code> by
|
293
|
* <i>Keys</i>. EditParts may register themselves using any method, and may
|
294
|
* register themselves with multiple keys. The purpose of such registration
|
295
|
* is to allow an EditPart to be found by other EditParts, or by listeners
|
296
|
* of domain notifiers. By default, EditParts are registered by their model.
|
297
|
* <P>
|
298
|
* Some models use a "domain" notification system, in which all changes are
|
299
|
* dispatched to a single listener. Such a listener might use this map to
|
300
|
* lookup editparts for a given model, and then ask the editpart to update.
|
301
|
*
|
302
|
* @return the registry map
|
303
|
*/
|
304
|
Map getEditPartRegistry();
|
305
|
|
306
|
/**
|
307
|
* Returns the <i>focus</i> <code>EditPart</code>. Focus refers to keyboard
|
308
|
* focus. This is the same concept as focus in a native Tree or Table. The
|
309
|
* User can change focus using the keyboard without affecting the currently
|
310
|
* selected objects. Never returns <code>null</code>.
|
311
|
*
|
312
|
* @return the <i>focus</i> <code>EditPart</code>
|
313
|
*/
|
314
|
EditPart getFocusEditPart();
|
315
|
|
316
|
/**
|
317
|
* Returns the <code>KeyHandler</code> for this viewer. The KeyHandler is
|
318
|
* sent KeyEvents by the currently active <code>Tool</code>. This is
|
319
|
* important, because only the current tool knows if it is in a state in
|
320
|
* which keys should be ignored, such as during a drag. By default, only the
|
321
|
* {@link org.eclipse.gef.tools.SelectionTool} forwards keysrokes. It does
|
322
|
* not do so during a drag.
|
323
|
*
|
324
|
* @return <code>null</code> or a KeyHandler
|
325
|
*/
|
326
|
KeyHandler getKeyHandler();
|
327
|
|
328
|
/**
|
329
|
* Returns the value of the given property. Returns <code>null</code> if the
|
330
|
* property has not been set, or has been set to null.
|
331
|
*
|
332
|
* @param key
|
333
|
* the property's key
|
334
|
* @return the given properties value or <code>null</code>.
|
335
|
*/
|
336
|
Object getProperty(String key);
|
337
|
|
338
|
/**
|
339
|
* Returns <code>null</code>, or the ResourceManager for this Viewer. Once a
|
340
|
* viewer has a Control, clients may access the viewer's resource manager.
|
341
|
* Any resources constructed using this manager, but not freed, will be
|
342
|
* freed when the viewer's control is disposed. This does not mean that
|
343
|
* clients should be lazy about deallocating resources. If a resource is no
|
344
|
* longer needed but the viewer is still in use, the client must deallocate
|
345
|
* the resource.
|
346
|
* <P>
|
347
|
* Typical usage is by EditParts contained inside the viewer. EditParts
|
348
|
* which are removed from the viewer should free their resources during
|
349
|
* {@link EditPart#removeNotify()}. When the viewer is disposed,
|
350
|
* <code>removeNotify()</code> is not called, but the viewer's resource
|
351
|
* manager will be disposed anyway.
|
352
|
* <P>
|
353
|
* The viewer's default resource manager is linked to JFace's
|
354
|
* {@link JFaceResources#getResources() global shared resources}.
|
355
|
*
|
356
|
* @return the ResourceManager associated with this viewer
|
357
|
* @since 3.3
|
358
|
*/
|
359
|
ResourceManager getResourceManager();
|
360
|
|
361
|
/**
|
362
|
* Returns the <code>RootEditPart</code>. The RootEditPart is a special
|
363
|
* EditPart that serves as the parent to the contents editpart. The
|
364
|
* <i>root</i> is never selected. The root does not correspond to anything
|
365
|
* in the model. The User does not interact with the root.
|
366
|
* <P>
|
367
|
* The RootEditPart has a single child: the {@link #getContents() contents}.
|
368
|
* <P>
|
369
|
* By defining the concept of "root", GEF allows the application's "real"
|
370
|
* EditParts to be more homogeneous. For example, all non-root EditParts
|
371
|
* have a parent. Also, it allows applications to change the type of root
|
372
|
* being used without affecting their own editpart implementation hierarchy.
|
373
|
*
|
374
|
* @see #getContents()
|
375
|
* @see #setRootEditPart(RootEditPart)
|
376
|
* @return the RootEditPart
|
377
|
*/
|
378
|
RootEditPart getRootEditPart();
|
379
|
|
380
|
/**
|
381
|
* Returns an unmodifiable <code>List</code> containing zero or more
|
382
|
* selected editparts. This list may be empty. In contrast, the inherited
|
383
|
* method
|
384
|
* {@link org.eclipse.jface.viewers.ISelectionProvider#getSelection()}
|
385
|
* should not return an empty selection. When no editparts are selected,
|
386
|
* generally the contents editpart is considered to be selected. This list
|
387
|
* can be modified indirectly by calling other methods on the viewer.
|
388
|
*
|
389
|
* @return a list containing zero or more editparts
|
390
|
*/
|
391
|
List getSelectedEditParts();
|
392
|
|
393
|
/**
|
394
|
* This method is inherited from
|
395
|
* {@link org.eclipse.jface.viewers.ISelectionProvider ISelectionProvider}.
|
396
|
* This method should return a
|
397
|
* {@link org.eclipse.jface.viewers.StructuredSelection} containing one or
|
398
|
* more of the viewer's EditParts. If no editparts are selected, the
|
399
|
* {@link #getContents() contents} editpart is returned.
|
400
|
*
|
401
|
* @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
|
402
|
*/
|
403
|
ISelection getSelection();
|
404
|
|
405
|
/**
|
406
|
* Returns the viewer's selection manager. The selection manager has
|
407
|
* complete control over the viewer's representation of selection. It
|
408
|
* provides the {@link ISelection} for the viewer, and manages all changes
|
409
|
* to the current selection.
|
410
|
*
|
411
|
* @return the selection manager
|
412
|
* @since 3.2
|
413
|
*/
|
414
|
SelectionManager getSelectionManager();
|
415
|
|
416
|
/**
|
417
|
* Returns the {@link Map} for associating <i>visual parts</i> with their
|
418
|
* <code>EditParts</code>. This map is used for hit-testing. Hit testing is
|
419
|
* performed by first determining which visual part is hit, and then mapping
|
420
|
* that part to an <code>EditPart</code>. What consistutes a <i>visual
|
421
|
* part</i> is viewer-specific. Examples include <code>Figures</code> and
|
422
|
* <code>TreeItems</code>.
|
423
|
*
|
424
|
* @return the visual part map
|
425
|
*/
|
426
|
Map getVisualPartMap();
|
427
|
|
428
|
/**
|
429
|
* Used for accessibility purposes.
|
430
|
*
|
431
|
* @param acc
|
432
|
* the AccessibleEditPart
|
433
|
*/
|
434
|
void registerAccessibleEditPart(AccessibleEditPart acc);
|
435
|
|
436
|
/**
|
437
|
* Removes the specified drag source listener. If all listeners are removed,
|
438
|
* the DragSource that was created will be disposed.
|
439
|
*
|
440
|
* @see #addDragSourceListener(TransferDragSourceListener)
|
441
|
* @param listener
|
442
|
* the listener
|
443
|
* @deprecated
|
444
|
*/
|
445
|
void removeDragSourceListener(
|
446
|
org.eclipse.gef.dnd.TransferDragSourceListener listener);
|
447
|
|
448
|
/**
|
449
|
* Removes the specified drag source listener. If all listeners are removed,
|
450
|
* the DragSource that was created will be disposed.
|
451
|
*
|
452
|
* @see #addDragSourceListener(TransferDragSourceListener)
|
453
|
* @param listener
|
454
|
* the listener
|
455
|
*/
|
456
|
void removeDragSourceListener(TransferDragSourceListener listener);
|
457
|
|
458
|
/**
|
459
|
* Removes the specified drop target listener. If all listeners are removed,
|
460
|
* the DropTarget that was created will be disposed.
|
461
|
*
|
462
|
* @see #addDropTargetListener(TransferDropTargetListener)
|
463
|
* @param listener
|
464
|
* @deprecated
|
465
|
*/
|
466
|
void removeDropTargetListener(
|
467
|
org.eclipse.gef.dnd.TransferDropTargetListener listener);
|
468
|
|
469
|
/**
|
470
|
* Removes the specified drop target listener. If all listeners are removed,
|
471
|
* the DropTarget that was created will be disposed.
|
472
|
*
|
473
|
* @see #addDropTargetListener(TransferDropTargetListener)
|
474
|
* @param listener
|
475
|
* the listener
|
476
|
*/
|
477
|
void removeDropTargetListener(TransferDropTargetListener listener);
|
478
|
|
479
|
/**
|
480
|
* removes the first instance of the specified property listener.
|
481
|
*
|
482
|
* @param listener
|
483
|
* the listener to remove
|
484
|
*/
|
485
|
void removePropertyChangeListener(PropertyChangeListener listener);
|
486
|
|
487
|
/**
|
488
|
* Reveals the given EditPart if it is not visible.
|
489
|
*
|
490
|
* @param editpart
|
491
|
* the EditPart to reveal
|
492
|
*/
|
493
|
void reveal(EditPart editpart);
|
494
|
|
495
|
/**
|
496
|
* Replaces the current selection with the specified <code>EditPart</code>.
|
497
|
* That part becomes the primary selection. Fires selection changed to
|
498
|
* {@link org.eclipse.jface.viewers.ISelectionChangedListener}s.
|
499
|
*
|
500
|
* @param editpart
|
501
|
* the new selection
|
502
|
*/
|
503
|
void select(EditPart editpart);
|
504
|
|
505
|
/**
|
506
|
* Sets the contents for this Viewer. The contents can also be set using
|
507
|
* {@link #setContents(Object)}.
|
508
|
*
|
509
|
* @param editpart
|
510
|
* the contents
|
511
|
* @see #getRootEditPart()
|
512
|
*/
|
513
|
void setContents(EditPart editpart);
|
514
|
|
515
|
/**
|
516
|
* Creates an <code>EditPart</code> for the provided model object using the
|
517
|
* <code>EditPartFactory</code>. That EditPart is then added to the
|
518
|
* {@link #getRootEditPart() RootEditPart}, and becomes the viewer's
|
519
|
* contents editpart.
|
520
|
*
|
521
|
* @param contents
|
522
|
* the contents model object
|
523
|
*/
|
524
|
void setContents(Object contents);
|
525
|
|
526
|
/**
|
527
|
* Sets the context <code>MenuManager</code> for this viewer. The
|
528
|
* MenuManager will be asked to create a Menu, which will be used as the
|
529
|
* context menu for this viewer's Control.
|
530
|
*
|
531
|
* @param contextMenu
|
532
|
* the <code>ContextMenuProvider</code>
|
533
|
*/
|
534
|
void setContextMenu(MenuManager contextMenu);
|
535
|
|
536
|
/**
|
537
|
* Sets the <code>Control</code> for this viewer. The viewer's control is
|
538
|
* also set automatically if {@link #createControl(Composite)} is called.
|
539
|
*
|
540
|
* @param control
|
541
|
* the Control
|
542
|
*/
|
543
|
void setControl(Control control);
|
544
|
|
545
|
/**
|
546
|
* Sets the cursor for the viewer's <code>Control</code>. This method should
|
547
|
* only be called by {@link Tool Tools}. <code>null</code> can be used to
|
548
|
* indicate that the default cursor should be restored.
|
549
|
*
|
550
|
* @param cursor
|
551
|
* <code>null</code> or a Cursor
|
552
|
* @see #getControl()
|
553
|
*/
|
554
|
void setCursor(Cursor cursor);
|
555
|
|
556
|
/**
|
557
|
* Sets the <code>EditDomain</code> for this viewer. The Viewer will route
|
558
|
* all mouse and keyboard events to the EditDomain.
|
559
|
*
|
560
|
* @param domain
|
561
|
* The EditDomain
|
562
|
*/
|
563
|
void setEditDomain(EditDomain domain);
|
564
|
|
565
|
/**
|
566
|
* Sets the EditPartFactory.
|
567
|
*
|
568
|
* @param factory
|
569
|
* the factory
|
570
|
* @see #getEditPartFactory()
|
571
|
*/
|
572
|
void setEditPartFactory(EditPartFactory factory);
|
573
|
|
574
|
/**
|
575
|
* Sets the <i>focus</i> EditPart.
|
576
|
*
|
577
|
* @see #getFocusEditPart()
|
578
|
* @param focus
|
579
|
* the FocusPart.
|
580
|
*/
|
581
|
void setFocus(EditPart focus);
|
582
|
|
583
|
/**
|
584
|
* Sets the <code>KeyHandler</code>.
|
585
|
*
|
586
|
* @param keyHandler
|
587
|
* the KeyHandler
|
588
|
* @see #getKeyHandler()
|
589
|
*/
|
590
|
void setKeyHandler(KeyHandler keyHandler);
|
591
|
|
592
|
/**
|
593
|
* Sets a property on this viewer. A viewer property is an arbitrary
|
594
|
* key-value pair that can be observed via
|
595
|
* {@link #addPropertyChangeListener(PropertyChangeListener)}. A
|
596
|
* <code>null</code> value will remove the property from the viewer.
|
597
|
*
|
598
|
* @param propertyName
|
599
|
* a unique string identifying the property
|
600
|
* @param value
|
601
|
* the properties new value or <code>null</code> to remove
|
602
|
* @since 3.0
|
603
|
*/
|
604
|
void setProperty(String propertyName, Object value);
|
605
|
|
606
|
/**
|
607
|
* Sets the <i>root</i> of this viewer. The root should not be confused with
|
608
|
* the <i>contents</i>.
|
609
|
*
|
610
|
* @param root
|
611
|
* the RootEditPart
|
612
|
* @see #getRootEditPart()
|
613
|
* @see #getContents()
|
614
|
*/
|
615
|
void setRootEditPart(RootEditPart root);
|
616
|
|
617
|
/**
|
618
|
* Turns on/off the routing of events directly to the Editor. If supported
|
619
|
* by the viewer implementation, all Events should be routed to the
|
620
|
* <code>EditDomain</code> rather than handled in the default way.
|
621
|
*
|
622
|
* @param value
|
623
|
* true if the viewer should route events to the EditDomain
|
624
|
*/
|
625
|
void setRouteEventsToEditDomain(boolean value);
|
626
|
|
627
|
/**
|
628
|
* Sets the selection manager for this viewer.
|
629
|
*
|
630
|
* @param manager
|
631
|
* the new selection manager
|
632
|
* @since 3.2
|
633
|
*/
|
634
|
void setSelectionManager(SelectionManager manager);
|
635
|
|
636
|
/**
|
637
|
* Used for accessibility purposes.
|
638
|
*
|
639
|
* @param acc
|
640
|
* the accessible part
|
641
|
*/
|
642
|
void unregisterAccessibleEditPart(AccessibleEditPart acc);
|
643
|
|
644
|
}
|