Package org.knime.core.ui.wrapper
Class NodeContainerWrapper<W extends org.knime.core.node.workflow.NodeContainer>
java.lang.Object
org.knime.core.ui.wrapper.AbstractWrapper<W>
org.knime.core.ui.wrapper.NodeContainerWrapper<W>
- All Implemented Interfaces:
EventListener,org.knime.core.node.workflow.NodeContainerStateObservable,org.knime.core.node.workflow.NodeProgressListener,NodeContainerUI,UI,Wrapper<W>
- Direct Known Subclasses:
SingleNodeContainerWrapper,WorkflowManagerWrapper
public abstract class NodeContainerWrapper<W extends org.knime.core.node.workflow.NodeContainer>
extends AbstractWrapper<W>
implements NodeContainerUI
UI-interface implementation that wraps a
NodeContainer.- Author:
- Martin Horn, University of Konstanz
-
Field Summary
Fields inherited from interface org.knime.core.ui.wrapper.Wrapper
WRAPPER_MAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddNodeMessageListener(org.knime.core.node.workflow.NodeMessageListener listener) booleanaddNodePropertyChangedListener(org.knime.core.node.workflow.NodePropertyChangedListener l) booleanaddNodeStateChangeListener(org.knime.core.node.workflow.NodeStateChangeListener listener) booleanaddProgressListener(org.knime.core.node.workflow.NodeProgressListener listener) voidaddUIInformationListener(org.knime.core.node.workflow.NodeUIInformationListener l) org.knime.core.node.NodeSettingsTake settings from the node's dialog and apply them to the model.booleanbooleanbooleanCurrently called by nodes having data aware dialogs in order to test whether upstream nodes are correctly wired and can be executed.voidchangeNodeLocks(boolean setLock, org.knime.core.node.workflow.NodeContainer.NodeLock... locks) Changes the nodes lock status for various actions, i.e.voidclears the list of waiting loops.To be called from rpc clients - not needed for local, for remote, picks an endpoint and forwards ui data request to be transported to remote node model and collects the response in `out`.org.knime.core.node.workflow.NodeExecutionJobManagerFor reporting backward compatibility.org.knime.core.node.NodeDialogPaneReturn a NodeDialogPane for a node which can be embedded into a JFrame oder another GUI element.getIcon()org.knime.core.node.workflow.NodeIDgetID()getInPort(int index) Returns the name of the interactive view if such a view exists.Get the 'interactive web views' provided by this node.org.knime.core.node.workflow.NodeExecutionJobManagergetName()org.knime.core.node.workflow.NodeAnnotationorg.knime.core.node.workflow.NodeContainerStateorg.knime.core.node.workflow.NodeContainer.NodeLocksReturns the node's lock status, i.e.org.knime.core.node.workflow.NodeMessageGet the message to be displayed to the user.org.knime.core.node.config.base.ConfigBaseROgetNodeViewName(int i) intintReturns the number of views provided by the node implementation.intintgetOutPort(int index) org.knime.core.node.NodeFactory.NodeTypegetType()org.knime.core.node.workflow.NodeUIInformationReturns the UI information.getViewName(int i) booleanWhether the dialog is aDataAwareNodeDialogPane.booleanbooleanbooleanCalled for nodes having data aware dialogs in order to check whether to prompt for execution or not.booleanbooleanisDirty()voidprogressChanged(org.knime.core.node.workflow.NodeProgressEvent pe) booleanremoveNodeMessageListener(org.knime.core.node.workflow.NodeMessageListener listener) booleanremoveNodeProgressListener(org.knime.core.node.workflow.NodeProgressListener listener) booleanremoveNodePropertyChangedListener(org.knime.core.node.workflow.NodePropertyChangedListener l) booleanremoveNodeStateChangeListener(org.knime.core.node.workflow.NodeStateChangeListener listener) voidremoveUIInformationListener(org.knime.core.node.workflow.NodeUIInformationListener l) voidsetCustomDescription(String customDescription) voidsetDeletable(boolean value) voidsetDirty()Mark this node container to be changed, that is, it needs to be saved.voidsetNodeMessage(org.knime.core.node.workflow.NodeMessage newMessage) voidsetUIInformation(org.knime.core.node.workflow.NodeUIInformation uiInformation) Used, e.g., when nodes are moved.voidsetUIInformationForCorrection(org.knime.core.node.workflow.NodeUIInformation uiInfo) Updates the node's UI information only in order to correct it's bounding box and position.static final NodeContainerWrapperwrap(org.knime.core.node.workflow.NodeContainer nc) Wraps the object.Methods inherited from class org.knime.core.ui.wrapper.AbstractWrapper
equals, hashCode, toString, unwrapMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.knime.core.ui.node.workflow.NodeContainerUI
toString
-
Constructor Details
-
NodeContainerWrapper
- Parameters:
delegate- the implementation to delegate to
-
-
Method Details
-
wrap
Wraps the object. It also checks for sub-types of the node container and uses the more specific wrappers.- Parameters:
nc- the object to be wrapped- Returns:
- a new wrapper or a already existing one or
nullif nc is null
-
getDialogPaneWithSettings
public org.knime.core.node.NodeDialogPane getDialogPaneWithSettings() throws org.knime.core.node.NotConfigurableExceptionReturn a NodeDialogPane for a node which can be embedded into a JFrame oder another GUI element.- Specified by:
getDialogPaneWithSettingsin interfaceNodeContainerUI- Returns:
- A dialog pane for the corresponding node.
- Throws:
org.knime.core.node.NotConfigurableException- if node cannot be configured- Since:
- 3.6
-
progressChanged
public void progressChanged(org.knime.core.node.workflow.NodeProgressEvent pe) - Specified by:
progressChangedin interfaceorg.knime.core.node.workflow.NodeProgressListener
-
getParent
- Specified by:
getParentin interfaceNodeContainerUI- Returns:
- parent workflowmanager holding this node (or null if root).
-
getJobManager
public org.knime.core.node.workflow.NodeExecutionJobManager getJobManager()- Specified by:
getJobManagerin interfaceNodeContainerUI- Returns:
- The job manager associated with this node or null if this node will use the job manager of the parent (or the parent of ...)
- See Also:
-
findJobManager
public org.knime.core.node.workflow.NodeExecutionJobManager findJobManager()- Specified by:
findJobManagerin interfaceNodeContainerUI- Returns:
- NodeExecutionJobManager responsible for this node and all its children.
-
addNodePropertyChangedListener
public boolean addNodePropertyChangedListener(org.knime.core.node.workflow.NodePropertyChangedListener l) - Specified by:
addNodePropertyChangedListenerin interfaceNodeContainerUI
-
removeNodePropertyChangedListener
public boolean removeNodePropertyChangedListener(org.knime.core.node.workflow.NodePropertyChangedListener l) - Specified by:
removeNodePropertyChangedListenerin interfaceNodeContainerUI
-
clearWaitingLoopList
public void clearWaitingLoopList()Description copied from interface:NodeContainerUIclears the list of waiting loops.- Specified by:
clearWaitingLoopListin interfaceNodeContainerUI
-
addProgressListener
public boolean addProgressListener(org.knime.core.node.workflow.NodeProgressListener listener) - Specified by:
addProgressListenerin interfaceNodeContainerUI- Parameters:
listener- listener to the node progress- Returns:
- true if the listener was not already registered before, false otherwise
-
removeNodeProgressListener
public boolean removeNodeProgressListener(org.knime.core.node.workflow.NodeProgressListener listener) - Specified by:
removeNodeProgressListenerin interfaceNodeContainerUI- Parameters:
listener- existing listener to the node progress- Returns:
- true if the listener was successfully removed, false if it was not registered
-
addNodeMessageListener
public boolean addNodeMessageListener(org.knime.core.node.workflow.NodeMessageListener listener) - Specified by:
addNodeMessageListenerin interfaceNodeContainerUI- Parameters:
listener- listener to the node messages (warnings and errors)- Returns:
- true if the listener was not already registered, false otherwise
-
removeNodeMessageListener
public boolean removeNodeMessageListener(org.knime.core.node.workflow.NodeMessageListener listener) - Specified by:
removeNodeMessageListenerin interfaceNodeContainerUI- Parameters:
listener- listener to the node messages- Returns:
- true if the listener was successfully removed, false if it was not registered
-
getNodeMessage
public org.knime.core.node.workflow.NodeMessage getNodeMessage()Description copied from interface:NodeContainerUIGet the message to be displayed to the user.- Specified by:
getNodeMessagein interfaceNodeContainerUI- Returns:
- the node message consisting of type and message, never null.
-
setNodeMessage
public void setNodeMessage(org.knime.core.node.workflow.NodeMessage newMessage) - Specified by:
setNodeMessagein interfaceNodeContainerUI- Parameters:
newMessage- the nodeMessage to set
-
addUIInformationListener
public void addUIInformationListener(org.knime.core.node.workflow.NodeUIInformationListener l) - Specified by:
addUIInformationListenerin interfaceNodeContainerUI
-
removeUIInformationListener
public void removeUIInformationListener(org.knime.core.node.workflow.NodeUIInformationListener l) - Specified by:
removeUIInformationListenerin interfaceNodeContainerUI
-
getUIInformation
public org.knime.core.node.workflow.NodeUIInformation getUIInformation()Description copied from interface:NodeContainerUIReturns the UI information.- Specified by:
getUIInformationin interfaceNodeContainerUI- Returns:
- a the node information
-
setUIInformation
public void setUIInformation(org.knime.core.node.workflow.NodeUIInformation uiInformation) Description copied from interface:NodeContainerUIUsed, e.g., when nodes are moved.- Specified by:
setUIInformationin interfaceNodeContainerUI- Parameters:
uiInformation- new user interface information of the node such as coordinates on workbench.
-
setUIInformationForCorrection
public void setUIInformationForCorrection(org.knime.core.node.workflow.NodeUIInformation uiInfo) Updates the node's UI information only in order to correct it's bounding box and position. In that case there is no need, e.g., to send the info to the server.- Specified by:
setUIInformationForCorrectionin interfaceNodeContainerUI
-
addNodeStateChangeListener
public boolean addNodeStateChangeListener(org.knime.core.node.workflow.NodeStateChangeListener listener) Description copied from interface:NodeContainerUI- Specified by:
addNodeStateChangeListenerin interfaceorg.knime.core.node.workflow.NodeContainerStateObservable- Specified by:
addNodeStateChangeListenerin interfaceNodeContainerUI
-
removeNodeStateChangeListener
public boolean removeNodeStateChangeListener(org.knime.core.node.workflow.NodeStateChangeListener listener) Description copied from interface:NodeContainerUI- Specified by:
removeNodeStateChangeListenerin interfaceorg.knime.core.node.workflow.NodeContainerStateObservable- Specified by:
removeNodeStateChangeListenerin interfaceNodeContainerUI
-
getNodeContainerState
public org.knime.core.node.workflow.NodeContainerState getNodeContainerState()Description copied from interface:NodeContainerUI- Specified by:
getNodeContainerStatein interfaceorg.knime.core.node.workflow.NodeContainerStateObservable- Specified by:
getNodeContainerStatein interfaceNodeContainerUI
-
hasDataAwareDialogPane
public boolean hasDataAwareDialogPane()Description copied from interface:NodeContainerUIWhether the dialog is aDataAwareNodeDialogPane. If so, the predecessor nodes need to be executed before the dialog is opened.- Specified by:
hasDataAwareDialogPanein interfaceNodeContainerUI- Returns:
- that property
-
isAllInputDataAvailable
public boolean isAllInputDataAvailable()Description copied from interface:NodeContainerUICalled for nodes having data aware dialogs in order to check whether to prompt for execution or not.- Specified by:
isAllInputDataAvailablein interfaceNodeContainerUI- Returns:
- true if correctly connected and all inputs have data.
- See Also:
-
WorkflowManager.isAllInputDataAvailableToNode(NodeID)
-
canExecuteUpToHere
public boolean canExecuteUpToHere()Description copied from interface:NodeContainerUICurrently called by nodes having data aware dialogs in order to test whether upstream nodes are correctly wired and can be executed. It only tests if the direct predecessors are connected -- in the longer term it will check if all predecessors are correctly set up and at least one is executable.- Specified by:
canExecuteUpToHerein interfaceNodeContainerUI- Returns:
- true if all non-optional ports are connected.
-
applySettingsFromDialog
public org.knime.core.node.NodeSettings applySettingsFromDialog() throws org.knime.core.node.InvalidSettingsExceptionDescription copied from interface:NodeContainerUITake settings from the node's dialog and apply them to the model. Throws an exception if the apply fails.- Specified by:
applySettingsFromDialogin interfaceNodeContainerUI- Returns:
- the settings
- Throws:
org.knime.core.node.InvalidSettingsException- if settings are not applicable.
-
getNodeSettings
public org.knime.core.node.config.base.ConfigBaseRO getNodeSettings()- Specified by:
getNodeSettingsin interfaceNodeContainerUI- Returns:
- user settings for this node, possibly empty but not
null.
-
areDialogSettingsValid
public boolean areDialogSettingsValid()- Specified by:
areDialogSettingsValidin interfaceNodeContainerUI
-
hasDialog
public boolean hasDialog()- Specified by:
hasDialogin interfaceNodeContainerUI
-
areDialogAndNodeSettingsEqual
public boolean areDialogAndNodeSettingsEqual()- Specified by:
areDialogAndNodeSettingsEqualin interfaceNodeContainerUI
-
getNrInPorts
public int getNrInPorts()- Specified by:
getNrInPortsin interfaceNodeContainerUI
-
getInPort
- Specified by:
getInPortin interfaceNodeContainerUI
-
getOutPort
- Specified by:
getOutPortin interfaceNodeContainerUI
-
getNrOutPorts
public int getNrOutPorts()- Specified by:
getNrOutPortsin interfaceNodeContainerUI
-
getNrViews
public int getNrViews()- Specified by:
getNrViewsin interfaceNodeContainerUI
-
getNrNodeViews
public int getNrNodeViews()Description copied from interface:NodeContainerUIReturns the number of views provided by the node implementation.- Specified by:
getNrNodeViewsin interfaceNodeContainerUI- Returns:
- the number of views provided by the node implementation
-
getViewName
- Specified by:
getViewNamein interfaceNodeContainerUI
-
getNodeViewName
- Specified by:
getNodeViewNamein interfaceNodeContainerUI
-
hasInteractiveView
public boolean hasInteractiveView()- Specified by:
hasInteractiveViewin interfaceNodeContainerUI- Returns:
- true if node provides an interactive view.
-
getInteractiveWebViews
Description copied from interface:NodeContainerUIGet the 'interactive web views' provided by this node. That is, views providing aWebTemplatefor an interactive web view. Native nodes can have at most one view, components may have many (one for each contained view node), metanodes have none.The name associated with the web view (e.g. JS scatter plot) comes from a node's description (xml).
- Specified by:
getInteractiveWebViewsin interfaceNodeContainerUI- Returns:
- An new
InteractiveWebViewsResultUIwith possibly 0 or more views.
-
getInteractiveViewName
Description copied from interface:NodeContainerUIReturns the name of the interactive view if such a view exists. Otherwisenullis returned.- Specified by:
getInteractiveViewNamein interfaceNodeContainerUI- Returns:
- name of the interactive view or
null
-
getIcon
- Specified by:
getIconin interfaceNodeContainerUI
-
getIconAsStream
- Specified by:
getIconAsStreamin interfaceNodeContainerUI
-
getType
public org.knime.core.node.NodeFactory.NodeType getType()- Specified by:
getTypein interfaceNodeContainerUI
-
getID
public org.knime.core.node.workflow.NodeID getID()- Specified by:
getIDin interfaceNodeContainerUI
-
getName
- Specified by:
getNamein interfaceNodeContainerUI
-
getNameWithID
- Specified by:
getNameWithIDin interfaceNodeContainerUI
-
getDisplayLabel
- Specified by:
getDisplayLabelin interfaceNodeContainerUI- Returns:
- the display label for
NodeView,OutPortViewandNodeDialog
-
getCustomName
Description copied from interface:NodeContainerUIFor reporting backward compatibility. If no custom name is set the reporting creates new names (depending on the node id). (The preference page prefix is ignored then.)- Specified by:
getCustomNamein interfaceNodeContainerUI- Returns:
- the first line of the annotation (which contains in old (pre 2.5) flows the custom name) or null, if no annotation or no old custom name is set.
-
getNodeAnnotation
public org.knime.core.node.workflow.NodeAnnotation getNodeAnnotation()- Specified by:
getNodeAnnotationin interfaceNodeContainerUI- Returns:
- the annotation associated with the node, never null.
-
getCustomDescription
- Specified by:
getCustomDescriptionin interfaceNodeContainerUI
-
setCustomDescription
- Specified by:
setCustomDescriptionin interfaceNodeContainerUI
-
setDeletable
public void setDeletable(boolean value) - Specified by:
setDeletablein interfaceNodeContainerUI- Parameters:
value- the isDeletable to set
-
isDeletable
public boolean isDeletable()- Specified by:
isDeletablein interfaceNodeContainerUI- Returns:
- the isDeletable
-
isDirty
public boolean isDirty()- Specified by:
isDirtyin interfaceNodeContainerUI- Returns:
- the isDirty
-
setDirty
public void setDirty()Description copied from interface:NodeContainerUIMark this node container to be changed, that is, it needs to be saved.- Specified by:
setDirtyin interfaceNodeContainerUI
-
changeNodeLocks
public void changeNodeLocks(boolean setLock, org.knime.core.node.workflow.NodeContainer.NodeLock... locks) Description copied from interface:NodeContainerUIChanges the nodes lock status for various actions, i.e. from being deleted, reset or configured.- Specified by:
changeNodeLocksin interfaceNodeContainerUI- Parameters:
setLock- whether the locks should be set (true) or released (false)locks- the locks to be set or released, e.g.NodeContainer.NodeLock.DELETE,NodeContainer.NodeLock.RESET,NodeContainer.NodeLock.CONFIGURE
-
getNodeLocks
public org.knime.core.node.workflow.NodeContainer.NodeLocks getNodeLocks()Description copied from interface:NodeContainerUIReturns the node's lock status, i.e. whether the node is locked from being deleted, reset or configured.- Specified by:
getNodeLocksin interfaceNodeContainerUI- Returns:
- the currently set
NodeContainer.NodeLocks
-
doRpc
Description copied from interface:NodeContainerUITo be called from rpc clients - not needed for local, for remote, picks an endpoint and forwards ui data request to be transported to remote node model and collects the response in `out`.
(De-)serialization is handled byAbstractRpcClient.- Specified by:
doRpcin interfaceNodeContainerUI- Parameters:
remoteProcedureCall- the rpc serialized as a string- Returns:
- serialized result
-