org.araneaframework.uilib.tab
Class DefaultTabSwitchListener

java.lang.Object
  extended by org.araneaframework.uilib.tab.DefaultTabSwitchListener
All Implemented Interfaces:
Serializable, TabContainerContext.TabSwitchListener

public class DefaultTabSwitchListener
extends Object
implements TabContainerContext.TabSwitchListener

A default implementation of TabContainerContext.TabSwitchListener that always allows tab switches.

Since:
1.2.2
Author:
Martti Tamm (martti at araneaframework dot org)
See Also:
Serialized Form

Constructor Summary
DefaultTabSwitchListener()
           
 
Method Summary
 boolean onSwitch(TabWidget selectedTab, TabWidget newTab, org.apache.commons.collections.Closure switchClosure)
          A listener for tab switching.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTabSwitchListener

public DefaultTabSwitchListener()
Method Detail

onSwitch

public boolean onSwitch(TabWidget selectedTab,
                        TabWidget newTab,
                        org.apache.commons.collections.Closure switchClosure)
Description copied from interface: TabContainerContext.TabSwitchListener
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).

Specified by:
onSwitch in interface TabContainerContext.TabSwitchListener
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.