public class ZestContentViewer extends ContentViewer
WIDGET_DATA_KEY
Constructor and Description |
---|
ZestContentViewer()
Constructs a new
ZestContentViewer . |
ZestContentViewer(com.google.inject.Module module)
Constructs a new
ZestContentViewer . |
Modifier and Type | Method and Description |
---|---|
protected javafx.embed.swt.FXCanvas |
createCanvas(Composite parent)
Creates an
FXCanvas inside of the given parent
Composite . |
void |
createControl(Composite parent,
int style)
Creates the control for this
ZestContentViewer inside of the
given parent Composite . |
protected Edge |
createEdge(ILabelProvider labelProvider,
java.lang.Object contentSourceNode,
Node sourceNode,
java.lang.Object contentTargetNode,
Node targetNode)
Constructs and returns a new
Edge connecting the given
sourceNode and targetNode. |
protected Graph |
createEmptyGraph()
Constructs and returns a new
Graph and inserts default attributes
into it:
layout algorithm
|
protected com.google.inject.Module |
createModule()
Creates the
Module that is used by default for the construction
of an Injector that will be used for the injection of members
into this ZestContentViewer . |
protected Graph |
createNestedGraph(java.lang.Object contentNestingNode,
INestedGraphContentProvider nestedGraphContentProvider,
ILabelProvider labelProvider)
Creates a
Graph nested in the node represented by the given
contentNestingNode. |
protected Node |
createNode(java.lang.Object contentNode,
IGraphNodeContentProvider graphContentProvider,
ILabelProvider labelProvider)
|
protected void |
createNodesAndEdges(IGraphNodeContentProvider graphContentProvider,
ILabelProvider labelProvider,
Graph graph,
java.lang.Object[] contentNodes)
|
protected Graph |
createRootGraph(IContentProvider contentProvider,
ILabelProvider labelProvider)
|
java.util.Map<java.lang.Object,Node> |
getContentNodeMap()
Returns an unmodifiable view of the content-node-map.
|
javafx.embed.swt.FXCanvas |
getControl() |
FXViewer |
getFXViewer()
Returns the
FXViewer that displays the contents. |
ILabelProvider |
getLabelProvider() |
ILayoutAlgorithm |
getLayoutAlgorithm()
Returns the
ILayoutAlgorithm that is used for laying out the
contents. |
ISelection |
getSelection() |
protected void |
handleDispose(DisposeEvent event) |
protected void |
inputChanged(java.lang.Object input,
java.lang.Object oldInput) |
void |
refresh() |
void |
setLayoutAlgorithm(ILayoutAlgorithm layoutAlgorithm)
Changes the
ILayoutAlgorithm that is used for laying out the
contents to the given value. |
void |
setSelection(ISelection selection,
boolean reveal) |
protected java.lang.String |
toCssRgb(Color color)
Converts the given
Color into a CSS string:
"rgb(red,green,blue)" . |
getContentProvider, getInput, handleLabelProviderChanged, hookControl, labelProviderChanged, setContentProvider, setInput, setLabelProvider
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
public ZestContentViewer()
ZestContentViewer
. The createModule()
method is evaluated to retrieve the Module
that is later used to
create the Injector
that is later used for the injection of
members and the construction of the FXDomain
.public ZestContentViewer(com.google.inject.Module module)
ZestContentViewer
. The given Module
is
saved so that it can be later used to create an Injector
that is
later used for the injection of members and the construction of the
FXDomain
.module
- The Module
from which an Injector
is created
later.protected javafx.embed.swt.FXCanvas createCanvas(Composite parent)
FXCanvas
inside of the given parent
Composite
. The FXCanvas
serves as the container for the
JavaFX Scene
which renders the contents.parent
- The parent Composite
.FXCanvas
inside of the given parent.public void createControl(Composite parent, int style)
ZestContentViewer
inside of the
given parent Composite
.parent
- The parent Composite
.style
- The SWT style for this ZestContentViewer
, currently
not used.protected Edge createEdge(ILabelProvider labelProvider, java.lang.Object contentSourceNode, Node sourceNode, java.lang.Object contentTargetNode, Node targetNode)
Edge
connecting the given
sourceNode and targetNode. If the labelProvider
implements IGraphNodeLabelProvider
, then attributes for the edge
are determined using the
IGraphNodeLabelProvider.getEdgeAttributes(Object, Object)
methods
and inserted into the edge.labelProvider
- This viewer's ILabelProvider
for convenience.contentSourceNode
- The content element representing the source node of this edge.sourceNode
- The already created source Node
of this edge.contentTargetNode
- The content element representing the target node of this edge.targetNode
- The already created target Node
of this edge.Edge
.protected Graph createEmptyGraph()
Graph
and inserts default attributes
into it:
Graph
with default attributes.protected com.google.inject.Module createModule()
Module
that is used by default for the construction
of an Injector
that will be used for the injection of members
into this ZestContentViewer
.Module
that is used by default for the construction
of an Injector
that will be used for the injection of
members into this ZestContentViewer
.protected Graph createNestedGraph(java.lang.Object contentNestingNode, INestedGraphContentProvider nestedGraphContentProvider, ILabelProvider labelProvider)
Graph
nested in the node represented by the given
contentNestingNode.contentNestingNode
- The content Object
that represents the nesting node.nestedGraphContentProvider
- This viewer's INestedGraphContentProvider
for
convenience.labelProvider
- This viewer's ILabelProvider
for convenience.Graph
.protected Node createNode(java.lang.Object contentNode, IGraphNodeContentProvider graphContentProvider, ILabelProvider labelProvider)
Node
for the specified contentNode using the
IContentProvider
and ILabelProvider
. Moreover, the new
node is put into the given contentToGraphMap.contentNode
- The content Object
that represents the node.graphContentProvider
- This viewer's IGraphNodeContentProvider
for
convenience.labelProvider
- This viewer's ILabelProvider
for convenience.Node
.protected void createNodesAndEdges(IGraphNodeContentProvider graphContentProvider, ILabelProvider labelProvider, Graph graph, java.lang.Object[] contentNodes)
graphContentProvider
- This viewer's IGraphNodeContentProvider
for
convenience.labelProvider
- This viewer's ILabelProvider
for convenience.graph
- The Graph
for which nodes and edges are created.contentNodes
- Content elements which represent nodes that are to be created
together with the edges between them.protected Graph createRootGraph(IContentProvider contentProvider, ILabelProvider labelProvider)
contentProvider
- The IContentProvider
for this viewer.labelProvider
- The ILabelProvider
for this viewer.Graph
constructed by using the given
providers.public java.util.Map<java.lang.Object,Node> getContentNodeMap()
public javafx.embed.swt.FXCanvas getControl()
getControl
in class Viewer
public FXViewer getFXViewer()
FXViewer
that displays the contents.FXViewer
that displays the contents.public ILabelProvider getLabelProvider()
getLabelProvider
in class ContentViewer
public ILayoutAlgorithm getLayoutAlgorithm()
ILayoutAlgorithm
that is used for laying out the
contents.ILayoutAlgorithm
that is used for laying out the
contents.public ISelection getSelection()
getSelection
in interface ISelectionProvider
getSelection
in class Viewer
protected void handleDispose(DisposeEvent event)
handleDispose
in class ContentViewer
protected void inputChanged(java.lang.Object input, java.lang.Object oldInput)
inputChanged
in class Viewer
public void setLayoutAlgorithm(ILayoutAlgorithm layoutAlgorithm)
ILayoutAlgorithm
that is used for laying out the
contents to the given value.layoutAlgorithm
- The new ILayoutAlgorithm
to use.public void setSelection(ISelection selection, boolean reveal)
setSelection
in class Viewer
Copyright (c) 2014 itemis AG and others. All rights reserved.