JBframe by OOIT.com

com.ooit.jbframe
Class JBDefaultAdapter

java.lang.Object
  |
  +--com.ooit.jbframe.JBDefaultAdapter

public class JBDefaultAdapter
extends java.lang.Object
implements JBAdapter

This class implements the JBAdapter interface and adds some more functionality.

All get-function of the interface have also a set-function.

The setting of the tool bar actions creates a new JToolBar.


Field Summary
protected  javax.swing.Action discardAction
           
protected  javax.swing.JComponent displayComponent
           
protected  javax.swing.Action hideAction
           
protected  javax.swing.Icon icon
           
protected  javax.swing.JMenu[] menus
           
protected  java.lang.String nodeLabel
           
protected  JBAdapter parent
           
protected  javax.swing.Action showAction
           
protected  javax.swing.JComponent subNavigator
           
protected  javax.swing.JToolBar toolbar
           
protected  javax.swing.Action[] toolbarActions
           
 
Constructor Summary
JBDefaultAdapter()
           
JBDefaultAdapter(JBAdapter parent, java.lang.String nodeLabel, javax.swing.JMenu[] menus, javax.swing.Action[] toolbarActions, javax.swing.JComponent displayComponent, javax.swing.Action showAction, javax.swing.Action hideAction, javax.swing.Action discardAction)
           
 
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.
 void setDiscardAction(javax.swing.Action discardAction)
           
 void setDisplayComponent(javax.swing.JComponent displayComponent)
           
 void setHideAction(javax.swing.Action hideAction)
           
 void setIcon(javax.swing.Icon icon)
           
 void setLabel(java.lang.String nodeLabel)
           
 void setMenus(javax.swing.JMenu[] menus)
           
 void setParent(JBAdapter parent)
           
 void setShowAction(javax.swing.Action showAction)
           
 void setSubNavigator(javax.swing.JComponent subNavigator)
           
 void setToolBar(javax.swing.JToolBar toolbar)
           
 void setToolBarActions(javax.swing.Action[] toolbarActions)
          Setting the toolbar action and creating the toolbar component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected JBAdapter parent

nodeLabel

protected java.lang.String nodeLabel

menus

protected javax.swing.JMenu[] menus

toolbar

protected javax.swing.JToolBar toolbar

toolbarActions

protected javax.swing.Action[] toolbarActions

displayComponent

protected javax.swing.JComponent displayComponent

subNavigator

protected javax.swing.JComponent subNavigator

showAction

protected javax.swing.Action showAction

hideAction

protected javax.swing.Action hideAction

discardAction

protected javax.swing.Action discardAction

icon

protected javax.swing.Icon icon
Constructor Detail

JBDefaultAdapter

public JBDefaultAdapter()

JBDefaultAdapter

public JBDefaultAdapter(JBAdapter parent,
                        java.lang.String nodeLabel,
                        javax.swing.JMenu[] menus,
                        javax.swing.Action[] toolbarActions,
                        javax.swing.JComponent displayComponent,
                        javax.swing.Action showAction,
                        javax.swing.Action hideAction,
                        javax.swing.Action discardAction)
Method Detail

setShowAction

public void setShowAction(javax.swing.Action showAction)

getShowAction

public javax.swing.Action getShowAction()
Description copied from interface: JBAdapter
Action of which the callback method is called when just before the display component is shown.
Specified by:
getShowAction in interface JBAdapter
Tags copied from interface: JBAdapter
Returns:
action object called before component is shown.

setHideAction

public void setHideAction(javax.swing.Action hideAction)

getHideAction

public javax.swing.Action getHideAction()
Description copied from interface: JBAdapter
Action of which the callback method is called just before the display component is hidden.
Specified by:
getHideAction in interface JBAdapter
Tags copied from interface: JBAdapter
Returns:
action object whose callback methode is called before hiding the component.

setDiscardAction

public void setDiscardAction(javax.swing.Action discardAction)

getDiscardAction

public javax.swing.Action getDiscardAction()
Description copied from interface: JBAdapter
Action of which the callback method is called just before the display component is discarded.
Specified by:
getDiscardAction in interface JBAdapter
Tags copied from interface: JBAdapter
Returns:
action object whose callback methode is called before discarding the component and adapter for good.

setToolBarActions

public void setToolBarActions(javax.swing.Action[] toolbarActions)
Setting the toolbar action and creating the toolbar component.

getToolBarActions

public javax.swing.Action[] getToolBarActions()
Description copied from interface: JBAdapter
Getting the actions for a toolbar. Convenience method to getToolbar().
Specified by:
getToolBarActions in interface JBAdapter
Tags copied from interface: JBAdapter
Returns:
toolbar actions.

setToolBar

public void setToolBar(javax.swing.JToolBar toolbar)

getToolBar

public javax.swing.JToolBar getToolBar()
Description copied from interface: JBAdapter
Getting the toolbar of the adapter.
Specified by:
getToolBar in interface JBAdapter
Tags copied from interface: JBAdapter
Returns:
the toolbar of the adapter.

setMenus

public void setMenus(javax.swing.JMenu[] menus)

getMenus

public javax.swing.JMenu[] getMenus()
Description copied from interface: JBAdapter
Getting the menus of the adapter.
Specified by:
getMenus in interface JBAdapter
Tags copied from interface: JBAdapter
Returns:
the menus of the adapter.

setDisplayComponent

public void setDisplayComponent(javax.swing.JComponent displayComponent)

getDisplayComponent

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

setLabel

public void setLabel(java.lang.String nodeLabel)

getLabel

public java.lang.String getLabel()
Description copied from interface: JBAdapter
Label for display in the node.
Specified by:
getLabel in interface JBAdapter
Tags copied from interface: JBAdapter
Returns:
display name in the node.

setIcon

public void setIcon(javax.swing.Icon icon)

getIcon

public javax.swing.Icon getIcon()
Description copied from interface: JBAdapter
Icon for display in the navigation node.
Specified by:
getIcon in interface JBAdapter
Tags copied from interface: JBAdapter
Returns:
icon for the navigation.

setParent

public void setParent(JBAdapter parent)

getParent

public JBAdapter getParent()
Description copied from interface: JBAdapter
The parent of this adapter. It will be used for displaying this adapater as a sub node of the parent adapter.
Specified by:
getParent in interface JBAdapter
Tags copied from interface: JBAdapter
Returns:
the parent of the adapter.

getSubNavigator

public javax.swing.JComponent getSubNavigator()
Description copied from interface: JBAdapter
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.
Specified by:
getSubNavigator in interface JBAdapter
Tags copied from interface: JBAdapter
Returns:
a navigational component which helps to navigate inside a adapter area/bean.

setSubNavigator

public void setSubNavigator(javax.swing.JComponent subNavigator)

JBframe by OOIT.com