public interface HasSlots
PresenterWidget
can
be inserted.
Slots are opaque objects and can be of any type. For slots meant to hold
only PresenterWidget
s, you will usually declare an Object
constant within your presenter class:
public static final Object SLOT_RevealTopBarContent = new Object();For slots in which you want to insert
Presenter
s, you must
use a Type<RevealContentHandler<?>>
object and annotate it with
ContentSlot
:
@ContentSlot public static final Type<RevealContentHandler<?>> SLOT_RevealMainContent = new Type<RevealContentHandler<?>>();
Modifier and Type | Method and Description |
---|---|
void |
addToSlot(Object slot,
PresenterWidget<?> content)
This method adds some content in a specific slot of the
Presenter . |
void |
clearSlot(Object slot)
This method clears the content in a specific slot.
|
void |
removeFromSlot(Object slot,
PresenterWidget<?> content)
This method removes some content in a specific slot of the
Presenter . |
void |
setInSlot(Object slot,
PresenterWidget<?> content)
This method sets some content in a specific slot of the
Presenter . |
void |
setInSlot(Object slot,
PresenterWidget<?> content,
boolean performReset)
This method sets some content in a specific slot of the
Presenter . |
void addToSlot(Object slot, PresenterWidget<?> content)
Presenter
.
The attached View
should manage this slot when its
View#addToSlot(Object, com.google.gwt.user.client.ui.Widget)
is called.
Contrary to the setInSlot(java.lang.Object, com.gwtplatform.mvp.client.PresenterWidget<?>)
method, no
ResetPresentersEvent
is fired,
so PresenterWidget.onReset()
is not invoked.
For more details on slots, see HasSlots
.slot
- An opaque object identifying which slot this content is being
added into.content
- The content, a PresenterWidget
. Passing null
will not add anything.void clearSlot(Object slot)
ResetPresentersEvent
is fired.
The attached View
should manage this slot when its
View#setInSlot(Object, com.google.gwt.user.client.ui.Widget)
is called. It should also clear
the slot when the View#setInSlot(Object, com.google.gwt.user.client.ui.Widget)
method is
called with null
as a parameter.
For more details on slots, see HasSlots
.slot
- An opaque object identifying which slot to clear.void removeFromSlot(Object slot, PresenterWidget<?> content)
Presenter
. No
ResetPresentersEvent
is fired.
The attached View
should manage this slot when its
View#removeFromSlot(Object, com.google.gwt.user.client.ui.Widget)
is called.
For more details on slots, see HasSlots
.slot
- An opaque object identifying which slot this content is being
removed from.content
- The content, a PresenterWidget
. Passing null
will not remove anything.void setInSlot(Object slot, PresenterWidget<?> content)
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
.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.void setInSlot(Object slot, PresenterWidget<?> content, boolean performReset)
Presenter
.
The attached View
should manage this slot when its
View#setInSlot(Object, com.google.gwt.user.client.ui.Widget)
is called. It should also clear the
slot when the setInSlot
method is called with null
as a
parameter.
For more details on slots, see HasSlots
.slot
- An opaque object identifying which slot this content is being
set into.content
- The content, a PresenterWidget
. Passing null
will clear the slot.performReset
- Pass true
if you want a
ResetPresentersEvent
to be fired
after the content has been added and this presenter is visible, pass
false
otherwise.Copyright © 2010–2014 Arcbees. All rights reserved.