T
- Type of addon metadata.public interface AddonUI<T extends AddonMetadata>
Modifier and Type | Method and Description |
---|---|
T |
getAddonMetadata()
Returns the metadata (like human readable name) for the addon.
|
YouScopeFrame |
toFrame()
Creates a frame containing the UI elements of this addon.
|
java.awt.Component |
toPanel(YouScopeFrame containingFrame)
Creates a UI component (usually a panel) containing the UI elements of this addon.
|
YouScopeFrame toFrame() throws AddonException
YouScopeFrame.setVisible(true)
should be
called by the invoker of this function). A new frame can be created by calling YouScopeClient.createFrame()
. The caller can decide to add this frame
as a child or modal child frame to the frame the caller elements are displayed in by calling on its frame addChildFrame()
or addModalChildFrame()
.
Only one of the functions toFrame()
or toPanel()
must be called for a given addon. Furthermore, this function must not be called more than once.
To create more than one UI representation of a given addon, create a second addon UI using the corresponding factory.AddonException
- thrown if an error occurs during construction of the UI.java.awt.Component toPanel(YouScopeFrame containingFrame) throws AddonException
toFrame()
or toPanel()
must be called for a given tool. Furthermore, this function must not be called more than once.
To create more than one UI representation of a given addon, create a second addon UI using the corresponding factory.containingFrame
- The frame containing the UI elements. Note that this frame is not necessarily visible when this function is invoked. The reference to the containing frame can e.g.
be used to register frame listeners to get notified when the containing frame opens or closes.AddonException
- thrown if an error occurs during creation of the addon UI.T getAddonMetadata()