com.lightdev.app.shtm

Interface SHTMLPlugin

public interface SHTMLPlugin

Defines an interface all plug-ins for application SimplyHTML have to implement.

Author: Ulrich Hilger Light Development http://www.lightdev.com info@lightdev.com published under the terms and conditions of the GNU General Public License, for details see file gpl.txt in the distribution package of this software

Field Summary
static intDOCK_LOCATION_BOTTOM
indicates docking requested on bottom of a given container
static intDOCK_LOCATION_LEFT
indicates docking requested on the left of a given container
static intDOCK_LOCATION_NONE
indicates docking is not requested
static intDOCK_LOCATION_RIGHT
indicates docking requested on the right of a given container
static intDOCK_LOCATION_TOP
indicates docking requested on top of a given container
Method Summary
JComponentgetComponent()
get the component that this plug-in produces, if any
intgetDockLocation()
get the location the component returned by getDockComponent() shall be docked at.
StringgetGUIName()
get the name of the plug-in as it shall appear on a GUI.
JMenuItemgetHelpMenu()
get a menu item providing documentation about this plug-in.
StringgetInternalName()
get the name used internally for this plug-in
SHTMLPanelImplgetOwner()
get the owner of this plug-in
ActiongetOwnerAction(String cmd)
get an action from the resource bundle of the owner of this plug-in
StringgetOwnerResString(String nm)
get a string from the resource bundle of the owner of this plug-in
JMenuItemgetPluginMenu()
get a menu of actions this plug-in provides.
voidinitHelpMenu()
voidinitPlugin(SHTMLPanelImpl owner, String internalName, String pluginMenuId, String helpMenuId)
init the plug-in this is called by the PluginManager directly after instantiating the plug-in
booleanisActive()
get the status of the plug-in
voidsetDockLocation(int location)
set the location the component returned by getDockComponent() shall be docked at.
voidsetOwner(SHTMLPanelImpl owner)
set the owner of this plug-in
voidsetStatus(boolean isActive)
set status of plug-in
voidshowInitialInfo()

Field Detail

DOCK_LOCATION_BOTTOM

public static final int DOCK_LOCATION_BOTTOM
indicates docking requested on bottom of a given container

DOCK_LOCATION_LEFT

public static final int DOCK_LOCATION_LEFT
indicates docking requested on the left of a given container

DOCK_LOCATION_NONE

public static final int DOCK_LOCATION_NONE
indicates docking is not requested

DOCK_LOCATION_RIGHT

public static final int DOCK_LOCATION_RIGHT
indicates docking requested on the right of a given container

DOCK_LOCATION_TOP

public static final int DOCK_LOCATION_TOP
indicates docking requested on top of a given container

Method Detail

getComponent

public JComponent getComponent()
get the component that this plug-in produces, if any

Returns: the component produced by this plug-in, or null if none is produced

getDockLocation

public int getDockLocation()
get the location the component returned by getDockComponent() shall be docked at.

Returns: the dock location, one of DOCK_LOCATION_TOP, DOCK_LOCATION_BOTTOM, DOCK_LOCATION.LEFT, DOCK_LOCATION_RIGHT or DOCK_LOCATION_NONE, if the component shall not dock.

getGUIName

public String getGUIName()
get the name of the plug-in as it shall appear on a GUI.

Returns: the name of the plug-in

getHelpMenu

public JMenuItem getHelpMenu()
get a menu item providing documentation about this plug-in.

JMenu is a decendant of JMenuItem so this method may return a single menu item up to a whole structure of submenus in its return value.

Returns: a menu item with help for this plug-in

getInternalName

public String getInternalName()
get the name used internally for this plug-in

Returns: the internal name of this plug-in

getOwner

public SHTMLPanelImpl getOwner()
get the owner of this plug-in

Returns: the main frame of the instance of SimplyHTML that created the plug-in

getOwnerAction

public Action getOwnerAction(String cmd)
get an action from the resource bundle of the owner of this plug-in

Parameters: cmd the name of the action to get

Returns: the action with the given name or null, if none is found

getOwnerResString

public String getOwnerResString(String nm)
get a string from the resource bundle of the owner of this plug-in

Parameters: nm the name of the string resource to get

Returns: the string with the given name or null, if none is found

getPluginMenu

public JMenuItem getPluginMenu()
get a menu of actions this plug-in provides.

JMenu is a decendant of JMenuItem so this method may return a single menu item up to a whole structure of submenus in its return value.

Returns: the plug-in menu

initHelpMenu

public void initHelpMenu()

initPlugin

public void initPlugin(SHTMLPanelImpl owner, String internalName, String pluginMenuId, String helpMenuId)
init the plug-in this is called by the PluginManager directly after instantiating the plug-in

Parameters: owner the owner of this plug-in internalName the internal name this plug-in shall have pluginMenuId the id of the plug-in menu in the TextResources, or null if no plugin-in menu is to be created helpMenuId the id of the help menu for this plug-in in the TextResources, or null if no help menu is to be created

isActive

public boolean isActive()
get the status of the plug-in

Returns: true, if activated, false if not

setDockLocation

public void setDockLocation(int location)
set the location the component returned by getDockComponent() shall be docked at.

Parameters: location the dock location, one of DOCK_LOCATION_TOP, DOCK_LOCATION_BOTTOM, DOCK_LOCATION.LEFT, DOCK_LOCATION_RIGHT or DOCK_LOCATION_NONE, if the component shall not dock.

setOwner

public void setOwner(SHTMLPanelImpl owner)
set the owner of this plug-in

Parameters: owner the main frame of the instance of SimplyHTML creating the plug-in

setStatus

public void setStatus(boolean isActive)
set status of plug-in

Parameters: isActive indicates whether or not the plug-in shall be activated

showInitialInfo

public void showInitialInfo()