org.araneaframework.uilib.tab
Interface TabContainerContext.TabSwitchListener

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultTabSwitchListener
Enclosing interface:
TabContainerContext

public static interface TabContainerContext.TabSwitchListener
extends Serializable

An interface for tab switch listeners. Tab switch occurs when the currently selected tab changes.

Since:
1.2.2
Author:
Martti Tamm (martti at araneaframework dot org)

Method Summary
 boolean onSwitch(TabWidget selectedTab, TabWidget newTab, org.apache.commons.collections.Closure switchClosure)
          A listener for tab switching.
 

Method Detail

onSwitch

boolean onSwitch(TabWidget selectedTab,
                 TabWidget newTab,
                 org.apache.commons.collections.Closure switchClosure)
A listener for tab switching. Before the selected tab will be replaced with a new one, this method is called to check whether the switch is allowed. Note that the selectedTab parameter may be null if no tab is currently selected.

The last parameter is a tab switch closure that is executed only when the listener returns true or when the listener executes it itself. Therefore, this closure can also be used with ConfirmationContext.confirm(Closure, String).

Parameters:
selectedTab - The currently selected tab. May be null.
newTab - The tab that will replace the current one.
switchClosure - A closure that handles tab switch.
Returns:
true, if the switch is allowed.