class org.aswing.AbstractTabbedPane extends Container
Sub classes | ||||||
JAccordion, JTabbedPane |
|
An abstract class for all Container pane class that have title, icon, tip for every sub pane.
For example JAccordion
, JTabbedPane
.
@author paling
Show Events | Hide Events
|
Class Fields
Instance Fields
The horizontal alignment of the icon and text.
One of the following values:
AsWingConstants.RIGHT
(the default)AsWingConstants.LEFT
AsWingConstants.CENTER
var horizontalTextPosition:Int
The horizontal position of the text relative to the icon.
AsWingConstants.RIGHT
(the default)AsWingConstants.LEFT
AsWingConstants.CENTER
var iconTextGap:Int
If both the icon and text properties are set, this property defines the space between them.
The default value of this property is 4 pixels.
var verticalAlignment:Int
The vertical alignment of the icon and text.
One of the following values:
AsWingConstants.CENTER
(the default)AsWingConstants.TOP
AsWingConstants.BOTTOM
The vertical position of the text relative to the icon.
One of the following values:
AsWingConstants.CENTER
(the default)AsWingConstants.TOP
AsWingConstants.BOTTOM
function addStateListener(listener:Dynamic ->Void?priority:Int = 0, ?useWeakReference:Bool = false): Void
Adds a listener to listen the tab selection change event. @see org.aswing.event.InteractiveEvent#STATE_CHANGED
listener | the listener |
priority | the priority |
useWeakReference | Determines whether the reference to the listener is strong or weak. |
function append(com:Component, ?constraints:Dynamic = null): Void
Adds a component to the tabbedpane.
If constraints is a String or an Icon or an Object(object.toString() as a title),
it will be used for the tab title,
otherwise the component's name will be used as the tab title.
Shortcut of insert(-1, com, constraints)
.
@see Container#append()
@see #insert()
@see #insertTab()
com | the component to be displayed when this tab is clicked |
constraints | the object to be displayed in the tab |
function appendTab(com:Component, ?title:String = '', ?icon:Icon = null, ?tip:String = null): Void
Adds a component and tip represented by a title and/or icon, either of which can be null.
Shortcut of insertTab(-1, com, title, icon, tip)
com | The component to be displayed when this tab is clicked |
title | the title to be displayed in this tab |
icon | the icon to be displayed in this tab |
tip | the tooltip to be displayed for this tab, can be null means no tool tip. |
function getIconAt(i:Int): Icon
Returns the tab icon at specified index.
i | the index |
returns | the tab icon |
function getTipAt(i:Int): String
Returns the tab tool tip text at specified index.
i | the index |
returns | the tab tool tip text |
function getTitleAt(i:Int): String
Returns the tab title at specified index.
i | the index |
returns | the tab title |
function indexOfIcon(icon:Icon): Int
Returns the first tab index with a given icon, or -1 if no tab has this icon.
title | the title for the tab |
returns | the first tab index which matches icon, or -1 if no tab has this icon |
function indexOfTip(tip:String): Int
Returns the first tab index with a given tip, or -1 if no tab has this tip.
title | the title for the tab |
returns | the first tab index which matches tip, or -1 if no tab has this tip |
function indexOfTitle(title:String): Int
Returns the first tab index with a given title, or -1 if no tab has this title.
title | the title for the tab |
returns | the first tab index which matches title, or -1 if no tab has this title |
function insert(i:Int, com:Component, ?constraints:Dynamic = null): Void
Adds a component to the tabbedpane with spesified index. If constraints is a String or an Icon or an Object(object.toString() as a title), it will be used for the tab title, otherwise the component's name will be used as the tab title. Cover method for insertTab. @see Container#insert() @see #insertTab()
i | index the position at which to insert the component, or less than 0 value to append the component to the end |
com | the component to be added |
constraints | the object to be displayed in the tab |
function insertTab(i:Int, com:Component, ?title:String = '', ?icon:Icon = null, ?tip:String = null): Void
Inserts a component, at index, represented by a title and/or icon, either of which may be null.
i | the index position to insert this new tab, less than 0 means append to the end. |
com | The component to be displayed when this tab is clicked |
title | the title to be displayed in this tab |
icon | the icon to be displayed in this tab |
tip | the tooltip to be displayed for this tab, can be null means no tool tip. |
function isEnabledAt(index:Int): Bool
Returns whether or not the tab at index is currently enabled. false will be returned if there is no tab at that index.
index | the index of the item being queried |
returns | if the tab at index is enabled; false otherwise. |
function isVisibleAt(index:Int): Bool
Returns whether or not the tab at index is currently visible. false will be returned if there is no tab at that index.
index | the index of the item being queried |
returns | if the tab at index is visible; false otherwise. |
function removeStateListener(listener:Dynamic ->Void): Void
Removes a state listener. @see org.aswing.event.InteractiveEvent#STATE_CHANGED
listener | the listener to be removed. |
function removeTabAt(i:Int): Component
Removes the specified child component. After the component is removed, its visibility is reset to true to ensure it will be visible if added to other containers.
i | the index of component. |
returns | the component just removed, or null there is not component at this position. |
function setEnabledAt(index:Int, enabled:Bool): Void
Sets whether or not the tab at index is enabled. Nothing will happen if there is no tab at that index.
index | the tab index which should be enabled/disabled |
enabled | whether or not the tab should be enabled |
function setIconAt(i:Int, icon:Icon): Void
Sets the icon at index to tab icon which can be null. Nothing will happen if there is no tab at that index.
i | the index |
icon | the tab icon |
function setIconTextGap(iconTextGap:Int): Void
If both the icon and text properties are set, this property defines the space between them.
The default value of this property is 4 pixels.
@see #getIconTextGap()
function setSelectedComponent(com:Component, ?programmatic:Bool = true): Void
Sets the selected component for this tabbedpane. This
will automatically set the selectedIndex
to the index
corresponding to the specified component.
@see #getSelectedComponent()
com | the component to be selected |
programmatic | indicate if this is a programmatic change. |
function setSelectedIndex(i:Int, ?programmatic:Bool = true): Void
Sets the selected index for this tabbedpane. The index must be a valid tab index or -1, which indicates that no tab should be selected (can also be used when there are no tabs in the tabbedpane). If a -1 value is specified when the tabbedpane contains one or more tabs, then the results will be implementation defined.
index | the index to be selected |
programmatic | indicate if this is a programmatic change. |
function setTipAt(i:Int, t:String): Void
Sets the tool tip at index to tab tooltip which can be null. Nothing will happen if there is no tab at that index.
i | the index |
t | the tab tool tip |
function setTitleAt(i:Int, t:String): Void
Sets the title at index to title which can be null. Nothing will happen if there is no tab at that index.
i | the index |
t | the tab title |
function setVisibleAt(index:Int, visible:Bool): Void
Sets whether or not the tab at index is visible. Nothing will happen if there is no tab at that index.
index | the tab index which should be shown/hidden |
shown | whether or not the tab should be visible |