org.openpermis.editor.policy.plugin
Class AbstractPlugin

java.lang.Object
  extended by org.openpermis.editor.policy.plugin.AbstractPlugin
All Implemented Interfaces:
Plugin
Direct Known Subclasses:
AbstractPolicyPlugin

public abstract class AbstractPlugin
extends Object
implements Plugin

Abstract base class for plugins.

Since:
0.9.0

Constructor Summary
AbstractPlugin(ApplicationContext context)
          Creates an abstract plugin that operates on an action and resource map derived from the implementation class of this plugin.
 
Method Summary
 void customizeMenu(MenuBarFactory.Customizer customizer)
          Prompts the plugin to provide its menu customization.
 void customizeToolBar(ToolBarFactory.Customizer customizer)
          Prompts the plugin to provide its tool bar customization.
protected  Action getAction(String name)
          Convenience method to retrieve an action by name.
protected  ActionMap getActionMap()
          Returns the application action map of this plugin class and instance.
protected  ApplicationContext getApplicationContext()
          Returns the context of the application that owns this plugin.
protected  Container getMainContentPane()
          Returns the content pane of the main frame.
protected  JFrame getMainFrame()
          Returns the main frame of the application context.
protected  org.jdesktop.application.ResourceMap getResourceMap()
          Returns the context resource map of this view plugin.
protected  String getTranslation(String key)
          Returns the translation for the specified key.
protected  String getTranslation(String key, Object... args)
          Returns the translation for the specified key.
protected  void showError(String title, String message)
          Shows a modal error dialog.
protected  void showWarning(String title, String message)
          Shows a modal warning dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPlugin

public AbstractPlugin(ApplicationContext context)
Creates an abstract plugin that operates on an action and resource map derived from the implementation class of this plugin.

Parameters:
context - the application context used to lookup the action and resource map.
Since:
0.9.0
Method Detail

getTranslation

protected String getTranslation(String key)
Returns the translation for the specified key.

Parameters:
key - the key to translate.
Returns:
the translation or the key if it could not be translated.
Since:
0.9.0

getTranslation

protected String getTranslation(String key,
                                Object... args)
Returns the translation for the specified key.

Parameters:
key - the key to translate.
args - additional arguments.
Returns:
the translation or the key if it could not be translated.
Since:
0.9.0

getApplicationContext

protected ApplicationContext getApplicationContext()
Returns the context of the application that owns this plugin.

Returns:
the context of the application that owns this plugin.
Since:
0.9.0

getMainFrame

protected JFrame getMainFrame()
Returns the main frame of the application context.

Returns:
the main frame of the application context.
Since:
0.9.0

getMainContentPane

protected Container getMainContentPane()
Returns the content pane of the main frame.

Returns:
the content pane of the main frame.
Since:
0.9.0

showError

protected void showError(String title,
                         String message)
Shows a modal error dialog.

Parameters:
title - the (already translated) title of the dialog.
message - the (already translated) message of the dialog.
Since:
0.9.0

showWarning

protected void showWarning(String title,
                           String message)
Shows a modal warning dialog.

Parameters:
title - the (already translated) title of the dialog.
message - the (already translated) message of the dialog.
Since:
0.9.0

getResourceMap

protected org.jdesktop.application.ResourceMap getResourceMap()
Returns the context resource map of this view plugin.

Returns:
the context resource map of this view plugin.
Since:
0.9.0

getActionMap

protected ActionMap getActionMap()
Returns the application action map of this plugin class and instance.

Returns:
the application action map of this plugin class and instance.
Since:
0.9.0

getAction

protected Action getAction(String name)
Convenience method to retrieve an action by name.

Bascially corresponds to getActionMap().get(name).

Note: If the action does not exist an error message including stack trace is logged and an action that does nothing is returned.

Parameters:
name - the name of the action to retrieve.
Returns:
the action requested or void action if there is no such action.
Since:
0.9.0

customizeMenu

public void customizeMenu(MenuBarFactory.Customizer customizer)
Description copied from interface: Plugin
Prompts the plugin to provide its menu customization.

Specified by:
customizeMenu in interface Plugin
Parameters:
customizer - the customizer to use.
Since:
0.9.0

customizeToolBar

public void customizeToolBar(ToolBarFactory.Customizer customizer)
Description copied from interface: Plugin
Prompts the plugin to provide its tool bar customization.

Specified by:
customizeToolBar in interface Plugin
Parameters:
customizer - the customizer to use.
Since:
0.9.0


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:17:21
Copyright (c) 2002-2007 Ergon Informatik AG