Packagefeathers.controls
Classpublic class TabNavigatorItem
InheritanceTabNavigatorItem Inheritance Object
Implements feathers.controls.supportClasses.IScreenNavigatorItem

Product Version : Feathers 3.1.0

Data for an individual tab that will be displayed by a TabNavigator component.

See also

How to use the Feathers TabNavigator component
feathers.controls.TabNavigator


Public Properties
 PropertyDefined By
  canDispose : Boolean
[read-only] Determines if a display object returned by getScreen() can be disposed or not when a screen is no longer active.
TabNavigatorItem
  icon : DisplayObject
The optional icon to display on the tab.
TabNavigatorItem
  label : String
The label to display on the tab.
TabNavigatorItem
  properties : Object
A set of key-value pairs representing properties to be set on the screen when it is shown.
TabNavigatorItem
  screenClass : Class
A Class that may be instantiated to create a DisplayObject instance to display when the associated tab is selected.
TabNavigatorItem
  screenDisplayObject : DisplayObject
A display object to be displayed by the TabNavigator when the associted tab is selected.
TabNavigatorItem
  screenFunction : Function
A Function that may be called to return a DisplayObject instance to display when the associated tab is selected.
TabNavigatorItem
  transition : Function
A custom transition for this screen only.
TabNavigatorItem
Public Methods
 MethodDefined By
  
TabNavigatorItem(classOrFunctionOrDisplayObject:Object = null, label:String = null, icon:DisplayObject = null)
Constructor.
TabNavigatorItem
  
getScreen():DisplayObject
Returns a display object instance of this screen.
TabNavigatorItem
Property Detail
canDisposeproperty
canDispose:Boolean  [read-only]

Determines if a display object returned by getScreen() can be disposed or not when a screen is no longer active.


Implementation
    public function get canDispose():Boolean
iconproperty 
icon:DisplayObject

The optional icon to display on the tab.


Implementation
    public function get icon():DisplayObject
    public function set icon(value:DisplayObject):void
labelproperty 
label:String

The label to display on the tab.


Implementation
    public function get label():String
    public function set label(value:String):void
propertiesproperty 
properties:Object

A set of key-value pairs representing properties to be set on the screen when it is shown. A pair's key is the name of the screen's property, and a pair's value is the value to be passed to the screen's property.


Implementation
    public function get properties():Object
    public function set properties(value:Object):void
screenClassproperty 
screenClass:Class

A Class that may be instantiated to create a DisplayObject instance to display when the associated tab is selected. A new instance of the screen will be instantiated every time that it is shown by the TabNavigator. The screen's state will not be saved automatically, but it may be saved in properties, if needed.

The default value is null.


Implementation
    public function get screenClass():Class
    public function set screenClass(value:Class):void

See also

screenDisplayObjectproperty 
screenDisplayObject:DisplayObject

A display object to be displayed by the TabNavigator when the associted tab is selected. The same instance will be reused every time that it is shown by the TabNavigator. Whe the screen is hidden and shown again, its state will remain the same as when it was hidden. However, the screen will also be kept in memory even when it isn't displayed, limiting the resources that are available for other views.

Using screenClass or screenFunction instead of screenDisplayObject is the recommended best practice. In general, screenDisplayObject should only be used in rare situations where instantiating a new screen would be extremely expensive.

The default value is null.


Implementation
    public function get screenDisplayObject():DisplayObject
    public function set screenDisplayObject(value:DisplayObject):void

See also

screenFunctionproperty 
screenFunction:Function

A Function that may be called to return a DisplayObject instance to display when the associated tab is selected. A new instance of the screen will be instantiated every time that it is shown by the TabNavigator. The screen's state will not be saved automatically, but it may be saved in properties, if needed.

The default value is null.


Implementation
    public function get screenFunction():Function
    public function set screenFunction(value:Function):void

See also

transitionproperty 
transition:Function

A custom transition for this screen only. If null, the default transition defined by the TabNavigator will be used.

In the following example, the tab navigator item is given a custom transition:

item.transition = Fade.createFadeInTransition();

A number of animated transitions may be found in the feathers.motion package. However, you are not limited to only these transitions. It's possible to create custom transitions too.

A custom transition function should have the following signature:

function(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void

Either of the oldScreen and newScreen arguments may be null, but never both. The oldScreen argument will be null when the first screen is displayed or when a new screen is displayed after clearing the screen. The newScreen argument will be null when clearing the screen.

The completeCallback function must be called when the transition effect finishes. This callback indicate to the tab navigator that the transition has finished. This function has the following signature:

function(cancelTransition:Boolean = false):void

The first argument defaults to false, meaning that the transition completed successfully. In most cases, this callback may be called without arguments. If a transition is cancelled before completion (perhaps through some kind of user interaction), and the previous screen should be restored, pass true as the first argument to the callback to inform the tab navigator that the transition is cancelled.

The default value is null.


Implementation
    public function get transition():Function
    public function set transition(value:Function):void

See also

Constructor Detail
TabNavigatorItem()Constructor
public function TabNavigatorItem(classOrFunctionOrDisplayObject:Object = null, label:String = null, icon:DisplayObject = null)

Constructor.

Parameters
classOrFunctionOrDisplayObject:Object (default = null)
 
label:String (default = null)
 
icon:DisplayObject (default = null)
Method Detail
getScreen()method
public function getScreen():DisplayObject

Returns a display object instance of this screen.

Returns
DisplayObject