net.sf.jguiraffe.gui.platform.swing.builder.components
Class SwingTabbedPaneHandler

java.lang.Object
  extended by net.sf.jguiraffe.gui.platform.swing.builder.components.SwingComponentHandler
      extended by net.sf.jguiraffe.gui.platform.swing.builder.components.SwingTabbedPaneHandler
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ChangeListener, ComponentHandler, SwingEventSource

 class SwingTabbedPaneHandler
extends SwingComponentHandler
implements javax.swing.event.ChangeListener

A specific component handler implementation that deals with a tabbed pane object.

The data of a tabbed pane is defined as its selected index. This is an integer value. Clients can register itself as change listeners; they are then notified whenever the select index of the tabbed pane changes. Focus listeners are also supported.

Version:
$Id: SwingTabbedPaneHandler.java 69 2007-06-14 20:28:24Z oheger $
Author:
Oliver Heger

Constructor Summary
SwingTabbedPaneHandler(javax.swing.JTabbedPane pane)
          Creates a new instance of SwingTabbedPaneHandler and initializes it with the component to manage.
 
Method Summary
 java.lang.Object getData()
          Returns the data of the managed component.
 javax.swing.JTabbedPane getTabbedPane()
          Returns the tabbed pane component that is wrapped by this handler.
 java.lang.Class getType()
          Returns the data type of this handler.
protected  void registerChangeListener()
          Registers this handler as change listener at the managed component.
 void setData(java.lang.Object data)
          Sets the data of the managed component.
 void stateChanged(javax.swing.event.ChangeEvent event)
          This method gets called when the index of the selected tab changes.
protected  void unregisterChangeListener()
          Unregisteres this handler as change listener from the managed component.
 
Methods inherited from class net.sf.jguiraffe.gui.platform.swing.builder.components.SwingComponentHandler
addActionListener, addChangeListener, addFocusListener, fireChangeEvent, getComponent, getJComponent, getOuterComponent, isEnabled, removeActionListener, removeChangeListener, removeFocusListener, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingTabbedPaneHandler

public SwingTabbedPaneHandler(javax.swing.JTabbedPane pane)
Creates a new instance of SwingTabbedPaneHandler and initializes it with the component to manage.

Parameters:
pane - the managed tab pane
Method Detail

getTabbedPane

public javax.swing.JTabbedPane getTabbedPane()
Returns the tabbed pane component that is wrapped by this handler.

Returns:
the internal tabbed pane component

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent event)
This method gets called when the index of the selected tab changes. This event is sent to all registered change listeners.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener
Parameters:
event - the source event

getData

public java.lang.Object getData()
Returns the data of the managed component. This is an integer representing the index of the selected tab.

Specified by:
getData in interface ComponentHandler
Returns:
the component's data

getType

public java.lang.Class getType()
Returns the data type of this handler. In this case this is a single Integer object representing the selected index of the tab.

Specified by:
getType in interface ComponentHandler
Returns:
the data type of this handler

setData

public void setData(java.lang.Object data)
Sets the data of the managed component. This is an integer representing the index of the selected tab. So this method can be used to switch to a certain tab.

Specified by:
setData in interface ComponentHandler
Parameters:
data - the data to set

registerChangeListener

protected void registerChangeListener()
Registers this handler as change listener at the managed component.

Overrides:
registerChangeListener in class SwingComponentHandler

unregisterChangeListener

protected void unregisterChangeListener()
Unregisteres this handler as change listener from the managed component.

Overrides:
unregisterChangeListener in class SwingComponentHandler
See Also:
SwingComponentHandler.registerChangeListener()


Copyright 2007 null. All Rights Reserved.