WUI : API


org.westofj.wui
Class WTabbedPane

java.lang.Object
  extended byorg.westofj.wui.Widget
      extended byorg.westofj.wui.WTabbedPane

public class WTabbedPane
extends Widget

A widget that implements a tab control. Multiple widgets may be added to the tab widget along with associated titles. The titles are displayed as a set of tabs. Only one tab is active at at a time. The widget associated with the active tab is displayed, the other widgets are not.

Version:
$Revision: 1.7 $, $Date: 2004/05/03 00:49:24 $
Author:
bill

Constructor Summary
WTabbedPane()
          Constructs a tab pane.
 
Method Summary
 void add(WDisplayable title, Widget widget)
          Adds a widget and an associated title to the tab pane.
 void clear()
          Removes all tabs from the tab pane.
 int getSelectedTab()
          Returns the index of the selected tab.
 Widget getSelectedWidget()
          Returns the widget associated with the currently selected tab.
 int getTabCount()
          Returns the number of tabs contained within the tab pane.
 WDisplayable getTitleAt(int index)
          Returns the title of the tab at the specified index.
 Widget getWidgetAt(int index)
          Returns the widget associated with the tab at the specified index.
 int getWidth()
          Returns the width scalar value.
 WLengthUnit getWidthUnit()
          Returns the width units.
protected  void handleParams(WRunner runner, String[] values)
           
 boolean isEnabledAt(int index)
          Returns true if the tab at the specified index is enabled, false otherwise.
 void remove(int index)
          Removes the tab at the specified index from the tab pane.
 void render(WRunner runner, WRenderContext context, PrintWriter out)
          Renders the widget to the display.
 void render2(WRunner runner, WRenderContext context, PrintWriter out)
           
 void render3(WRunner runner, WRenderContext context, PrintWriter out)
           
 void setEnabledAt(int index, boolean enabled)
          Enables or disables the tab at the specified index.
 void setSelectedTab(int index)
          Sets the selected tab to the tab at the specified index.
 void setWidth(int width)
          Sets the width scalar value.
 void setWidth(int width, WLengthUnit unit)
          Sets the width scalar value.
 void setWidthUnit(WLengthUnit widthUnit)
          Sets the width units.
 
Methods inherited from class org.westofj.wui.Widget
addChangeListener, getRunner, handleNoParams, hasChangeListeners, removeChangeListener, stateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WTabbedPane

public WTabbedPane()
Constructs a tab pane.

Method Detail

getWidth

public int getWidth()
Returns the width scalar value.

Returns:
Returns the width.

setWidth

public void setWidth(int width)
Sets the width scalar value.

Parameters:
width - The width to set.

setWidth

public void setWidth(int width,
                     WLengthUnit unit)
Sets the width scalar value.

Parameters:
width - The width to set.

getWidthUnit

public WLengthUnit getWidthUnit()
Returns the width units.

Returns:
Returns the width units.

setWidthUnit

public void setWidthUnit(WLengthUnit widthUnit)
Sets the width units.

Parameters:
widthUnit - The width unit type to set.

add

public void add(WDisplayable title,
                Widget widget)
Adds a widget and an associated title to the tab pane.

Parameters:
title - the title of the tab.
widget - the widget associated with the tab.

clear

public void clear()
Removes all tabs from the tab pane.


getSelectedTab

public int getSelectedTab()
Returns the index of the selected tab.

Returns:
int the index of the selected tab.

getSelectedWidget

public Widget getSelectedWidget()
Returns the widget associated with the currently selected tab.

Returns:
Widget the widget associated with the currently selected tab.

getTabCount

public int getTabCount()
Returns the number of tabs contained within the tab pane.

Returns:
int the number of tabs contained within the tab pane.

getTitleAt

public WDisplayable getTitleAt(int index)
Returns the title of the tab at the specified index.

Parameters:
index - the index of the tab.
Returns:
WDisplayable the title of the tab at the specified index.

getWidgetAt

public Widget getWidgetAt(int index)
Returns the widget associated with the tab at the specified index.

Parameters:
index - the index of the tab.
Returns:
Widget the widget associated with the tab at the specified index.

isEnabledAt

public boolean isEnabledAt(int index)
Returns true if the tab at the specified index is enabled, false otherwise.

Parameters:
index - the index of the tab.
Returns:
boolean true if the tab at the specified index is enabled, false otherwise.

setEnabledAt

public void setEnabledAt(int index,
                         boolean enabled)
Enables or disables the tab at the specified index.

Parameters:
index - the index of the tab.
enabled - true if the tab at the specified index is enabled, false otherwise.

remove

public void remove(int index)
Removes the tab at the specified index from the tab pane.

Parameters:
index - the index of the tab.

render

public void render(WRunner runner,
                   WRenderContext context,
                   PrintWriter out)
            throws WRenderException
Description copied from class: Widget
Renders the widget to the display.

Specified by:
render in class Widget
Parameters:
runner - the current runner context.
out - the output for the display.
Throws:
WRenderException

render3

public void render3(WRunner runner,
                    WRenderContext context,
                    PrintWriter out)
             throws WRenderException
Throws:
WRenderException

render2

public void render2(WRunner runner,
                    WRenderContext context,
                    PrintWriter out)
             throws WRenderException
Throws:
WRenderException

setSelectedTab

public void setSelectedTab(int index)
Sets the selected tab to the tab at the specified index.

Parameters:
index - the index of the selected tab.

handleParams

protected void handleParams(WRunner runner,
                            String[] values)
Overrides:
handleParams in class Widget

Copyright (c) 2003 West of J - All rights reserved.