com.sapportals.htmlb

Class TabStrip

java.lang.Object
  extended bycom.sapportals.htmlb.Component
      extended bycom.sapportals.htmlb.Container
          extended bycom.sapportals.htmlb.TabStrip

public class TabStrip
extends Container

A control similar to a JTabbedPane

Caution: Netscape 4 causes a lot of trouble with this control. If you're going to use a TabStrip and your application must (sooner or later) support/work on Netscape 4 you will have to change your application code.

Copyright 2004 SAP AG


Field Summary
static String DEFAULT_SELECTION_HANDLER
          Default Event action that is set for browsers like Netscape 4 which require server side handling for switching between tab items.
static String UI_ID
           
static int VAR_CONTENT_BEGIN
           
static int VAR_CONTENT_END
           
static int VAR_HEADBEGIN
           
static int VAR_HEADEND
           
static int VAR_HEADITEM_BEGIN
           
static int VAR_HEADITEM_END
           
static int VAR_HEADITEM_SEP
           
static int VAR_ITEM_BEGIN
           
static int VAR_ITEM_END
           
 
Fields inherited from class com.sapportals.htmlb.Container
elements
 
Constructor Summary
TabStrip(String name)
           
 
Method Summary
 TabStripItem addTab(int index)
          add a pane to the TabStrip with a given index.
 TabStripItem addTab(int index, Component headerComponent, Component bodyContent)
          add a pane to the TabStrip with a given index, header and body.
 TabStripItem addTab(int index, String title, Component bodyContent)
          add a pane to the TabStrip with a given index, title and body.
 String getAccessibilityDescription()
          get the semantical description of the component in it's applicationcontext used by screenreaders
 String getBodyHeight()
          gets the height of the body of the TabStrip
 int getCurrentIndex()
          INTERNAL USE ONLY.
 CellHAlign getHAlign()
          gets the horizontal alignment of the body content
 int getIndexPosition(int index)
           
 TabStripItem getItem(int index)
          gets a TabStripItem at the given index.
 int getItemCount()
          gets the number of panes that are contained in this TabStrip
 IndexedLinkedList getItems()
           
 int getSelection()
          gets the index of the selected pane
 String getTooltip()
           
 String getUI()
          get a identification String for the renderer that is unique across all supported components.
 CellVAlign getVAlign()
          gets the vertical alignment of the body content
 String getWidth()
          gets the width of the body of the TabStrip
protected  void initFromPageContext(IPageContext pc, String baseId)
          internal use only.
 void setAccessibilityDescription(String accessibilityDescription)
          sets the sematical description for the component in it's applicationcontext used by screenreaders
 void setBodyHeight(String height)
          sets the height of the body of the TabStrip
 void setCurrentIndex(int currentIndex)
          INTERNAL USE ONLY.
 void setHAlign(CellHAlign hAlign)
          sets the horizontal alignment of the body content
 void setSelection(int selection)
          sets the selected pane by index
 void setTooltip(String tooltip)
           
 void setVAlign(CellVAlign vAlign)
          sets the vertical alignment of the body content
 void setWidth(String width)
          sets the width of the body of the TabStrip
 
Methods inherited from class com.sapportals.htmlb.Container
addComponent, addRawText, addText, getChildCount, iterator, preRender, removeComponent, render
 
Methods inherited from class com.sapportals.htmlb.Component
getEncodedIdForForm, getId, getParent, initFromShortId, initializeFromId, isJsObjectNeeded, render, renderAsString, requiresForm, setId, setJsObjectNeeded, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UI_ID

public static final String UI_ID
See Also:
Constant Field Values

VAR_HEADBEGIN

public static final int VAR_HEADBEGIN
See Also:
Constant Field Values

VAR_HEADITEM_BEGIN

public static final int VAR_HEADITEM_BEGIN
See Also:
Constant Field Values

VAR_HEADITEM_END

public static final int VAR_HEADITEM_END
See Also:
Constant Field Values

VAR_HEADITEM_SEP

public static final int VAR_HEADITEM_SEP
See Also:
Constant Field Values

VAR_HEADEND

public static final int VAR_HEADEND
See Also:
Constant Field Values

VAR_CONTENT_BEGIN

public static final int VAR_CONTENT_BEGIN
See Also:
Constant Field Values

VAR_ITEM_BEGIN

public static final int VAR_ITEM_BEGIN
See Also:
Constant Field Values

VAR_ITEM_END

public static final int VAR_ITEM_END
See Also:
Constant Field Values

VAR_CONTENT_END

public static final int VAR_CONTENT_END
See Also:
Constant Field Values

DEFAULT_SELECTION_HANDLER

public static final String DEFAULT_SELECTION_HANDLER
Default Event action that is set for browsers like Netscape 4 which require server side handling for switching between tab items.

See Also:
Constant Field Values
Constructor Detail

TabStrip

public TabStrip(String name)
Method Detail

initFromPageContext

protected void initFromPageContext(IPageContext pc,
                                   String baseId)
internal use only. Components should override this method to analyse the parameters from the request object (via IPageContext) and set their internal data structures accordingly.

Overrides:
initFromPageContext in class Component
Parameters:
pc - the context, including the parameters
baseId - the prefix used for the component. (The result of a former RenderUtil.getIdForForm(rc, c);)

getItemCount

public int getItemCount()
gets the number of panes that are contained in this TabStrip

Returns:
the number of panes

getIndexPosition

public int getIndexPosition(int index)

getSelection

public int getSelection()
gets the index of the selected pane

Returns:
the index of the selected pane

setSelection

public void setSelection(int selection)
sets the selected pane by index

Parameters:
selection - the index of the selected pane

getBodyHeight

public String getBodyHeight()
gets the height of the body of the TabStrip

Returns:
the height

setBodyHeight

public void setBodyHeight(String height)
sets the height of the body of the TabStrip

Parameters:
height - the height

getWidth

public String getWidth()
gets the width of the body of the TabStrip

Returns:
the width

setWidth

public void setWidth(String width)
sets the width of the body of the TabStrip

Parameters:
width - the height

getVAlign

public CellVAlign getVAlign()
gets the vertical alignment of the body content

Returns:
the alignment

setVAlign

public void setVAlign(CellVAlign vAlign)
sets the vertical alignment of the body content

Parameters:
vAlign - the alignment

getHAlign

public CellHAlign getHAlign()
gets the horizontal alignment of the body content

Returns:
the alignment

setHAlign

public void setHAlign(CellHAlign hAlign)
sets the horizontal alignment of the body content

Parameters:
hAlign - the alignment

getTooltip

public String getTooltip()

setTooltip

public void setTooltip(String tooltip)

addTab

public TabStripItem addTab(int index)
add a pane to the TabStrip with a given index. If the index already existed the old pane will be replaced

Parameters:
index - the index of the pane
Returns:
a newly create TabStripItem

addTab

public TabStripItem addTab(int index,
                           String title,
                           Component bodyContent)
add a pane to the TabStrip with a given index, title and body.

If the index already existed the old pane will be replaced

Parameters:
index - the index of the pane
title - the title for the pane
bodyContent - a Component containing the body
Returns:
a newly create TabStripItem

addTab

public TabStripItem addTab(int index,
                           Component headerComponent,
                           Component bodyContent)
add a pane to the TabStrip with a given index, header and body. This method can be used if you want to use icons for the tabs.

If the index already existed the old pane will be replaced

Parameters:
index - the index of the pane
headerComponent - the header for the pane
bodyContent - a Component containing the body
Returns:
a newly create TabStripItem

getItem

public TabStripItem getItem(int index)
gets a TabStripItem at the given index. Returns null if there is no item for that index.

Parameters:
index - the index of the pane
Returns:
the TabStripItem at the index

getItems

public IndexedLinkedList getItems()

getCurrentIndex

public int getCurrentIndex()
INTERNAL USE ONLY. Application developers shouldn't use this method. It is only used internally by the rendering class.


setCurrentIndex

public void setCurrentIndex(int currentIndex)
INTERNAL USE ONLY. Application developers shouldn't use this method. It is only used internally by the rendering class.


getUI

public String getUI()
Description copied from class: Component
get a identification String for the renderer that is unique across all supported components. E.g. you could simply return the class name of the component class. The reason for using a separate method and not some internal reflection method is that you can more easily extend the functionality or your Component class without having to rewrite the view class.

Specified by:
getUI in class Component
Returns:
a unique identification string for this Component

getAccessibilityDescription

public String getAccessibilityDescription()
get the semantical description of the component in it's applicationcontext used by screenreaders

Returns:
description text

setAccessibilityDescription

public void setAccessibilityDescription(String accessibilityDescription)
sets the sematical description for the component in it's applicationcontext used by screenreaders

Parameters:
accessibilityDescription - description text
Returns:


Copyright 2006 SAP AG Complete Copyright Notice