net.sf.taverna.perspectives
Class AbstractPerspective

java.lang.Object
  extended by net.sf.taverna.perspectives.AbstractPerspective
All Implemented Interfaces:
PerspectiveSPI
Direct Known Subclasses:
DesignPerspective, EnactPerspective

public abstract class AbstractPerspective
extends java.lang.Object
implements PerspectiveSPI

An abstract implementation of a perspective that handles the storing of the layout XML if modified via the 'update' method, which once set causes this XML to be used rather than the bundled resource. Concrete subclass should provide getText, getButtonIcon, and getLayoutResourceStream.

Author:
Stuart Owen

Constructor Summary
AbstractPerspective()
           
 
Method Summary
abstract  javax.swing.ImageIcon getButtonIcon()
          The icon for the perspective
 java.io.InputStream getLayoutInputStream()
           
abstract  java.lang.String getText()
          The name of the perspective
 boolean isVisible()
          returns true if the perspective is set to be visible
 int positionHint()
          Position hint, default to 101, meaning that perspective that don't provide a hint will always appear towards the end (Built-in perspectives coming first in a controlled order).
 void setVisible(boolean visible)
          sets whether the perspective should be visible or not.
 void update(org.jdom.Element layoutElement)
          Store internally any changes to the layout xml
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPerspective

public AbstractPerspective()
Method Detail

getLayoutInputStream

public java.io.InputStream getLayoutInputStream()
Specified by:
getLayoutInputStream in interface PerspectiveSPI
Returns:
the input stream to the layout XML

update

public void update(org.jdom.Element layoutElement)
Description copied from interface: PerspectiveSPI
Store internally any changes to the layout xml

Specified by:
update in interface PerspectiveSPI

getText

public abstract java.lang.String getText()
The name of the perspective

Specified by:
getText in interface PerspectiveSPI
Returns:
the text for the perspective

getButtonIcon

public abstract javax.swing.ImageIcon getButtonIcon()
The icon for the perspective

Specified by:
getButtonIcon in interface PerspectiveSPI
Returns:
the icon image for the toolbar button

positionHint

public int positionHint()
Position hint, default to 101, meaning that perspective that don't provide a hint will always appear towards the end (Built-in perspectives coming first in a controlled order).

Specified by:
positionHint in interface PerspectiveSPI

isVisible

public boolean isVisible()
Description copied from interface: PerspectiveSPI
returns true if the perspective is set to be visible

Specified by:
isVisible in interface PerspectiveSPI
Returns:
boolean

setVisible

public void setVisible(boolean visible)
Description copied from interface: PerspectiveSPI
sets whether the perspective should be visible or not.

Specified by:
setVisible in interface PerspectiveSPI