|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.node.NodeFactory<T>
T
- the concrete type of the NodeModel
public abstract class NodeFactory<T extends NodeModel>
Interface for NodeFactory
s summarizing NodeModel
,
NodeView
, and NodeDialogPane
for a specific Node
implementation.
Nested Class Summary | |
---|---|
static class |
NodeFactory.NodeType
Enum for all node types. |
Constructor Summary | |
---|---|
protected |
NodeFactory()
Creates a new NodeFactory and tries to read to properties
file named Node.xml in the same package as the factory. |
Method Summary | |
---|---|
static void |
addLoadedFactory(Class<? extends NodeFactory> factoryClass)
Adds the given factory class to the list of loaded factory classes. |
(package private) T |
callCreateNodeModel()
Access method for createNodeModel() . |
AbstractNodeView<T> |
createAbstractNodeView(int viewIndex,
T nodeModel)
Generalization of createNodeView(int, NodeModel) to allow for
creation of a more flexible AbstractNodeView . |
protected abstract NodeDialogPane |
createNodeDialogPane()
Creates and returns a new node dialog pane, if hasDialog()
returns true . |
abstract T |
createNodeModel()
Creates and returns a new instance of the node's corresponding model. |
abstract NodeView<T> |
createNodeView(int viewIndex,
T nodeModel)
Creates and returns a new node view for the given index. |
static URL |
getDefaultIcon()
Returns the default icon for nodes that do not define their own. |
URL |
getIcon()
Returns the icon for the node. |
String |
getInportDescription(int index)
Returns a description for an input port. |
String |
getInportName(int index)
Returns a name for an input port. |
static List<String> |
getLoadedNodeFactories()
Returns a collection of all loaded node factories. |
String |
getNodeName()
Returns the name of this node. |
protected String |
getNodeViewName(int index)
Returns the node name as view name, the index is not considered. |
protected abstract int |
getNrNodeViews()
Returns the number of possible views or 0 if no view is available. |
String |
getOutportDescription(int index)
Returns a description for an output port. |
String |
getOutportName(int index)
Returns a name for an output port. |
NodeFactory.NodeType |
getType()
Returns the type of the node. |
protected String |
getViewDescription(int index)
Returns a description for a view. |
Element |
getXMLDescription()
The XML description can be used with the NodeFactoryHTMLCreator in order to get a converted HTML
description of it, which fits the overall KNIME HTML style. |
protected abstract boolean |
hasDialog()
Returns true if this node provides a dialog to adjust
node specific settings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected NodeFactory()
NodeFactory
and tries to read to properties
file named Node.xml
in the same package as the factory.
Method Detail |
---|
public Element getXMLDescription()
NodeFactoryHTMLCreator
in order to get a converted HTML
description of it, which fits the overall KNIME HTML style.
public final String getNodeName()
public String getInportName(int index)
index
- the index of the input port, starting at 0
public String getOutportName(int index)
index
- the index of the output port, starting at 0
public final String getInportDescription(int index)
index
- the index of the input port, starting at 0
public final String getOutportDescription(int index)
index
- the index of the output port, starting at 0
protected final String getViewDescription(int index)
index
- the index of the view, starting at 0
public abstract T createNodeModel()
null
!final T callCreateNodeModel()
createNodeModel()
. This method will
also do sanity checks for the correct labeling of the port description:
The port count (in, out) is only available in the
NodeModel. The first time, this method is called, the port count is
retrieved from the NodeModel and the xml description is validated against
the info from the model. If inconsistencies are identified, log messages
will be written and the full description of the node is adapted such that
the user (preferably the implementor) immediately sees the problem.
protected abstract int getNrNodeViews()
createNodeView(int,NodeModel)
protected final String getNodeViewName(int index)
index
- The view index,
public abstract NodeView<T> createNodeView(int viewIndex, T nodeModel)
viewIndex
- The index for the view to create.nodeModel
- the underlying model
IndexOutOfBoundsException
- If the viewIndex
is
smaller 0 or greater or equal to the values returned by
getNrNodeViews()
getNrNodeViews()
public AbstractNodeView<T> createAbstractNodeView(int viewIndex, T nodeModel)
createNodeView(int, NodeModel)
to allow for
creation of a more flexible AbstractNodeView
. Implementations
will typically overwrite the createNodeView(int, NodeModel)
method unless they wish to return, e.g. an
ExternalApplicationNodeView
.
Note:This method is going to be removed in KNIME
v3.0, whereby the return type of the
createNodeView(int, NodeModel)
will be changed
to AbstractNodeView
. (This change is postponed to v3.0 in order
to ensure binary compatibility of 2.0.x plugins with the 2.x series).
viewIndex
- The index for the view to createnodeModel
- the underlying model
IndexOutOfBoundsException
- If the viewIndex
is
smaller 0 or greater or equal to the values returned by
getNrNodeViews()
protected abstract boolean hasDialog()
true
if this node provides a dialog to adjust
node specific settings.
true
if a NodeDialogPane
is
availablecreateNodeDialogPane()
protected abstract NodeDialogPane createNodeDialogPane()
hasDialog()
returns true
.
hasDialog()
public final URL getIcon()
public NodeFactory.NodeType getType()
public static URL getDefaultIcon()
public static List<String> getLoadedNodeFactories()
public static void addLoadedFactory(Class<? extends NodeFactory> factoryClass)
factoryClass
- a factory class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |