Class
zebkit.ui.StatePan
extends <zebkit.ui.ViewPan> |
<zebkit.ui> |
State panel class. The class is UI component that allows to customize the component face, background and border depending on the component state. Number and names of states the component can have is defined by developers. To bind a view to the specified state use zebkit.draw.ViewSet class. For instance if a component has to support two states : "state1" and "state2" you can do it as following:
// create state component
var p = new zebkit.ui.StatePan();
// define border view that contains views for "state1" and "state2"
p.setBorder({
"state1": new zebkit.draw.Border("red", 1),
"state2": new zebkit.draw.Border("blue", 2)
});
// define background view that contains views for "state1" and "state2"
p.setBackground({
"state1": "yellow",
"state2": "green"
});
// set component state
p.setState("state1");
State component children components can listening when the state of the component has been updated by implementing "parentStateUpdated(o,n,id)" method. It gets old state, new state and a view id that is mapped to the new state. The feature is useful if we are developing a composite components whose children component also should react to a state changing.
zebkit.ui.StatePan
(
)
public | void | setState (s) |
public | void | stateUpdated (o, n) |
protected
|
void | syncState ( ) |
public | <String> | toViewId (s) |












