org.knime.base.node.util.exttool
Class ExtToolOutputNodeView<T extends ExtToolOutputNodeModel>

java.lang.Object
  extended by org.knime.core.node.AbstractNodeView<T>
      extended by org.knime.core.node.NodeView<T>
          extended by org.knime.base.node.util.exttool.ExtToolOutputNodeView<T>
Type Parameters:
T - the actual implementation of the abstract node model
All Implemented Interfaces:
EventListener, NodeModelWarningListener
Direct Known Subclasses:
ExtToolStderrNodeView, ExtToolStdoutNodeView

public abstract class ExtToolOutputNodeView<T extends ExtToolOutputNodeModel>
extends NodeView<T>

Base class for both output views. Provides a text field and the ability to add a line to this field, or to update the entire field.

Author:
ohl, University of Konstanz

Field Summary
 
Fields inherited from class org.knime.core.node.NodeView
COLOR_BACKGROUND, PROP_CHANGE_CLOSE
 
Constructor Summary
ExtToolOutputNodeView(T nodeModel)
          The constructor.
 
Method Summary
protected  void addLineInSwingThreadLater(String s)
          adds the specified line (plus \n) to the end of the Textfield.
protected  void clearText()
          removes all output from the view.
protected abstract  Collection<String> getFullFailureOutput()
           
protected abstract  Collection<String> getFullOutput()
           
protected abstract  Collection<String> getNoOutputText()
           
protected  void modelChanged()
          This method is called whenever the entire text has changed (like after a reset, load, execute, etc.).
protected  void onClose()
          Invoked when the window is about to be closed.
protected  void onOpen()
          Invoked when the window has been opened.
 
Methods inherited from class org.knime.core.node.NodeView
callCloseView, closeView, createFrame, getComponent, getJMenuBar, getViewTitle, isOpen, openViewComponent, setComponent, setShowNODATALabel, setViewTitleSuffix, warningChanged
 
Methods inherited from class org.knime.core.node.AbstractNodeView
getLogger, getNodeModel, updateModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtToolOutputNodeView

public ExtToolOutputNodeView(T nodeModel)
The constructor.

Parameters:
nodeModel - the model associated with this view.
Method Detail

modelChanged

protected void modelChanged()
This method is called whenever the entire text has changed (like after a reset, load, execute, etc.). It removes the current content and retrieves the new output to display from the node model. Method is invoked when the underlying NodeModel has changed. Also the HiLightHandler have changed. Note, the NodeModel content may be not available. Be sure to modify GUI components in the EventDispatchThread only.

Specified by:
modelChanged in class AbstractNodeView<T extends ExtToolOutputNodeModel>

addLineInSwingThreadLater

protected void addLineInSwingThreadLater(String s)
adds the specified line (plus \n) to the end of the Textfield. If the field contains more than 500 lines, it removes the first line.
Call this method if you are not sure in which thread you are.

Parameters:
s - the line to add

clearText

protected void clearText()
removes all output from the view.


getFullOutput

protected abstract Collection<String> getFullOutput()
Returns:
the entire list of strings to display in this view.

getFullFailureOutput

protected abstract Collection<String> getFullFailureOutput()
Returns:
the entire list of strings of a previous failed execution.

getNoOutputText

protected abstract Collection<String> getNoOutputText()
Returns:
the text that should be displayed if none of the above methods returned any content.

onClose

protected void onClose()
Invoked when the window is about to be closed. Unregister HiLiteListeners. Dispose internal members.
This method is the first to be called on a close request (right after the view is unregistered from the NodeModel

Specified by:
onClose in class NodeView<T extends ExtToolOutputNodeModel>

onOpen

protected void onOpen()
Invoked when the window has been opened. Register property listeners.
This method is called last on view construction - right before the components are made visible. It is not called on re-opening.

Specified by:
onOpen in class NodeView<T extends ExtToolOutputNodeModel>


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.