|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Renderer
SPI for rendering a data container.
Field Summary | |
---|---|
static String |
CLASS
|
static String |
CLASS_NAME
|
static String |
DATA
|
static String |
DATA_CONTAINER
|
static String |
MIME_TYPE
|
static String |
MOBY_TYPE
|
Method Summary | |
---|---|
boolean |
canHandle(String criterion,
Object value)
Return true if this SPI can handle (render) data whose type complies with given value within given criterion. |
JComponent |
getComponent(DataContainer data)
Return a JComponent displaying (rendering) given data. |
Icon |
getIcon()
An icon for this SPI. |
String |
getName()
A human-readable name for this SPI. |
boolean |
save2File(DataContainer data,
File file)
Save given data in the given file. |
Field Detail |
---|
static final String CLASS_NAME
static final String CLASS
static final String DATA_CONTAINER
static final String DATA
static final String MOBY_TYPE
static final String MIME_TYPE
Method Detail |
---|
boolean canHandle(String criterion, Object value)
Any renderer should handle also a collection of objects that it
can handle - see examples in getComponent(org.biomoby.service.dashboard.data.DataContainer)
and save2File(org.biomoby.service.dashboard.data.DataContainer, java.io.File)
.
criterion
- is a category of the value, e.g. "MIME-TYPE"value
- is a value from the category criterion, e.g. "text/xml"JComponent getComponent(DataContainer data) throws MobyException
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);
data
- to be rendered
MobyException
- if called with wrong type of databoolean save2File(DataContainer data, File file) throws MobyException
If it gets an array of data, ad if it wants to save them
separately, to more files, it can delegate it to the CollectionRenderer
by saying:
if (data.getData().getClass().isArray()) return new TabCollectionRenderer (this).save2File (data, file);
MobyException
- if saving was tried but failedString getName()
Icon getIcon()
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |