JBframe by OOIT.com

com.ooit.jbframe
Interface JBAdapter

All Known Implementing Classes:
JBDefaultAdapter

public interface JBAdapter

The JBAdapter class is the translater between a JAVA bean and a JBFrame implementation.

The JBAdapter provides the following hooks for the JBFrame:

  1. Callback function for letting the adapter know about show, hide and discard actions.
  2. Access to menus and toolbar which are specific for the bean.
  3. Access to the display part of the JAVA bean.
  4. Getting the parent adapter for building and removing the tree nodes in the navigation of the JBFrame
  5. Access to properties like node label or icon.

Callback functions : Action Objects

The follwing table shows the action objects which are provided by the adapter for calling back for show, hide and discard events.

Action access function Description, when the action is called back.
getShowAction() Just before the component will be shown.
getHideAction() Just before the visible component will be hidden.
getDiscardAction() Just before the visible component and the adapter are discarded from the JBFrame.
getToolBarActions() After the corresponding buttons in the toolbar have been pressed.

Access to properties needed for displaying the tree

The follwing table shows the access functions and the description when the callback method of the action is called.

Property access function Description
getLabel() Label which is used as display text in the navigation.
getIcon() Icon which is used in the navigation.
getParent() Getting the parent adapter for creating a subnode.

Access to the display part of the JAVA bean

Accessing the visible component from the adapter is done by a single function.

Visible component access Description
getDisplayComponent() Returns a subclass of JComponent which represents the display part of the JAVA bean.


Method Summary
 javax.swing.Action getDiscardAction()
          Action of which the callback method is called just before the display component is discarded.
 javax.swing.JComponent getDisplayComponent()
          The dipalay part of the JBAdaptor.
 javax.swing.Action getHideAction()
          Action of which the callback method is called just before the display component is hidden.
 javax.swing.Icon getIcon()
          Icon for display in the navigation node.
 java.lang.String getLabel()
          Label for display in the node.
 javax.swing.JMenu[] getMenus()
          Getting the menus of the adapter.
 JBAdapter getParent()
          The parent of this adapter.
 javax.swing.Action getShowAction()
          Action of which the callback method is called when just before the display component is shown.
 javax.swing.JComponent getSubNavigator()
          A adapter specific navigational component.
 javax.swing.JToolBar getToolBar()
          Getting the toolbar of the adapter.
 javax.swing.Action[] getToolBarActions()
          Getting the actions for a toolbar.
 

Method Detail

getShowAction

public javax.swing.Action getShowAction()
Action of which the callback method is called when just before the display component is shown.
Returns:
action object called before component is shown.

getHideAction

public javax.swing.Action getHideAction()
Action of which the callback method is called just before the display component is hidden.
Returns:
action object whose callback methode is called before hiding the component.

getDiscardAction

public javax.swing.Action getDiscardAction()
Action of which the callback method is called just before the display component is discarded.
Returns:
action object whose callback methode is called before discarding the component and adapter for good.

getToolBarActions

public javax.swing.Action[] getToolBarActions()
Getting the actions for a toolbar. Convenience method to getToolbar().
Returns:
toolbar actions.

getToolBar

public javax.swing.JToolBar getToolBar()
Getting the toolbar of the adapter.
Returns:
the toolbar of the adapter.

getMenus

public javax.swing.JMenu[] getMenus()
Getting the menus of the adapter.
Returns:
the menus of the adapter.

getLabel

public java.lang.String getLabel()
Label for display in the node.
Returns:
display name in the node.

getIcon

public javax.swing.Icon getIcon()
Icon for display in the navigation node.
Returns:
icon for the navigation.

getParent

public JBAdapter getParent()
The parent of this adapter. It will be used for displaying this adapater as a sub node of the parent adapter.
Returns:
the parent of the adapter.

getDisplayComponent

public javax.swing.JComponent getDisplayComponent()
The dipalay part of the JBAdaptor. Usually this is a visual JAVA bean which will appear in the working area.
Returns:
the visual part of the JBAdapter/bean.

getSubNavigator

public javax.swing.JComponent getSubNavigator()
A adapter specific navigational component. A JBFrame implementation could display this navigator below the general navigation tree or as a pop-up on right button click on the the navigator node.
Returns:
a navigational component which helps to navigate inside a adapter area/bean.

JBframe by OOIT.com