Saros
Distributed Collaborative Editing and Distributed Party Programming
|
Static Public Member Functions | |
static void | setInput (final Viewer viewer, final Object input) |
static void | add (final Viewer viewer, final Object parentElementOrTreePath, final Object childElement) |
static void | add (final Viewer viewer, final Object parentElementOrTreePath, final Object[] childElements) |
static void | remove (final Viewer viewer, final Object elementsOrTreePaths) |
static void | remove (final Viewer viewer, final Object[] elementsOrTreePaths) |
static void | update (final Viewer viewer, final Object element, final String[] properties) |
static void | update (final Viewer viewer, final Object[] elements, final String[] properties) |
static void | refresh (final Viewer viewer, final boolean updateLabels) |
static void | expandToLevel (final Viewer viewer, final int level) |
static void | expandAll (final Viewer viewer) |
Utility class for manipulation of Viewers.
Tries to call alternative methods if a special operation is not supported by the viewer. All calls are automatically done in the synchronous SWT thread.
Example 1:
If you try to update a specific element in a viewer and the viewer does not support updating single elements, the whole viewer will be refreshed.
Example 2:
One element of your model has been removed. For performance reasons you don't want to refresh the whole viewer but manually remove the element from the viewer in order to reflect the model. If your viewer supports this action the element is removed. Otherwise the viewer is advised to reload the model.
static void de.fu_berlin.inf.dpp.ui.util.ViewerUtils.add | ( | final Viewer | viewer, |
final Object | parentElementOrTreePath, | ||
final Object | childElement | ||
) | [static] |
Add the a new element to a given element in a viewer and makes sure it runs in the SWT thread. Runs a refresh in case the viewer does not support additions.
viewer | |
parentElementOrTreePath | |
childElement |
static void de.fu_berlin.inf.dpp.ui.util.ViewerUtils.add | ( | final Viewer | viewer, |
final Object | parentElementOrTreePath, | ||
final Object[] | childElements | ||
) | [static] |
Add the new elements to a given element in a viewer and makes sure it runs in the SWT thread. Runs a refresh in case the viewer does not support additions.
viewer | |
parentElementOrTreePath | |
childElements |
static void de.fu_berlin.inf.dpp.ui.util.ViewerUtils.expandAll | ( | final Viewer | viewer | ) | [static] |
If supported by the viewer expands all elements and makes sure it runs in the SWT thread.
viewer |
static void de.fu_berlin.inf.dpp.ui.util.ViewerUtils.expandToLevel | ( | final Viewer | viewer, |
final int | level | ||
) | [static] |
static void de.fu_berlin.inf.dpp.ui.util.ViewerUtils.refresh | ( | final Viewer | viewer, |
final boolean | updateLabels | ||
) | [static] |
Refreshes a viewer's display and makes sure it runs in the SWT thread.
viewer | |
updateLabels |
static void de.fu_berlin.inf.dpp.ui.util.ViewerUtils.remove | ( | final Viewer | viewer, |
final Object | elementsOrTreePaths | ||
) | [static] |
Removes an existing element from a viewer and makes sure it runs in the SWT thread. Runs a refresh in case the viewer does not support removals.
viewer | |
elementsOrTreePaths |
static void de.fu_berlin.inf.dpp.ui.util.ViewerUtils.remove | ( | final Viewer | viewer, |
final Object[] | elementsOrTreePaths | ||
) | [static] |
Removes existing elements from a viewer and makes sure it runs in the SWT thread. Runs a refresh in case the viewer does not support removals.
viewer | |
elementsOrTreePaths |
static void de.fu_berlin.inf.dpp.ui.util.ViewerUtils.setInput | ( | final Viewer | viewer, |
final Object | input | ||
) | [static] |
Sets a viewer's input and makes sure it runs in the SWT thread
viewer | |
input |
static void de.fu_berlin.inf.dpp.ui.util.ViewerUtils.update | ( | final Viewer | viewer, |
final Object[] | elements, | ||
final String[] | properties | ||
) | [static] |
Updates a viewer's elements and makes sure it runs in the SWT thread. Runs a refresh in case the viewer does not support updates.
viewer | |
elements | |
properties |
static void de.fu_berlin.inf.dpp.ui.util.ViewerUtils.update | ( | final Viewer | viewer, |
final Object | element, | ||
final String[] | properties | ||
) | [static] |
Updates a viewer's element and makes sure it runs in the SWT thread. Runs a refresh in case the viewer does not support updates.
viewer | |
element | |
properties |