org.embl.ebi.escience.scuflui.renderers
Class CollectionAsTable

java.lang.Object
  extended by org.embl.ebi.escience.scuflui.renderers.CollectionAsTable
All Implemented Interfaces:
RendererSPI

public class CollectionAsTable
extends java.lang.Object
implements RendererSPI

Author:
Matthew Pocock

Constructor Summary
CollectionAsTable()
           
 
Method Summary
 boolean canHandle(RendererRegistry renderers, DataThing dataThing)
          Return true if this SPI can handle the given object with the given mime type, false otherwise.
 javax.swing.JComponent getComponent(RendererRegistry renderers, DataThing dataThing)
          Return a JComponent that renders this object that proports to have a particular mime type.
 javax.swing.Icon getIcon(RendererRegistry renderers, DataThing dataThing)
          An icon that can be used to identify this SPI.
 java.lang.String getName()
          A human-readable name for this SPI.
 boolean isTerminal()
          Discover if this is a terminal renderer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionAsTable

public CollectionAsTable()
Method Detail

isTerminal

public boolean isTerminal()
Description copied from interface: RendererSPI
Discover if this is a terminal renderer. A renderer is terminal if it renders the given DataThing. It is not terminal if it first calculates some property of that DataThing that may potentially lead to some other non-terminal Renderer being used.

Specified by:
isTerminal in interface RendererSPI
Returns:
true if this is a terminal renderer, false otherwise

canHandle

public boolean canHandle(RendererRegistry renderers,
                         DataThing dataThing)
Description copied from interface: RendererSPI
Return true if this SPI can handle the given object with the given mime type, false otherwise.

Specified by:
canHandle in interface RendererSPI
Parameters:
renderers - the MimeTypeRendereRegistry to look up sibling renderers
dataThing - the object to render
Returns:
true if we can handle the mime type

getName

public java.lang.String getName()
Description copied from interface: RendererSPI
A human-readable name for this SPI.

Specified by:
getName in interface RendererSPI
Returns:
the name

getIcon

public javax.swing.Icon getIcon(RendererRegistry renderers,
                                DataThing dataThing)
Description copied from interface: RendererSPI
An icon that can be used to identify this SPI.

Specified by:
getIcon in interface RendererSPI
Parameters:
renderers - the MimeTypeRendereRegistry to look up sibling renderers
dataThing - the object to render
Returns:
an appropreate icon, or null if this SPI doesn't have an icon

getComponent

public javax.swing.JComponent getComponent(RendererRegistry renderers,
                                           DataThing dataThing)
Description copied from interface: RendererSPI
Return a JComponent that renders this object that proports to have a particular mime type. If canHandle() returns true, then getComponent() must not return null.

Specified by:
getComponent in interface RendererSPI
Parameters:
renderers - the MimeTypeRendereRegistry to look up sibling renderers
dataThing - the object to render
Returns:
a JComponent for displaying the object, or null