org.knime.core.node.util
Class DefaultStringIconOption

java.lang.Object
  extended by org.knime.core.node.util.DefaultStringIconOption
All Implemented Interfaces:
StringIconOption

public class DefaultStringIconOption
extends Object
implements StringIconOption

Default implementation of the StringIconOption interface which is used in the default dialog components itself.

Author:
Tobias Koetter, University of Konstanz

Constructor Summary
DefaultStringIconOption(String text)
          Constructor for class DialogComponentStringSelection.StringOption without icon.
DefaultStringIconOption(String text, Icon icon)
          Constructor for class DialogComponentStringSelection.StringOption.
 
Method Summary
static StringIconOption[] createOptionArray(Collection<String> items)
          Helper method to create a StringIconOption array from a String Collection.
 boolean equals(Object obj)
          
 Icon getIcon()
          
 String getText()
          
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultStringIconOption

public DefaultStringIconOption(String text)
Constructor for class DialogComponentStringSelection.StringOption without icon.

Parameters:
text - the text to display

DefaultStringIconOption

public DefaultStringIconOption(String text,
                               Icon icon)
Constructor for class DialogComponentStringSelection.StringOption.

Parameters:
text - the text to display
icon - the optional icon to display
Method Detail

getIcon

public Icon getIcon()

Specified by:
getIcon in interface StringIconOption
Returns:
the Icon to render or null if no icon should be rendered

getText

public String getText()

Specified by:
getText in interface StringIconOption
Returns:
the label to render must not be null

toString

public String toString()

Overrides:
toString in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

createOptionArray

public static StringIconOption[] createOptionArray(Collection<String> items)
Helper method to create a StringIconOption array from a String Collection.

Parameters:
items - the String Collection to create the StringIconOption array of
Returns:
the StringIconOption array


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.