Interface IViewerUpdater<E>
- Type Parameters:
E
- type of the elements in the updated viewer
public interface IViewerUpdater<E>
A strategy interface for updating the elements in a
StructuredViewer
.
Many structured viewer classes have similar methods for adding and removing
elements, few of which are defined in common ancestor classes. This interface
serves as a universal adapter for updating the elements in a viewer-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the elements to the viewer.void
Insert the element into the viewer at the specified position.void
Moves the specified element from the specified old position to the specified new position.void
Removes the elements from the viewervoid
Remove the element from the viewervoid
Replace the specified element at the given position with the new element.
-
Method Details
-
insert
Insert the element into the viewer at the specified position.- Parameters:
element
- the element to addposition
- the position of the element
-
remove
Remove the element from the viewer- Parameters:
element
- the element to removeposition
- the position of the element
-
replace
Replace the specified element at the given position with the new element.- Parameters:
oldElement
- the element being replacednewElement
- the element that replacesoldElement
position
- the position of the element being replaced.
-
move
Moves the specified element from the specified old position to the specified new position. No action is taken if the viewer has a sorter or filter(s).- Parameters:
element
- the element being movedoldPosition
- the position of the element before it is movednewPosition
- the position of the element after it is moved
-
add
Adds the elements to the viewer.- Parameters:
elements
- the elements to add
-
remove
Removes the elements from the viewer- Parameters:
elements
- the elements to remove
-