JIDE 3.5.15

com.jidesoft.dashboard
Interface Gadget

All Known Implementing Classes:
AbstractGadget

public interface Gadget

The interface for the gadget in the Dashboard.


Method Summary
 GadgetComponent createGadgetComponent()
          Creates the GadgetComponent.
 void disposeGadgetComponent(GadgetComponent component)
          Disposes the GadgetComponent.
 String getDescription()
          Returns the description of the Gadget.
 GadgetManager getGadgetManager()
          Gadget must be added to a GadgetManager.
 Icon getIcon()
          Gets the icon.
 String getKey()
          Returns the key of the Gadget.
 Icon getLargeIcon()
          Gets the large icon.
 String getName()
          Returns the name of the Gadget.
 void setGadgetManager(GadgetManager manager)
          Sets the GadgetManager.
 

Method Detail

getGadgetManager

GadgetManager getGadgetManager()
Gadget must be added to a GadgetManager. This method will return the GadgetManager.

Returns:
the GadgetManager.

setGadgetManager

void setGadgetManager(GadgetManager manager)
Sets the GadgetManager. This method is called automatically when the Gadget is added to GadgetManager using GadgetManager.addGadget(Gadget) method.

Parameters:
manager - the GadgetManager.

getKey

String getKey()
Returns the key of the Gadget. The key is used to uniquely identify a Gadget in one GadgetManager. The key is not displayed anywhere in the user interface so it is OK to be a non-localized string. The strings for the name should be localized although if you never set the name, the key will be used as the name.

Returns:
a String containing this Gadget's key

getName

String getName()
Returns the name of the Gadget. The name is displayed on the title bar of the Gadget if any. If the name is never set, the key will be used.

Returns:
the name

getDescription

String getDescription()
Returns the description of the Gadget. Description is used in the GadgetPalette to give user an idea of what the gadget is.

Returns:
the description.

getIcon

Icon getIcon()
Gets the icon. The icon is usually displayed on the title bar of the gadget component, although it depends on how the gadget component is implemented. You can specify two icons for each gadget. This is the smaller one of the two. We didn't specify the exact size of this icon. But all gadgets' icon should have the same size to look good on when they displayed on the dashboard.

Returns:
the icon.

getLargeIcon

Icon getLargeIcon()
Gets the large icon. The icon is used by the GadgetPalette to represent a gadget. You can specify two icons for each gadget. This is the larger one of the two. We didn't specify the exact size of this icon. But all gadgets' icon should have the same size to look good on the palette.

Returns:
the large icon.

createGadgetComponent

GadgetComponent createGadgetComponent()
Creates the GadgetComponent. The Gadget is just an interface. It doesn't need to be a Component. The actual component is created by this method. Please note, if you want to support multiple instances of the same gadget on the dashboard, you need to create a new component every time when this method is called.

Returns:
the gadget component.

disposeGadgetComponent

void disposeGadgetComponent(GadgetComponent component)
Disposes the GadgetComponent. This method indicates the end of the life cycle of the GadgetComponent to give you a chance to free whatever resource is used by this GadgetComponent.

Parameters:
component - the GadgetComponent.

JIDE 3.5.15