V
- The specific type of the View
. Must implement TabPanel
.Proxy_
- The specific type of the Proxy
.public abstract class TabContainerPresenter<V extends View & TabPanel,Proxy_ extends Proxy<?>> extends Presenter<V,Proxy_>
Presenter
that can display many tabs and the content of one of these tabs.
Note that this presenter is only meant to be used when the content are themselves
Presenter
, if they are PresenterWidget
then no special mechanism is
required and you can rely on a standard widget.
Classes extending TabContainerPresenter
must declare one constant of type
Type<RequestTabsHandler>
and annotate it with RequestTabs
.
For example:
@RequestTabs public static final Type<RequestTabsHandler> SLOT_RequestTabs = new Type<RequestTabsHandler>();
Presenter
meant to appear within a TabContainerPresenter
main
content area should be associated to a
TabContentProxy
or a TabContentProxyPlace
.Presenter.RevealType
Constructor and Description |
---|
TabContainerPresenter(EventBus eventBus,
V view,
Proxy_ proxy,
Object tabContentSlot,
GwtEvent.Type<RequestTabsHandler> requestTabsEventType)
Creates a
TabContainerPresenter that uses automatic binding. |
TabContainerPresenter(EventBus eventBus,
V view,
Proxy_ proxy,
Object tabContentSlot,
GwtEvent.Type<RequestTabsHandler> requestTabsEventType,
GwtEvent.Type<ChangeTabHandler> changeTabType,
GwtEvent.Type<RevealContentHandler<?>> slot)
Creates a
TabContainerPresenter that uses automatic binding. |
TabContainerPresenter(EventBus eventBus,
V view,
Proxy_ proxy,
Object tabContentSlot,
GwtEvent.Type<RequestTabsHandler> requestTabsEventType,
GwtEvent.Type<ChangeTabHandler> changeTabType,
Presenter.RevealType revealType)
Creates a
TabContainerPresenter that uses automatic binding. |
TabContainerPresenter(EventBus eventBus,
V view,
Proxy_ proxy,
Object tabContentSlot,
GwtEvent.Type<RequestTabsHandler> requestTabsEventType,
GwtEvent.Type<ChangeTabHandler> changeTabType,
Presenter.RevealType revealType,
GwtEvent.Type<RevealContentHandler<?>> slot)
Creates a
TabContainerPresenter that uses automatic binding. |
TabContainerPresenter(EventBus eventBus,
V view,
Proxy_ proxy,
Object tabContentSlot,
GwtEvent.Type<RequestTabsHandler> requestTabsEventType,
GwtEvent.Type<RevealContentHandler<?>> slot)
Creates a
TabContainerPresenter that uses automatic binding. |
TabContainerPresenter(EventBus eventBus,
V view,
Proxy_ proxy,
Object tabContentSlot,
GwtEvent.Type<RequestTabsHandler> requestTabsEventType,
Presenter.RevealType revealType)
Creates a
TabContainerPresenter that uses automatic binding. |
Modifier and Type | Method and Description |
---|---|
Tab |
addTab(TabContentProxy<?> tabProxy)
Adds a new tab to this presenter.
|
protected void |
onBind()
Lifecycle method called when binding the object.
|
protected void |
onUnbind()
Lifecycle method called when unbinding the object.
|
void |
setInSlot(Object slot,
PresenterWidget<?> content)
This method sets some content in a specific slot of the
Presenter . |
bind, forceReveal, getProxy, getRevealType, getSlot, prepareFromRequest, revealInParent, setRevealType, setSlot, unbind, useManualReveal
addHandler, addRegisteredHandler, addToPopupSlot, addToPopupSlot, addToSlot, addVisibleHandler, asWidget, clearSlot, fireEvent, getEventBus, getView, getWidget, isVisible, onHide, onReset, onReveal, removeFromPopupSlot, removeFromSlot, setInSlot
isBound, registerHandler
public TabContainerPresenter(EventBus eventBus, V view, Proxy_ proxy, Object tabContentSlot, GwtEvent.Type<RequestTabsHandler> requestTabsEventType, GwtEvent.Type<ChangeTabHandler> changeTabType, Presenter.RevealType revealType)
TabContainerPresenter
that uses automatic binding. This will
only work when instantiating this object using Guice/GIN dependency injection.
See HandlerContainerImpl.HandlerContainerImpl()
for more details on
automatic binding.eventBus
- The EventBus
.view
- The View
.proxy
- The Proxy
.tabContentSlot
- An opaque object identifying the slot in which the
main content should be displayed.requestTabsEventType
- The GwtEvent.Type
of the object to fire to
identify all the displayed tabs.revealType
- The RevealType
.public TabContainerPresenter(EventBus eventBus, V view, Proxy_ proxy, Object tabContentSlot, GwtEvent.Type<RequestTabsHandler> requestTabsEventType, GwtEvent.Type<ChangeTabHandler> changeTabType, GwtEvent.Type<RevealContentHandler<?>> slot)
TabContainerPresenter
that uses automatic binding. This will
only work when instantiating this object using Guice/GIN dependency injection.
See HandlerContainerImpl.HandlerContainerImpl()
for more details on
automatic binding.eventBus
- The EventBus
.view
- The View
.proxy
- The Proxy
.tabContentSlot
- An opaque object identifying the slot in which the
main content should be displayed.requestTabsEventType
- The GwtEvent.Type
of the object to fire to
identify all the displayed tabs.slot
- The slot where to reveal this presenter see .GwtEvent.Type
and RevealContentHandler
.public TabContainerPresenter(EventBus eventBus, V view, Proxy_ proxy, Object tabContentSlot, GwtEvent.Type<RequestTabsHandler> requestTabsEventType, GwtEvent.Type<ChangeTabHandler> changeTabType, Presenter.RevealType revealType, GwtEvent.Type<RevealContentHandler<?>> slot)
TabContainerPresenter
that uses automatic binding. This will
only work when instantiating this object using Guice/GIN dependency injection.
See HandlerContainerImpl.HandlerContainerImpl()
for more details on
automatic binding.eventBus
- The EventBus
.view
- The View
.proxy
- The Proxy
.tabContentSlot
- An opaque object identifying the slot in which the
main content should be displayed.requestTabsEventType
- The GwtEvent.Type
of the object to fire to
identify all the displayed tabs.revealType
- The RevealType
.slot
- The slot where to reveal this presenter see .GwtEvent.Type
and RevealContentHandler
.public TabContainerPresenter(EventBus eventBus, V view, Proxy_ proxy, Object tabContentSlot, GwtEvent.Type<RequestTabsHandler> requestTabsEventType)
TabContainerPresenter
that uses automatic binding. This will only work when
instantiating this object using Guice/GIN dependency injection. See
HandlerContainerImpl.HandlerContainerImpl()
for more details on automatic binding.
This version of the constructor does not allow dynamically modifying the tabs after they were
created.eventBus
- The EventBus
.view
- The View
.proxy
- The Proxy
.tabContentSlot
- An opaque object identifying the slot in which the
main content should be displayed.requestTabsEventType
- The GwtEvent.Type
of the object to fire to
identify all the displayed tabs.public TabContainerPresenter(EventBus eventBus, V view, Proxy_ proxy, Object tabContentSlot, GwtEvent.Type<RequestTabsHandler> requestTabsEventType, Presenter.RevealType revealType)
TabContainerPresenter
that uses automatic binding. This will only work when
instantiating this object using Guice/GIN dependency injection. See
HandlerContainerImpl.HandlerContainerImpl()
for more details on automatic binding.
This version of the constructor does not allow dynamically modifying the tabs after they were
created.eventBus
- The EventBus
.view
- The View
.proxy
- The Proxy
.tabContentSlot
- An opaque object identifying the slot in which the
main content should be displayed.requestTabsEventType
- The GwtEvent.Type
of the object to fire to
identify all the displayed tabs.revealType
- The RevealType
.public TabContainerPresenter(EventBus eventBus, V view, Proxy_ proxy, Object tabContentSlot, GwtEvent.Type<RequestTabsHandler> requestTabsEventType, GwtEvent.Type<RevealContentHandler<?>> slot)
TabContainerPresenter
that uses automatic binding. This will only work when
instantiating this object using Guice/GIN dependency injection. See
HandlerContainerImpl.HandlerContainerImpl()
for more details on automatic binding.
This version of the constructor does not allow dynamically modifying the tabs after they were
created.eventBus
- The EventBus
.view
- The View
.proxy
- The Proxy
.tabContentSlot
- An opaque object identifying the slot in which the
main content should be displayed.requestTabsEventType
- The GwtEvent.Type
of the object to fire to
identify all the displayed tabs.slot
- The slot where to reveal this presenter see .GwtEvent.Type
and RevealContentHandler
.public Tab addTab(TabContentProxy<?> tabProxy)
TabContentProxy
in response to a RequestTabsEvent
.tabProxy
- The TabContentProxy
containing information on the tab to add.Tab
.public void setInSlot(Object slot, PresenterWidget<?> content)
HasSlots
Presenter
.
A ResetPresentersEvent
will be fired
after the top-most visible presenter is revealed, resulting in a call to
PresenterWidget.onReset()
.
For more details on slots, see HasSlots
.setInSlot
in interface HasSlots
setInSlot
in class PresenterWidget<V extends View & TabPanel>
slot
- An opaque object identifying which slot this content is being
set into. The attached view should know what to do with this slot.content
- The content, a PresenterWidget
. Passing null
will clear the slot.protected void onBind()
HandlerContainerImpl
HandlerContainerImpl.onBind()
. Also, do
not call directly, call HandlerContainerImpl.bind()
instead.
Any event handler should be
initialised here rather than in the constructor. Also, it is good practice to
perform any costly initialisation here.
Handlers registered by calling
HandlerContainerImpl.registerHandler(HandlerRegistration)
will be removed
when unbinding. Any other initialisation that takes place here (or as a
side-effect of what is done here) should be taken down in HandlerContainerImpl.onUnbind()
.
This method will never be invoked more then once, or if it is, the second
time will necessarily be preceded by an invocation of HandlerContainerImpl.onUnbind()
.onBind
in class HandlerContainerImpl
protected void onUnbind()
HandlerContainerImpl
HandlerContainerImpl.onUnbind()
.
Also, do not call directly, call HandlerContainerImpl.unbind()
instead.
Any handler registration recorded with (HandlerRegistration)
will have
already been removed at this point. You should override this method to
take down any other initialisation that took place in HandlerContainerImpl.onBind()
.
This method will never be invoked more then once, or if it is, the second
time will necessarily be preceded by an invocation of HandlerContainerImpl.onBind()
.onUnbind
in class HandlerContainerImpl
Copyright © 2010–2014 Arcbees. All rights reserved.