org.cruxframework.crux.widgets.client.rollingtabs
Class RollingTabPanel

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by org.cruxframework.crux.widgets.client.rollingtabs.RollingTabPanel
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.HasBeforeSelectionHandlers<Integer>, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasAnimation, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget

public class RollingTabPanel
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.user.client.ui.HasAnimation, com.google.gwt.event.logical.shared.HasBeforeSelectionHandlers<Integer>

Modified version of GWT TabPanel that uses a CustomRollingPanel wrapping its TabBar.

Author:
Thiago da Rosa de Bustamante -

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
RollingTabPanel()
          Creates an empty tab panel.
 
Method Summary
 void add(com.google.gwt.user.client.ui.Widget w, String tabText)
          Adds a widget to the tab panel.
 void add(com.google.gwt.user.client.ui.Widget w, String tabText, boolean asHTML)
          Adds a widget to the tab panel.
 void add(com.google.gwt.user.client.ui.Widget w, com.google.gwt.user.client.ui.Widget tabWidget)
          Adds a widget to the tab panel.
 com.google.gwt.event.shared.HandlerRegistration addBeforeSelectionHandler(com.google.gwt.event.logical.shared.BeforeSelectionHandler<Integer> handler)
           
 void clear()
           
 int getSelectedTab()
           
 RollingTabBar getTabBar()
           
 com.google.gwt.user.client.ui.Widget getWidget(int index)
           
 int getWidgetCount()
           
 int getWidgetIndex(com.google.gwt.user.client.ui.Widget widget)
           
 void insert(com.google.gwt.user.client.ui.Widget widget, String tabText, boolean asHTML, int beforeIndex)
          Inserts a widget into the tab panel.
 void insert(com.google.gwt.user.client.ui.Widget widget, com.google.gwt.user.client.ui.Widget tabWidget, int beforeIndex)
          Inserts a widget into the tab panel.
 boolean isAnimationEnabled()
           
protected  void onEnsureDebugId(String baseID)
          Affected Elements: -bar = The tab bar.
 boolean remove(int index)
           
 boolean remove(com.google.gwt.user.client.ui.Widget widget)
          Removes the given widget, and its associated tab.
 void selectTab(int index)
          Programmatically selects the specified tab.
 void setAnimationEnabled(boolean enable)
           
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

RollingTabPanel

public RollingTabPanel()
Creates an empty tab panel.

Method Detail

add

public void add(com.google.gwt.user.client.ui.Widget w,
                String tabText)
Adds a widget to the tab panel. If the Widget is already attached to the TabPanel, it will be moved to the right-most index.

Parameters:
w - the widget to be added
tabText - the text to be shown on its tab

add

public void add(com.google.gwt.user.client.ui.Widget w,
                String tabText,
                boolean asHTML)
Adds a widget to the tab panel. If the Widget is already attached to the TabPanel, it will be moved to the right-most index.

Parameters:
w - the widget to be added
tabText - the text to be shown on its tab
asHTML - true to treat the specified text as HTML

add

public void add(com.google.gwt.user.client.ui.Widget w,
                com.google.gwt.user.client.ui.Widget tabWidget)
Adds a widget to the tab panel. If the Widget is already attached to the InternalTabPanel, it will be moved to the right-most index.

Parameters:
w - the widget to be added
tabWidget - the widget to be shown in the tab

addBeforeSelectionHandler

public com.google.gwt.event.shared.HandlerRegistration addBeforeSelectionHandler(com.google.gwt.event.logical.shared.BeforeSelectionHandler<Integer> handler)
Specified by:
addBeforeSelectionHandler in interface com.google.gwt.event.logical.shared.HasBeforeSelectionHandlers<Integer>
See Also:
HasBeforeSelectionHandlers.addBeforeSelectionHandler(com.google.gwt.event.logical.shared.BeforeSelectionHandler)

clear

public void clear()

getWidget

public com.google.gwt.user.client.ui.Widget getWidget(int index)

getWidgetCount

public int getWidgetCount()

getWidgetIndex

public int getWidgetIndex(com.google.gwt.user.client.ui.Widget widget)

getTabBar

public RollingTabBar getTabBar()

insert

public void insert(com.google.gwt.user.client.ui.Widget widget,
                   com.google.gwt.user.client.ui.Widget tabWidget,
                   int beforeIndex)
Inserts a widget into the tab panel. If the Widget is already attached to the InternalTabPanel, it will be moved to the requested index.

Parameters:
widget - the widget to be inserted.
tabWidget - the widget to be shown on its tab.
beforeIndex - the index before which it will be inserted.

insert

public void insert(com.google.gwt.user.client.ui.Widget widget,
                   String tabText,
                   boolean asHTML,
                   int beforeIndex)
Inserts a widget into the tab panel. If the Widget is already attached to the TabPanel, it will be moved to the requested index.

Parameters:
widget - the widget to be inserted
tabText - the text to be shown on its tab
asHTML - true to treat the specified text as HTML
beforeIndex - the index before which it will be inserted

isAnimationEnabled

public boolean isAnimationEnabled()
Specified by:
isAnimationEnabled in interface com.google.gwt.user.client.ui.HasAnimation

remove

public boolean remove(int index)

remove

public boolean remove(com.google.gwt.user.client.ui.Widget widget)
Removes the given widget, and its associated tab.

Parameters:
widget - the widget to be removed

selectTab

public void selectTab(int index)
Programmatically selects the specified tab.

Parameters:
index - the index of the tab to be selected

setAnimationEnabled

public void setAnimationEnabled(boolean enable)
Specified by:
setAnimationEnabled in interface com.google.gwt.user.client.ui.HasAnimation

onEnsureDebugId

protected void onEnsureDebugId(String baseID)
Affected Elements:

Overrides:
onEnsureDebugId in class com.google.gwt.user.client.ui.UIObject
See Also:
UIObject.onEnsureDebugId(String)

getSelectedTab

public int getSelectedTab()
Returns:


Copyright © 2014. All rights reserved.