jrworkspace by
jTEM

de.jtem.jrworkspace.plugin.sidecontainer.template
Class ShrinkPanelPlugin

java.lang.Object
  extended by de.jtem.jrworkspace.plugin.Plugin
      extended by de.jtem.jrworkspace.plugin.sidecontainer.template.ShrinkPanelPlugin
All Implemented Interfaces:
HelpFlavor, UIFlavor, ShrinkPanel.HelpCalledListener

public abstract class ShrinkPanelPlugin
extends Plugin
implements UIFlavor, HelpFlavor, ShrinkPanel.HelpCalledListener

Extend this class to get a shrink panel Plugin which will show up in the SideContainerPerspective returned by your implementation of getPerspectivePluginClass().

PluginInfo

It is strongly recommended that you override Plugin.getPluginInfo() to return a descriptive PluginInfo. This method is called in the constructor of this class and must not return null.

Attach online help

If a file "clazz.getSimpleName().html" is found as a resource of clazz, then this is attached as the help file of this plugin, where clazz is the top level enclosing class of the runtime class of this object. Note that in Eclipse you probably need to remove *.html from "Filtered resources".

To turn this off override getHelpDocument(), getHelpPath(), and getHelpHandle().


Nested Class Summary
 
Nested classes/interfaces inherited from interface de.jtem.jrworkspace.plugin.flavor.HelpFlavor
HelpFlavor.HelpListener
 
Field Summary
static int SHRINKER_BOTTOM
           
static int SHRINKER_DEFAULT
           
static int SHRINKER_LEFT
           
static int SHRINKER_RIGHT
           
static int SHRINKER_TOP
           
protected  ShrinkPanel shrinkPanel
           
 
Constructor Summary
ShrinkPanelPlugin()
           
 
Method Summary
static Icon getDefaultIcon()
           
 String getHelpDocument()
          Returns the name of the HTML root help document
 Class<?> getHelpHandle()
          Returns the class which is the root of the help page file system.
 Icon getHelpIcon()
          Returns an help icon
 String getHelpPath()
          Returns a path to the help HTML file.
 String getHelpStyleSheet()
          Returns the name of the style sheet file to use for this help pages
 String getHelpTitle()
          Returns the title for these help pages
abstract  Class<? extends SideContainerPerspective> getPerspectivePluginClass()
           
 ShrinkPanel getShrinkPanel()
           
 void helpCalled()
           
 void install(Controller c)
          Is called when the plug-in is installed
 void mainUIChanged(String uiClass)
           
 void restoreStates(Controller c)
          Is called before the installation of this plug-in.
 void setHelpListener(HelpFlavor.HelpListener l)
          Sets the help listener which implements help functionality of the controller
 void setInitialPosition(int initPosition)
          Set the initial position of this panel plug-in Possible values are SHRINKER_LEFT, SHRINKER_RIGHT, SHRINKER_BOTTOM, SHRINKER_TOP, SHRINKER_DEFAULT
 void setShowPanel(boolean show)
           
 void storeStates(Controller c)
          Is called after this plug-in has been uninstalled.
 void uninstall(Controller c)
          Id called when this plug-in is about to be uninstalled
 
Methods inherited from class de.jtem.jrworkspace.plugin.Plugin
equals, getPluginInfo, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SHRINKER_BOTTOM

public static final int SHRINKER_BOTTOM
See Also:
Constant Field Values

SHRINKER_DEFAULT

public static final int SHRINKER_DEFAULT
See Also:
Constant Field Values

SHRINKER_LEFT

public static final int SHRINKER_LEFT
See Also:
Constant Field Values

SHRINKER_RIGHT

public static final int SHRINKER_RIGHT
See Also:
Constant Field Values

SHRINKER_TOP

public static final int SHRINKER_TOP
See Also:
Constant Field Values

shrinkPanel

protected ShrinkPanel shrinkPanel
Constructor Detail

ShrinkPanelPlugin

public ShrinkPanelPlugin()
Method Detail

getDefaultIcon

public static Icon getDefaultIcon()

getHelpDocument

public String getHelpDocument()
Description copied from interface: HelpFlavor
Returns the name of the HTML root help document

Specified by:
getHelpDocument in interface HelpFlavor
Returns:
the name of the root document
See Also:
HelpFlavor#getHelpHandle()}

getHelpHandle

public Class<?> getHelpHandle()
Description copied from interface: HelpFlavor
Returns the class which is the root of the help page file system. A help page name is then resolved like this:
String location = HelpFlavor.getHelpPath() + HelpFlavor.getHelpDocument()
InputStream in = HelpFlavor.getHelpHandle().getResourceAsStream(location)

Specified by:
getHelpHandle in interface HelpFlavor
Returns:
a class which is the root handle for these help pages

getHelpIcon

public Icon getHelpIcon()
Description copied from interface: HelpFlavor
Returns an help icon

Specified by:
getHelpIcon in interface HelpFlavor
Returns:

getHelpPath

public String getHelpPath()
Description copied from interface: HelpFlavor
Returns a path to the help HTML file.

Note: relative backward paths (..) don't seem to work with the Web Start ClassLoader!

Specified by:
getHelpPath in interface HelpFlavor
Returns:
See Also:
HelpFlavor#getHelpHandle()}

getHelpStyleSheet

public String getHelpStyleSheet()
Description copied from interface: HelpFlavor
Returns the name of the style sheet file to use for this help pages

Specified by:
getHelpStyleSheet in interface HelpFlavor
Returns:
a file name or null

getHelpTitle

public String getHelpTitle()
Description copied from interface: HelpFlavor
Returns the title for these help pages

Specified by:
getHelpTitle in interface HelpFlavor
Returns:

getPerspectivePluginClass

public abstract Class<? extends SideContainerPerspective> getPerspectivePluginClass()

getShrinkPanel

public ShrinkPanel getShrinkPanel()

helpCalled

public void helpCalled()
Specified by:
helpCalled in interface ShrinkPanel.HelpCalledListener

install

public void install(Controller c)
             throws Exception
Description copied from class: Plugin
Is called when the plug-in is installed

Overrides:
install in class Plugin
Parameters:
c - the applications Controller
Throws:
Exception
See Also:
Controller}

mainUIChanged

public void mainUIChanged(String uiClass)
Specified by:
mainUIChanged in interface UIFlavor

restoreStates

public void restoreStates(Controller c)
                   throws Exception
Description copied from class: Plugin
Is called before the installation of this plug-in. The recommended way to read properties is to call Controller.getProperty(Class, String, Object) on the controller provided as argument.

Overrides:
restoreStates in class Plugin
Parameters:
c - this applications Controller
Throws:
Exception
See Also:
Controller}

setHelpListener

public void setHelpListener(HelpFlavor.HelpListener l)
Description copied from interface: HelpFlavor
Sets the help listener which implements help functionality of the controller

Specified by:
setHelpListener in interface HelpFlavor
Parameters:
l - the listener

setInitialPosition

public void setInitialPosition(int initPosition)
Set the initial position of this panel plug-in Possible values are SHRINKER_LEFT, SHRINKER_RIGHT, SHRINKER_BOTTOM, SHRINKER_TOP, SHRINKER_DEFAULT

Parameters:
initPosition -

setShowPanel

public void setShowPanel(boolean show)

storeStates

public void storeStates(Controller c)
                 throws Exception
Description copied from class: Plugin
Is called after this plug-in has been uninstalled. The recommended way to save properties is to call Controller.storeProperty(Class, String, Object) on the controller provided as argument.

Overrides:
storeStates in class Plugin
Throws:
Exception
See Also:
Controller}

uninstall

public void uninstall(Controller c)
               throws Exception
Description copied from class: Plugin
Id called when this plug-in is about to be uninstalled

Overrides:
uninstall in class Plugin
Parameters:
c - this applications Controller
Throws:
Exception
See Also:
Controller}

jrworkspace by
jTEM

jTEM