public class ToolAddonFactoryAdapter extends java.lang.Object implements ToolAddonFactory
Constructor and Description |
---|
ToolAddonFactoryAdapter()
Constructor.
|
ToolAddonFactoryAdapter(java.lang.Class<? extends ToolAddonUI> toolAddonUIClass,
ToolMetadata metadata)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAddon(java.lang.Class<? extends ToolAddonUI> toolAddonUIClass,
ToolMetadata metadata)
Adds an addon.
|
ToolAddonUI |
createToolUI(java.lang.String typeIdentifier,
YouScopeClient client,
YouScopeServer server)
Returns the UI of a Tool for the given type identifier.
|
java.lang.String[] |
getSupportedTypeIdentifiers()
Returns all tool type identifiers supported by this addon
|
ToolMetadata |
getToolMetadata(java.lang.String typeIdentifier)
Returns the metadata (like human readable name) for the tool with the given type identifier.
|
boolean |
isSupportingTypeIdentifier(java.lang.String typeIdentifier)
Returns true if this addon supports tools with the given type identifier, false otherwise.
|
public ToolAddonFactoryAdapter(java.lang.Class<? extends ToolAddonUI> toolAddonUIClass, ToolMetadata metadata)
toolAddonUIClass
- The class of the UI exposed to the user.metadata
- Metadata about this tool.public ToolAddonFactoryAdapter()
addAddon(java.lang.Class<? extends org.youscope.addon.tool.ToolAddonUI>, org.youscope.addon.tool.ToolMetadata)
to expose addons.public void addAddon(java.lang.Class<? extends ToolAddonUI> toolAddonUIClass, ToolMetadata metadata)
toolAddonUIClass
- The class of the UI exposed to the user.metadata
- Metadata about this tool.public java.lang.String[] getSupportedTypeIdentifiers()
ToolAddonFactory
getSupportedTypeIdentifiers
in interface ToolAddonFactory
public boolean isSupportingTypeIdentifier(java.lang.String typeIdentifier)
ToolAddonFactory
isSupportingTypeIdentifier
in interface ToolAddonFactory
typeIdentifier
- The type identifier of the tool for which it should be queried if this addon supports it.public ToolAddonUI createToolUI(java.lang.String typeIdentifier, YouScopeClient client, YouScopeServer server) throws AddonException
ToolAddonFactory
AddonException
.createToolUI
in interface ToolAddonFactory
typeIdentifier
- The type identifier of the tool.client
- YouScope client.server
- YouScope server.AddonException
- Thrown if tools with given type identifier are not supported by this factory.*public ToolMetadata getToolMetadata(java.lang.String typeIdentifier) throws AddonException
ToolAddonFactory
getToolMetadata
in interface ToolAddonFactory
typeIdentifier
- The type identifier of the tool for which the metadata should be returned.AddonException
- Thrown if type identifier is not supported by the factory.