public class ViewerState extends java.lang.Object implements IViewerStateListener, IViewerLabelListener
A Viewer state represents a stateful data model for an IncQuery Viewer. The state is capable of either returning
lists of its content, and is also capable of sending state change notifications based to IViewerStateListener
implementations.
A Viewer can be initialized directly with a set of patterns and model, or a IncQueryViewerDataModel
can be
used to prepare and share such data between instances.
A ViewerState needs to be cleaned up using the dispose()
method to unregister all listeners.
Modifier and Type | Class and Description |
---|---|
static class |
ViewerState.ViewerStateFeature |
Constructor and Description |
---|
ViewerState(ViewerDataModel model,
ViewerDataFilter filter,
java.util.Collection<ViewerState.ViewerStateFeature> features) |
Modifier and Type | Method and Description |
---|---|
void |
addLabelListener(IViewerLabelListener listener)
Adds a new label Listener to the Viewer State
|
void |
addStateListener(IViewerStateListener listener)
Adds a new state Listener to the Viewer State
|
void |
containmentAppeared(Containment containment) |
void |
containmentDisappeared(Containment containment) |
void |
dispose() |
void |
edgeAppeared(Edge edge) |
void |
edgeDisappeared(Edge edge) |
java.util.Collection<Item> |
getChildren(Item parent) |
java.util.Collection<Containment> |
getContainments() |
java.util.Collection<Edge> |
getEdges() |
IncQueryEngine |
getEngine() |
java.util.Collection<Item> |
getItems() |
java.util.Collection<Item> |
getItemsFor(java.lang.Object target)
Access the Set of Items mapped to an EObject.
|
ViewModelManager |
getManager() |
NotationModel |
getNotationModel() |
Item |
getParent(Item child) |
Traceability |
getTraceability() |
boolean |
isDisposed() |
void |
itemAppeared(Item item) |
void |
itemDisappeared(Item item) |
void |
labelUpdated(Edge edge,
java.lang.String newLabel) |
void |
labelUpdated(Item item,
java.lang.String newLabel) |
void |
removeLabelListener(IViewerLabelListener listener)
Removes a label Listener from the Viewer State
|
void |
removeStateListener(IViewerStateListener listener)
Removes a state Listener from the Viewer State
|
public ViewerState(ViewerDataModel model, ViewerDataFilter filter, java.util.Collection<ViewerState.ViewerStateFeature> features)
public final void itemAppeared(Item item)
itemAppeared
in interface IViewerStateListener
public final void itemDisappeared(Item item)
itemDisappeared
in interface IViewerStateListener
public final void containmentAppeared(Containment containment)
containmentAppeared
in interface IViewerStateListener
public final void containmentDisappeared(Containment containment)
containmentDisappeared
in interface IViewerStateListener
public final void edgeAppeared(Edge edge)
edgeAppeared
in interface IViewerStateListener
public final void edgeDisappeared(Edge edge)
edgeDisappeared
in interface IViewerStateListener
public final void labelUpdated(Item item, java.lang.String newLabel)
labelUpdated
in interface IViewerLabelListener
public final void labelUpdated(Edge edge, java.lang.String newLabel)
labelUpdated
in interface IViewerLabelListener
public void addStateListener(IViewerStateListener listener)
public void removeStateListener(IViewerStateListener listener)
public void addLabelListener(IViewerLabelListener listener)
public void removeLabelListener(IViewerLabelListener listener)
public java.util.Collection<Item> getItemsFor(java.lang.Object target)
public java.util.Collection<Item> getItems()
public java.util.Collection<Edge> getEdges()
public java.util.Collection<Containment> getContainments()
public ViewModelManager getManager()
public NotationModel getNotationModel()
public Traceability getTraceability()
public IncQueryEngine getEngine()
public void dispose()
public boolean isDisposed()