Version: 1.1.1

org.biomoby.service.dashboard.renderers
Class PlainText

java.lang.Object
  extended by org.biomoby.service.dashboard.renderers.AbstractRenderer
      extended by org.biomoby.service.dashboard.renderers.PlainText
All Implemented Interfaces:
Renderer
Direct Known Subclasses:
PlainMobyText

public class PlainText
extends AbstractRenderer

Display any String as a plain text in a text area. It includes displaying raw, unformatted XML data.

Version:
$Id: PlainText.java,v 1.4 2006/02/20 05:51:11 senger Exp $
Author:
Martin Senger

Field Summary
 
Fields inherited from interface org.biomoby.service.dashboard.renderers.Renderer
CLASS, CLASS_NAME, DATA, DATA_CONTAINER, MIME_TYPE, MOBY_TYPE
 
Constructor Summary
PlainText()
           
 
Method Summary
 boolean canHandle(String criterion, Object value)
          It can handle Strings.
 JComponent getComponent(DataContainer data)
          Return a JComponent displaying (rendering) given data.
 
Methods inherited from class org.biomoby.service.dashboard.renderers.AbstractRenderer
getIcon, getName, save2File
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlainText

public PlainText()
Method Detail

canHandle

public boolean canHandle(String criterion,
                         Object value)
It can handle Strings.

It can actually handle more - because it uses toString() method on the incoming data - but it is not always the way we want to present data, so this method is more conservative in saying what it can handle.

Specified by:
canHandle in interface Renderer
Specified by:
canHandle in class AbstractRenderer
Parameters:
criterion - is a category of the value, e.g. "MIME-TYPE"
value - is a value from the category criterion, e.g. "text/xml"

getComponent

public JComponent getComponent(DataContainer data)
                        throws MobyException
Description copied from interface: Renderer
Return a JComponent displaying (rendering) given data.

If it gets an array of data, it can always delegate their accumulation to the CollectionRenderer by saying:

   if (data.getData().getClass().isArray())
      return new BoxCollectionRenderer (this).getComponent (data);

Specified by:
getComponent in interface Renderer
Specified by:
getComponent in class AbstractRenderer
Parameters:
data - to be rendered
Returns:
a component for displaying data, or null if there is a problem with data
Throws:
MobyException - if called with wrong type of data

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010