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
  • Constructor Details

    • NodeContainerWrapper

      protected NodeContainerWrapper(W delegate)
      Parameters:
      delegate - the implementation to delegate to
  • Method Details

    • wrap

      public static final NodeContainerWrapper wrap(org.knime.core.node.workflow.NodeContainer nc)
      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 null if nc is null
    • getDialogPaneWithSettings

      public org.knime.core.node.NodeDialogPane getDialogPaneWithSettings() throws org.knime.core.node.NotConfigurableException
      Return a NodeDialogPane for a node which can be embedded into a JFrame oder another GUI element.
      Specified by:
      getDialogPaneWithSettings in interface NodeContainerUI
      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:
      progressChanged in interface org.knime.core.node.workflow.NodeProgressListener
    • getParent

      public WorkflowManagerUI getParent()
      Specified by:
      getParent in interface NodeContainerUI
      Returns:
      parent workflowmanager holding this node (or null if root).
    • getJobManager

      public org.knime.core.node.workflow.NodeExecutionJobManager getJobManager()
      Specified by:
      getJobManager in interface NodeContainerUI
      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:
      findJobManager in interface NodeContainerUI
      Returns:
      NodeExecutionJobManager responsible for this node and all its children.
    • addNodePropertyChangedListener

      public boolean addNodePropertyChangedListener(org.knime.core.node.workflow.NodePropertyChangedListener l)
      Specified by:
      addNodePropertyChangedListener in interface NodeContainerUI
    • removeNodePropertyChangedListener

      public boolean removeNodePropertyChangedListener(org.knime.core.node.workflow.NodePropertyChangedListener l)
      Specified by:
      removeNodePropertyChangedListener in interface NodeContainerUI
    • clearWaitingLoopList

      public void clearWaitingLoopList()
      Description copied from interface: NodeContainerUI
      clears the list of waiting loops.
      Specified by:
      clearWaitingLoopList in interface NodeContainerUI
    • addProgressListener

      public boolean addProgressListener(org.knime.core.node.workflow.NodeProgressListener listener)
      Specified by:
      addProgressListener in interface NodeContainerUI
      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:
      removeNodeProgressListener in interface NodeContainerUI
      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:
      addNodeMessageListener in interface NodeContainerUI
      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:
      removeNodeMessageListener in interface NodeContainerUI
      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: NodeContainerUI
      Get the message to be displayed to the user.
      Specified by:
      getNodeMessage in interface NodeContainerUI
      Returns:
      the node message consisting of type and message, never null.
    • setNodeMessage

      public void setNodeMessage(org.knime.core.node.workflow.NodeMessage newMessage)
      Specified by:
      setNodeMessage in interface NodeContainerUI
      Parameters:
      newMessage - the nodeMessage to set
    • addUIInformationListener

      public void addUIInformationListener(org.knime.core.node.workflow.NodeUIInformationListener l)
      Specified by:
      addUIInformationListener in interface NodeContainerUI
    • removeUIInformationListener

      public void removeUIInformationListener(org.knime.core.node.workflow.NodeUIInformationListener l)
      Specified by:
      removeUIInformationListener in interface NodeContainerUI
    • getUIInformation

      public org.knime.core.node.workflow.NodeUIInformation getUIInformation()
      Description copied from interface: NodeContainerUI
      Returns the UI information.
      Specified by:
      getUIInformation in interface NodeContainerUI
      Returns:
      a the node information
    • setUIInformation

      public void setUIInformation(org.knime.core.node.workflow.NodeUIInformation uiInformation)
      Description copied from interface: NodeContainerUI
      Used, e.g., when nodes are moved.
      Specified by:
      setUIInformation in interface NodeContainerUI
      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:
      setUIInformationForCorrection in interface NodeContainerUI
    • addNodeStateChangeListener

      public boolean addNodeStateChangeListener(org.knime.core.node.workflow.NodeStateChangeListener listener)
      Description copied from interface: NodeContainerUI
      Specified by:
      addNodeStateChangeListener in interface org.knime.core.node.workflow.NodeContainerStateObservable
      Specified by:
      addNodeStateChangeListener in interface NodeContainerUI
    • removeNodeStateChangeListener

      public boolean removeNodeStateChangeListener(org.knime.core.node.workflow.NodeStateChangeListener listener)
      Description copied from interface: NodeContainerUI
      Specified by:
      removeNodeStateChangeListener in interface org.knime.core.node.workflow.NodeContainerStateObservable
      Specified by:
      removeNodeStateChangeListener in interface NodeContainerUI
    • getNodeContainerState

      public org.knime.core.node.workflow.NodeContainerState getNodeContainerState()
      Description copied from interface: NodeContainerUI
      Specified by:
      getNodeContainerState in interface org.knime.core.node.workflow.NodeContainerStateObservable
      Specified by:
      getNodeContainerState in interface NodeContainerUI
    • hasDataAwareDialogPane

      public boolean hasDataAwareDialogPane()
      Description copied from interface: NodeContainerUI
      Whether the dialog is a DataAwareNodeDialogPane. If so, the predecessor nodes need to be executed before the dialog is opened.
      Specified by:
      hasDataAwareDialogPane in interface NodeContainerUI
      Returns:
      that property
    • isAllInputDataAvailable

      public boolean isAllInputDataAvailable()
      Description copied from interface: NodeContainerUI
      Called for nodes having data aware dialogs in order to check whether to prompt for execution or not.
      Specified by:
      isAllInputDataAvailable in interface NodeContainerUI
      Returns:
      true if correctly connected and all inputs have data.
      See Also:
      • WorkflowManager.isAllInputDataAvailableToNode(NodeID)
    • canExecuteUpToHere

      public boolean canExecuteUpToHere()
      Description copied from interface: NodeContainerUI
      Currently 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:
      canExecuteUpToHere in interface NodeContainerUI
      Returns:
      true if all non-optional ports are connected.
    • applySettingsFromDialog

      public org.knime.core.node.NodeSettings applySettingsFromDialog() throws org.knime.core.node.InvalidSettingsException
      Description copied from interface: NodeContainerUI
      Take settings from the node's dialog and apply them to the model. Throws an exception if the apply fails.
      Specified by:
      applySettingsFromDialog in interface NodeContainerUI
      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:
      getNodeSettings in interface NodeContainerUI
      Returns:
      user settings for this node, possibly empty but not null.
    • areDialogSettingsValid

      public boolean areDialogSettingsValid()
      Specified by:
      areDialogSettingsValid in interface NodeContainerUI
    • hasDialog

      public boolean hasDialog()
      Specified by:
      hasDialog in interface NodeContainerUI
    • areDialogAndNodeSettingsEqual

      public boolean areDialogAndNodeSettingsEqual()
      Specified by:
      areDialogAndNodeSettingsEqual in interface NodeContainerUI
    • getNrInPorts

      public int getNrInPorts()
      Specified by:
      getNrInPorts in interface NodeContainerUI
    • getInPort

      public NodeInPortUI getInPort(int index)
      Specified by:
      getInPort in interface NodeContainerUI
    • getOutPort

      public NodeOutPortUI getOutPort(int index)
      Specified by:
      getOutPort in interface NodeContainerUI
    • getNrOutPorts

      public int getNrOutPorts()
      Specified by:
      getNrOutPorts in interface NodeContainerUI
    • getNrViews

      public int getNrViews()
      Specified by:
      getNrViews in interface NodeContainerUI
    • getNrNodeViews

      public int getNrNodeViews()
      Description copied from interface: NodeContainerUI
      Returns the number of views provided by the node implementation.
      Specified by:
      getNrNodeViews in interface NodeContainerUI
      Returns:
      the number of views provided by the node implementation
    • getViewName

      public String getViewName(int i)
      Specified by:
      getViewName in interface NodeContainerUI
    • getNodeViewName

      public String getNodeViewName(int i)
      Specified by:
      getNodeViewName in interface NodeContainerUI
    • hasInteractiveView

      public boolean hasInteractiveView()
      Specified by:
      hasInteractiveView in interface NodeContainerUI
      Returns:
      true if node provides an interactive view.
    • getInteractiveWebViews

      public InteractiveWebViewsResultUI getInteractiveWebViews()
      Description copied from interface: NodeContainerUI
      Get the 'interactive web views' provided by this node. That is, views providing a WebTemplate for 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:
      getInteractiveWebViews in interface NodeContainerUI
      Returns:
      An new InteractiveWebViewsResultUI with possibly 0 or more views.
    • getInteractiveViewName

      public String getInteractiveViewName()
      Description copied from interface: NodeContainerUI
      Returns the name of the interactive view if such a view exists. Otherwise null is returned.
      Specified by:
      getInteractiveViewName in interface NodeContainerUI
      Returns:
      name of the interactive view or null
    • getIcon

      public URL getIcon()
      Specified by:
      getIcon in interface NodeContainerUI
    • getIconAsStream

      public InputStream getIconAsStream()
      Specified by:
      getIconAsStream in interface NodeContainerUI
    • getType

      public org.knime.core.node.NodeFactory.NodeType getType()
      Specified by:
      getType in interface NodeContainerUI
    • getID

      public org.knime.core.node.workflow.NodeID getID()
      Specified by:
      getID in interface NodeContainerUI
    • getName

      public String getName()
      Specified by:
      getName in interface NodeContainerUI
    • getNameWithID

      public String getNameWithID()
      Specified by:
      getNameWithID in interface NodeContainerUI
    • getDisplayLabel

      public String getDisplayLabel()
      Specified by:
      getDisplayLabel in interface NodeContainerUI
      Returns:
      the display label for NodeView, OutPortView and NodeDialog
    • getCustomName

      public String getCustomName()
      Description copied from interface: NodeContainerUI
      For 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:
      getCustomName in interface NodeContainerUI
      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:
      getNodeAnnotation in interface NodeContainerUI
      Returns:
      the annotation associated with the node, never null.
    • getCustomDescription

      public String getCustomDescription()
      Specified by:
      getCustomDescription in interface NodeContainerUI
    • setCustomDescription

      public void setCustomDescription(String customDescription)
      Specified by:
      setCustomDescription in interface NodeContainerUI
    • setDeletable

      public void setDeletable(boolean value)
      Specified by:
      setDeletable in interface NodeContainerUI
      Parameters:
      value - the isDeletable to set
    • isDeletable

      public boolean isDeletable()
      Specified by:
      isDeletable in interface NodeContainerUI
      Returns:
      the isDeletable
    • isDirty

      public boolean isDirty()
      Specified by:
      isDirty in interface NodeContainerUI
      Returns:
      the isDirty
    • setDirty

      public void setDirty()
      Description copied from interface: NodeContainerUI
      Mark this node container to be changed, that is, it needs to be saved.
      Specified by:
      setDirty in interface NodeContainerUI
    • changeNodeLocks

      public void changeNodeLocks(boolean setLock, org.knime.core.node.workflow.NodeContainer.NodeLock... locks)
      Description copied from interface: NodeContainerUI
      Changes the nodes lock status for various actions, i.e. from being deleted, reset or configured.
      Specified by:
      changeNodeLocks in interface NodeContainerUI
      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: NodeContainerUI
      Returns the node's lock status, i.e. whether the node is locked from being deleted, reset or configured.
      Specified by:
      getNodeLocks in interface NodeContainerUI
      Returns:
      the currently set NodeContainer.NodeLocks
    • doRpc

      public String doRpc(String remoteProcedureCall)
      Description copied from interface: NodeContainerUI
      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`.
      (De-)serialization is handled by AbstractRpcClient.
      Specified by:
      doRpc in interface NodeContainerUI
      Parameters:
      remoteProcedureCall - the rpc serialized as a string
      Returns:
      serialized result