org.knime.core.node
Class NodeViewExport

java.lang.Object
  extended by org.knime.core.node.NodeViewExport

public final class NodeViewExport
extends Object

This class contains all available to-image-export options for node views. By default, only the PNG export option is available but customized exporters can be added by calling the static function addExportType(org.knime.core.node.NodeViewExport.ExportType).

This class is used in a static way, it is not meant to be instantiated.

Author:
Bernd Wiswedel, University of Konstanz

Nested Class Summary
static interface NodeViewExport.ExportType
          Interface for export types.
 
Method Summary
static void addExportType(NodeViewExport.ExportType newType)
          Adds a singleton export type to the list of available exporters.
static JMenuItem createNewMenu(Container container)
          Convenience method that create a menu entry containing all available export options.
static Map<String,NodeViewExport.ExportType> getViewExportMap()
          Get a read only map containing pairs of export type identifier (as string) and the export type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addExportType

public static void addExportType(NodeViewExport.ExportType newType)
Adds a singleton export type to the list of available exporters. If you want to add your own image export type, you are advised to call this method in the start method of your knime node plugin. Make sure to call it only once for each of the export types.

This method refuses to add an export type twice (according to arguments equals() method).

Parameters:
newType - The export type to add, all necessary information are retrieved from the argument, the identifier name is uniquified, if necessary.
Throws:
NullPointerException - If the argument is null.

getViewExportMap

public static Map<String,NodeViewExport.ExportType> getViewExportMap()
Get a read only map containing pairs of export type identifier (as string) and the export type. This map can be used in a derived node view (or any other view) to create a customized menu. You can also use the createNewMenu(Container) method for your convenience.

Returns:
Such a read only map. It contains at least one entry (the png export).

createNewMenu

public static JMenuItem createNewMenu(Container container)
Convenience method that create a menu entry containing all available export options. If the current export map (according to getViewExportMap()) contains only one entry, the returned menu is a single menu item. Otherwise it's a JMenu with the export options as its children.

Parameters:
container - The container to export when a item is selected.
Returns:
Such a new(!) menu item.


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.