net.datacrow.core.plugin
Class Plugin

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by net.datacrow.core.plugin.Plugin
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public abstract class Plugin
extends javax.swing.AbstractAction

The Plugin class should be extended by every plugin.

Author:
Robert Jan van der Waals
See Also:
Serialized Form

Field Summary
protected static int _INSERTTAB
           
protected static int _NOTETAB
           
protected static int _SEARCHTAB
           
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
protected Plugin(DcObject dco, DcTemplate template, int viewIdx, int moduleIdx)
          Creates a new instance
 
Method Summary
abstract  void actionPerformed(java.awt.event.ActionEvent ae)
           
 void clear()
          Free all resources.
 boolean equals(java.lang.Object o)
           
 int getCurrentTab()
           
 java.lang.String getHelpText()
          The help text.
abstract  javax.swing.ImageIcon getIcon()
           
 DcObject getItem()
          Retrieves the item for which this plugin was called / created.
 java.lang.String getKey()
          The unique key by which this plugin is referenced.
 javax.swing.KeyStroke getKeyStroke()
          The key combination to active the plugin.
 java.lang.String getLabel()
          The display label for this plugin.
 java.lang.String getLabelShort()
          The short name of this plugin
 DcModule getModule()
          Retrieves the module for which this plugin was called / created.
 int getModuleIdx()
          Retrieves the module index for which this plugin was called / created.
 DcTemplate getTemplate()
           
 View getView()
           
 int getViewIdx()
          Retrieves the view index from which this plugin was called / created.
 int getXpLevel()
          The required user experience level.
 int hashCode()
           
 boolean isAdminOnly()
          Indicates if this plugin can only be used by an administrator.
 boolean isAuthorizable()
          Indicates if a user can get special permissions in order to use this plugin.
 boolean isEnabled()
          Indicates if the plugin is enabled.
 boolean isShowInMenu()
          Indicates if the plugin should be shown in the menu bar.
 boolean isShowInPopupMenu()
          Indicates if the plugin should be shown in the popup menu of the view.
 boolean isShowOnToolbar()
          Indicates if the plugin should be shown on the toolbar.
 boolean isSystemPlugin()
          Indicates if this plugin is part of the core Data Crow product.
 void setLabel(java.lang.String label)
          Sets the label for this plugin.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_SEARCHTAB

protected static final int _SEARCHTAB
See Also:
Constant Field Values

_INSERTTAB

protected static final int _INSERTTAB
See Also:
Constant Field Values

_NOTETAB

protected static final int _NOTETAB
See Also:
Constant Field Values
Constructor Detail

Plugin

protected Plugin(DcObject dco,
                 DcTemplate template,
                 int viewIdx,
                 int moduleIdx)
Creates a new instance

Parameters:
dco - The item for which the plugin is being created (or null)
template - The template to be used (or null)
viewIdx - The view index from which this plugin is being called / created
moduleIdx - The module index to which this plugin belongs
Method Detail

getXpLevel

public int getXpLevel()
The required user experience level.

See Also:
UserMode

isAdminOnly

public boolean isAdminOnly()
Indicates if this plugin can only be used by an administrator.


getViewIdx

public int getViewIdx()
Retrieves the view index from which this plugin was called / created.


getView

public View getView()

getItem

public DcObject getItem()
Retrieves the item for which this plugin was called / created.


getTemplate

public DcTemplate getTemplate()

getLabelShort

public java.lang.String getLabelShort()
The short name of this plugin


getCurrentTab

public final int getCurrentTab()

getModuleIdx

public final int getModuleIdx()
Retrieves the module index for which this plugin was called / created.


getModule

public final DcModule getModule()
Retrieves the module for which this plugin was called / created.


getHelpText

public java.lang.String getHelpText()
The help text.


getKeyStroke

public javax.swing.KeyStroke getKeyStroke()
The key combination to active the plugin.


setLabel

public void setLabel(java.lang.String label)
Sets the label for this plugin.

Parameters:
label -

getLabel

public java.lang.String getLabel()
The display label for this plugin.


clear

public void clear()
Free all resources.


getKey

public final java.lang.String getKey()
The unique key by which this plugin is referenced.


isSystemPlugin

public boolean isSystemPlugin()
Indicates if this plugin is part of the core Data Crow product.


isShowOnToolbar

public boolean isShowOnToolbar()
Indicates if the plugin should be shown on the toolbar.


isShowInPopupMenu

public boolean isShowInPopupMenu()
Indicates if the plugin should be shown in the popup menu of the view.


isShowInMenu

public boolean isShowInMenu()
Indicates if the plugin should be shown in the menu bar.


isAuthorizable

public boolean isAuthorizable()
Indicates if a user can get special permissions in order to use this plugin.


isEnabled

public boolean isEnabled()
Indicates if the plugin is enabled.

Specified by:
isEnabled in interface javax.swing.Action
Overrides:
isEnabled in class javax.swing.AbstractAction

getIcon

public abstract javax.swing.ImageIcon getIcon()

actionPerformed

public abstract void actionPerformed(java.awt.event.ActionEvent ae)

equals

public final boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object