org.openbp.jaspira.gui.plugin
Interface VisiblePlugin

All Superinterfaces:
Plugin
All Known Subinterfaces:
DrawingEditorPlugin
All Known Implementing Classes:
AboutBoxPlugin, AbstractVisiblePlugin, CockpitAboutBox, ColorChooserPlugin, FinderResultPlugin, InfoPanelPlugin, InspectorPlugin, ItemBrowserPlugin, JaspiraPage, MiniViewPlugin, Modeler, ModelerPage, NodeEditorItemBrowserPlugin, NodeItemEditorPage, NodeItemEditorPlugin, PluginMgrPlugin, PropertyBrowserPlugin, SocketToolBoxPlugin, StackTracePlugin, StandardToolBoxPlugin, StatusBarPlugin, ToolBoxPlugin, UserToolBoxPlugin, VariablesPlugin

public interface VisiblePlugin
extends Plugin

A visible plugin is a plugin that can be displayed in the user interface of an application.

Author:
Stephan Moritz

Field Summary
static java.lang.String GER
          Event name for global enviroment updates (i\. e\. toolbar and menu rebuilds)
static java.lang.String GEU
          Event name for global enviroment updates (i\. e\. toolbar and menu rebuilds)
static int SIZE_VARIABLE_BOTH
          Plugin sizing behavior: Variable width and height
static int SIZE_VARIABLE_HEIGHT
          Plugin sizing behavior: Variable height
static int SIZE_VARIABLE_NONE
          Plugin sizing behavior: Fixed size
static int SIZE_VARIABLE_WIDTH
          Plugin sizing behavior: Variable width
static int TOOLBAR_DYNAMIC
          Plugin toolbar type: The plugin toolbar will be build dynamically by broadcasting an InteractionEvent
static int TOOLBAR_EVENTS
          Plugin toolbar type: The plugin toolbar contains entries for all its events accepting a JaspiraActionEvent
static int TOOLBAR_NONE
          Plugin toolbar type: The plugin doesn't have a toolbar
 
Fields inherited from interface org.openbp.jaspira.plugin.Plugin
ID_DELIMETER, LEVEL_APPLICATION, LEVEL_FRAME, LEVEL_PAGE, LEVEL_PLUGIN
 
Method Summary
 void addPluginFocusListener(java.awt.event.FocusListener listener)
          Adds a focus listener to the plugin.
 boolean canCopy()
          Checks if the plugin can copy the selected data to the clipboard.
 boolean canCut()
          Checks if the plugin can cut the selected data to the clipboard.
 boolean canDelete()
          Checks if the plugin can delete the selected data.
 boolean canDrag()
          Checks if the plugin can be dragged.
 boolean canPaste(java.awt.datatransfer.Transferable transferable)
          Checks if the plugin can paste the data of the given transferable object.
 java.awt.datatransfer.Transferable copy()
          Copies the selected data from the plugin to the clipboard.
 JaspiraToolbar createToolbar()
          Creates the toolbar of this plugin.
 java.awt.datatransfer.Transferable cut()
          Cuts the selected data from the plugin to the clipboard.
 void delete()
          Deletes the selected data, if any.
 void firePluginFocusGained()
          Fires a 'focus gained event' to the focus listeners of the plugin.
 void firePluginFocusLost()
          Fires a 'focus gained event' to the focus listeners of the plugin.
 void focusPlugin()
          Requests the focus for this plugin from the plugin manager and brings it to the front.
 JaspiraPage getPage()
          Returns the page level parent plugin of this plugin.
 javax.swing.JComponent getPluginComponent()
          Gets the component this plugin contains.
 java.awt.Component getPluginFocusComponent()
          Returns the focus component of this plugin, i\.e\. the component that is to initially receive the focus.
 PluginHolder getPluginHolder()
          Returns the holder of this plugin.
 PluginPanel getPluginPanel()
          Gets the panel that holds the title bar of the plugin and the content panel.
 int getSizeBehavior()
          Returns the behavior of the plugin size.
 java.util.List getSubClients()
          Gets the sub clients of this drop client.
 int getToolbarType()
          Gets the type of the plugin toolbar.
 boolean hasCloseButton()
          Returns true if the plugin should have a close button in its title bar.
 boolean isPluginFocused()
          Checks if the plugin is currently focused.
 boolean isPluginVisible()
          Checks if the plugin is currently visible.
 void paste(java.awt.datatransfer.Transferable transferable)
          Pastes the given data into the plugin.
 void pluginHidden()
          Called after the plugin has been hidden.
 void pluginShown()
          Called after the plugin has been displayed.
 void postPluginContainerUpdate(boolean fullRebuild)
          Posts an update request of the plugin's container.
 void removePluginFocusListener(java.awt.event.FocusListener listener)
          Removes the focus listener from the plugin.
 void setPluginHolder(PluginHolder holder)
          Sets the holder of this plugin.
 void showPlugin(boolean changePage)
          Brings the plugin to the front, but does not request the focus.
 void updatePluginContainer(boolean fullRebuild)
          Forces the container of this plugin to rebuild its environment.
 
Methods inherited from interface org.openbp.jaspira.plugin.Plugin
addPlugin, addToPeerGroup, canClose, containsStackedEvent, fireEvent, fireEvent, fireEvent, getAction, getChildPlugins, getClassName, getCondition, getDescendantPlugins, getDescription, getEventActionNames, getIcon, getLevel, getName, getParentPlugin, getPeerGroup, getPeerGroupNames, getPeerGroups, getPluginResourceCollection, getPluginState, getSubTitle, getTitle, getUniqueId, getVendor, getVersion, handleEvent, inheritEvent, initializePlugin, installFirstPlugin, installPlugin, matchesPeerGroup, matchesPeerGroups, receiveEvent, removeFromPeerGroup, removePlugin, requestClose, setParentPlugin, setPluginState, stackEvent, uninstallLastPlugin, uninstallPlugin
 

Field Detail

TOOLBAR_NONE

static final int TOOLBAR_NONE
Plugin toolbar type: The plugin doesn't have a toolbar

See Also:
Constant Field Values

TOOLBAR_EVENTS

static final int TOOLBAR_EVENTS
Plugin toolbar type: The plugin toolbar contains entries for all its events accepting a JaspiraActionEvent

See Also:
Constant Field Values

TOOLBAR_DYNAMIC

static final int TOOLBAR_DYNAMIC
Plugin toolbar type: The plugin toolbar will be build dynamically by broadcasting an InteractionEvent

See Also:
Constant Field Values

SIZE_VARIABLE_NONE

static final int SIZE_VARIABLE_NONE
Plugin sizing behavior: Fixed size

See Also:
Constant Field Values

SIZE_VARIABLE_WIDTH

static final int SIZE_VARIABLE_WIDTH
Plugin sizing behavior: Variable width

See Also:
Constant Field Values

SIZE_VARIABLE_HEIGHT

static final int SIZE_VARIABLE_HEIGHT
Plugin sizing behavior: Variable height

See Also:
Constant Field Values

SIZE_VARIABLE_BOTH

static final int SIZE_VARIABLE_BOTH
Plugin sizing behavior: Variable width and height

See Also:
Constant Field Values

GEU

static final java.lang.String GEU
Event name for global enviroment updates (i\. e\. toolbar and menu rebuilds)

See Also:
Constant Field Values

GER

static final java.lang.String GER
Event name for global enviroment updates (i\. e\. toolbar and menu rebuilds)

See Also:
Constant Field Values
Method Detail

pluginShown

void pluginShown()
Called after the plugin has been displayed.


pluginHidden

void pluginHidden()
Called after the plugin has been hidden.


getPluginPanel

PluginPanel getPluginPanel()
Gets the panel that holds the title bar of the plugin and the content panel.


getPluginComponent

javax.swing.JComponent getPluginComponent()
Gets the component this plugin contains.

Returns:
The content pane

getPluginFocusComponent

java.awt.Component getPluginFocusComponent()
Returns the focus component of this plugin, i\.e\. the component that is to initially receive the focus.

Returns:
The return value defaults to the first component below the content pane of the plugin. If this component is a scroll pane, the method returns the view component of the pane.

setPluginHolder

void setPluginHolder(PluginHolder holder)
Sets the holder of this plugin.

Parameters:
holder - The plugin holder

getPluginHolder

PluginHolder getPluginHolder()
Returns the holder of this plugin.

Returns:
The plugin holder

getPage

JaspiraPage getPage()
Returns the page level parent plugin of this plugin.

Returns:
The page that holds this plugin or null

getToolbarType

int getToolbarType()
Gets the type of the plugin toolbar. This will determine how the toolbar of the plugin will be constructed.

Returns:
TOOLBAR_NONE/TOOLBAR_EVENTS/TOOLBAR_DYNAMIC
The default is TOOLBAR_EVENTS

hasCloseButton

boolean hasCloseButton()
Returns true if the plugin should have a close button in its title bar. Override this method to customize the plugin.


getSizeBehavior

int getSizeBehavior()
Returns the behavior of the plugin size. Override this method if you want to constrain the sizing of the plugin.

Returns:
SIZE_VARIABLE_NONE/SIZE_VARIABLE_WIDTH/SIZE_VARIABLE_HEIGHT/SIZE_VARIABLE_BOTH

postPluginContainerUpdate

void postPluginContainerUpdate(boolean fullRebuild)
Posts an update request of the plugin's container.

Parameters:
fullRebuild - true Causes a full container update including menu and toolbar rebuild
false Updates the container title only

updatePluginContainer

void updatePluginContainer(boolean fullRebuild)
Forces the container of this plugin to rebuild its environment.

Parameters:
fullRebuild - true Causes a full container environment including menu and toolbar rebuild
false Updates the container title only

createToolbar

JaspiraToolbar createToolbar()
Creates the toolbar of this plugin. The toolbar will be constructed according to the return value of the getToolbarType() method. If you want to construct your own custom toolbar, override this method.

Returns:
The toolbar or null if the plugin does not have a toolbar

showPlugin

void showPlugin(boolean changePage)
Brings the plugin to the front, but does not request the focus.

Parameters:
changePage - true Shows the JaspiraPage this container belongs to if it not the active page.
false Do not flip pages.

isPluginVisible

boolean isPluginVisible()
Checks if the plugin is currently visible.


focusPlugin

void focusPlugin()
Requests the focus for this plugin from the plugin manager and brings it to the front. The focus is being set to the focus component (getPluginFocusComponent()) of the plugin or to the plugin's component.


isPluginFocused

boolean isPluginFocused()
Checks if the plugin is currently focused.


addPluginFocusListener

void addPluginFocusListener(java.awt.event.FocusListener listener)
Adds a focus listener to the plugin.

Parameters:
listener - Listener to add.
The listener will not be added if already present.

removePluginFocusListener

void removePluginFocusListener(java.awt.event.FocusListener listener)
Removes the focus listener from the plugin.

Parameters:
listener - Listener to remove

firePluginFocusGained

void firePluginFocusGained()
Fires a 'focus gained event' to the focus listeners of the plugin.


firePluginFocusLost

void firePluginFocusLost()
Fires a 'focus gained event' to the focus listeners of the plugin.


getSubClients

java.util.List getSubClients()
Gets the sub clients of this drop client.

Returns:
A list of InteractionClient objects or null if this plugin doesn't have sub drop clients

canDrag

boolean canDrag()
Checks if the plugin can be dragged.


canCopy

boolean canCopy()
Checks if the plugin can copy the selected data to the clipboard.

Returns:
true if the plugin can provide clipboard data.

canCut

boolean canCut()
Checks if the plugin can cut the selected data to the clipboard.

Returns:
true if the plugin can provide clipboard data that can be deleted.

canDelete

boolean canDelete()
Checks if the plugin can delete the selected data.

Returns:
If the data can be deleted.

canPaste

boolean canPaste(java.awt.datatransfer.Transferable transferable)
Checks if the plugin can paste the data of the given transferable object.

Returns:
true if the plugin accepts the given transferable.

copy

java.awt.datatransfer.Transferable copy()
Copies the selected data from the plugin to the clipboard.

Returns:
The copied data

cut

java.awt.datatransfer.Transferable cut()
Cuts the selected data from the plugin to the clipboard.

Returns:
The copied data

paste

void paste(java.awt.datatransfer.Transferable transferable)
Pastes the given data into the plugin.

Parameters:
transferable - Content to paste

delete

void delete()
Deletes the selected data, if any.



Copyright © 2011. All Rights Reserved.