Package com.dassault_systemes.catjdialog

   
Class CATTabPage

 
Class Hierarchy
java.lang.Object
  |
  +-com.dassault_systemes.catjdialog.CATCallbackSource
        |
        +-com.dassault_systemes.catjdialog.CATDialog
              |
              +-com.dassault_systemes.catjdialog.CATTabPage
Class Location

Framework : CATJDialog

Module : CATJDialog

Class Description

public class CATTabPage

The tab-page graphical component.

Description:

This container lets the user switch between pages by clicking on a tab with a title. Every tab page content is a child component.

To add a tab:

  1. Create the new child component to add as a tab if it doesn't exist yet,
  2. Call addTab().

To remove a tab:

  1. Call removeTab(),
  2. You may then destroy the child component.

The application can be notified when the selected tab changes.

CATTabPage Properties:

CATTabPage Notifications:

CATTabPage Message Catalog Implicit Mappings:

Field Summary

Constructor Summary
CATTabPage(CATDialog iDialog, String iName)
Creates a tab page with the specified parent and name.

Method Summary
public void addTab(String iName)
Adds a Tab page.
public void addTabAt(String iName, int index)
Adds a Tab page at specified index.
protected boolean displayChild(CATDialog iChild)
Tries to display the given child component.
public String getSelection()
Returns the selected tab name.
public CATNotification getTabActivatedNotification()
Returns the tab activated notification.
public String getTabAt(int index)
Returns the tab name at specified index.
public int getTabCount()
Returns the number of tabs.
public Enumeration getTabs()
Returns the ordered list of tab names (String enumeration).
public String getTabTitle(String iName)
Returns the tab title.
public boolean getTabVisibility()
Determines whether tabs selector is displayed.
protected boolean isChildDisplayed(CATDialog iChild)
Determines whether the child component is displayed by this component.
public void removeAndDestroyTab(String iName)
Removes a Tab page and destroys the associated component.
public void removeAndDestroyTabAt(int index)
Removes a Tab page at specified index and destroys the associated component.
public void removeTab(String iName)
Removes a Tab page.
public void removeTabAt(int index)
Removes a Tab page at specified index Note: the related dialog isn't destroyed after this call.
public void setSelection(String iName)
Sets the selected tab name.
public void setTabs(Enumeration iNames)
Sets the ordered list of tab names (String enumeration).
public void setTabTitle(String iName, String iTitle)
Sets the tab title.
public void setTabVisibility(boolean iTabVisibility)
Shows/hides the tabs selector.


Field Detail

Constructor Detail

CATTabPage

    CATTabPage(CATDialog iDialog, String iName)

Creates a tab page with the specified parent and name.

Parameters:
iParent
The parent component.
iName
This tab page name. Here are some rules for this name:
  • It is set in the constructor, and cannot be changed afterwards.
  • The name must be unique for the parent (2 children with the same name are not allowed).
  • The name may not contain any ot the following characters: '.' (dot), ' ' (blank), '_' (underscore)

Method Detail

addTab

    public void addTab(String iName)

Adds a Tab page.

The new tab is appended to the list of tabs.
Note: the name must correspond to an existing child component name, that is not yet registered as a tab.

Parameters:
iName
The name of the child component to add as a new tab.

addTabAt

    public void addTabAt(String iName, int index)

Adds a Tab page at specified index.

The new tab is inserted into the list of tabs at given index.
Note: the name must correspond to an existing child component name, that is not yet registered as a tab.

Parameters:
iName
The name of the child component to add as a new tab.
index
The index where the new tab should be inserted.

displayChild

    protected boolean displayChild(CATDialog iChild)

Tries to display the given child component.

Parameters:
iChild
The child component to display.
Return:
the status of the attempt (true = succeeded / false = failed).

getSelection

    public String getSelection()

Returns the selected tab name.

Return:
The selected tab name (null if the tab page has no tab).

getTabActivatedNotification

    public CATNotification getTabActivatedNotification()

Returns the tab activated notification.

This notification is sent when the selected tab page changes.

Return:
the tab activated notification.

getTabAt

    public String getTabAt(int index)

Returns the tab name at specified index.

Parameters:
index
The index of the tab.
Return:
The tab name (corresponds to a child component name).

getTabCount

    public int getTabCount()

Returns the number of tabs.

Return:
The number of tabs.

getTabs

    public Enumeration getTabs()

Returns the ordered list of tab names (String enumeration).

Tab names correspond to children components names.

Return:
The ordered list of tab names (enumeration of string values).

getTabTitle

    public String getTabTitle(String iName)

Returns the tab title.

Returns the programmatic value if setTabTitle() has been called, or tries to retrieve its label from the associated message catalog file (<tabcomponent_path>.Title entry).

Parameters:
iName
A tab name.
Return:
The tab title.

getTabVisibility

    public boolean getTabVisibility()

Determines whether tabs selector is displayed.

Return:
true if the tabs selector is displayed; false if it is hidden.

isChildDisplayed

    protected boolean isChildDisplayed(CATDialog iChild)

Determines whether the child component is displayed by this component.

Parameters:
iChild
The child component to check.
Return:
true if the specified child component is displayed by this component; false otherwise.

removeAndDestroyTab

    public void removeAndDestroyTab(String iName)

Removes a Tab page and destroys the associated component.

Parameters:
iName
The name of the tab to remove.

removeAndDestroyTabAt

    public void removeAndDestroyTabAt(int index)

Removes a Tab page at specified index and destroys the associated component.

Parameters:
index
The index of the tab to remove and destroy.

removeTab

    public void removeTab(String iName)

Removes a Tab page.

Note: the name should correspond to an existing child component name, that is registered as a tab.
Note: the related dialog isn't destroyed after this call. The application should do it if required (use tabpage.getChild(iName).requestDestruction()).

Parameters:
iName
The name of the tab to remove.

removeTabAt

    public void removeTabAt(int index)

Removes a Tab page at specified index Note: the related dialog isn't destroyed after this call. The application should do it if required (use tabpage.getChild(iName).requestDestruction()).

Parameters:
index
The index of the tab to remove.

setSelection

    public void setSelection(String iName)

Sets the selected tab name.

Parameters:
iName
The tab name to select.

setTabs

    public void setTabs(Enumeration iNames)

Sets the ordered list of tab names (String enumeration).

Note: Tab names must correspond to existing children components names.

Parameters:
iNames
The ordered list of tab names (enumeration of string values, each value corresponding to an existing child component name).

setTabTitle

    public void setTabTitle(String iName, String iTitle)

Sets the tab title.

Calling this method sets programmatically the title. This should be reserved for cases where the title can only be determined by dynamic means.
The standard way of defining components messages is using CATNls catalog files (supports NLS).

Parameters:
iName
A tab name.
iTitle
The title to set.

setTabVisibility

    public void setTabVisibility(boolean iTabVisibility)

Shows/hides the tabs selector.

When hidden, the user does not see the tabs anymore. He has no way of changing tab, only the current selected tab page is displayed.

Parameters:
iTabVisibility
true to show the tabs selector; false to hide it.


Copyright © 2000, Dassault Systèmes. All rights reserved