public abstract class AbstractPresenter<T_View extends View> extends AbstractPluginStateComponent implements Presenter, Scopeable
AbstractPresenter
extends AbstractListenable
to provide an abstract base class
for concrete implementations of Presenter
s.Modifier and Type | Field and Description |
---|---|
protected java.util.List<PresenterListener> |
listeners |
Modifier | Constructor and Description |
---|---|
protected |
AbstractPresenter() |
Modifier and Type | Method and Description |
---|---|
void |
finish()
Invoked to finish this
Presenter . |
protected T_View |
getAttachedView()
Gets the
View attached to this AbstractPresenter . |
static java.lang.Class<? extends Presenter> |
getInterfaceClass(Presenter presenter)
|
protected java.util.List<PresenterListener> |
getListeners()
Gets the
PresenterListener s. |
Params |
getParams() |
DependencyScope |
getScope() |
View |
getView()
|
protected abstract T_View |
getViewPlug()
|
protected ViewState |
getViewState()
|
protected boolean |
isAttached()
Tests if this
AbstractPresenter has an attached View . |
void |
onPlugged(PluginBus bus)
Invoked when this
PluginComponent has been plugged to given PluginBus . |
void |
onPluginPlugged(java.lang.Object plugin)
Invoked when the given plugin object has been plugged to
PluginBus . |
void |
onUnplugged(PluginBus bus)
Invoked when this
PluginComponent has been unplugged from given PluginBus . |
void |
onViewCreated(View view,
Params inState)
Invoked by a
View implementation when it is created. |
void |
onViewDestroy(View view)
Invoked by a
View implementation when it is destroyed,
e.g. |
void |
onViewPause(View view)
Invoked by a
View implementation when it is paused,
e.g. |
void |
onViewResume(View view)
Invoked by a
View implementation when it is resumed,
e.g. |
void |
onViewStart(View view)
Invoked by a
View implementation when it is started,
e.g. |
void |
onViewStop(View view)
Invoked by a
View implementation when it is stopped,
e.g. |
<T> T |
plug(java.lang.Class<?> pluginClass)
Plugs an instance of specific
Class to PluginBus . |
<T> T |
plug(java.lang.Object plugin)
Plugs the the given plugin
Object to this PluginBus . |
void |
setParams(Params params)
|
void |
setScope(DependencyScope scope) |
void |
unplug(java.lang.Object plugin)
Unplugs the the given plugin
Object to this PluginBus . |
protected void |
updateListeners(PluginBus bus) |
destroy, getLifecycleState, getState, isDestroyed, isPaused, isRestarted, isResumed, isStarted, isStopped, onCreate, onDestroy, onPause, onRestart, onResume, onStart, onStop, pause, restart, resume, start, start, stop
onPluginUnplugged
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onPluginUnplugged
protected final java.util.List<PresenterListener> listeners
public Params getParams()
getParams
in class AbstractPluginStateComponent
protected T_View getAttachedView()
View
attached to this AbstractPresenter
.View
.protected java.util.List<PresenterListener> getListeners()
PresenterListener
s.List
containing the PresenterListener
s.protected abstract T_View getViewPlug()
PlugInvoker
as a View
.protected boolean isAttached()
AbstractPresenter
has an attached View
.boolean
.public void finish()
Presenter
Presenter
.public <T> T plug(java.lang.Class<?> pluginClass)
Class
to PluginBus
.pluginClass
- A Class
Object
public <T> T plug(java.lang.Object plugin)
Object
to this PluginBus
.plugin
- A plugin Object
.public void unplug(java.lang.Object plugin)
Object
to this PluginBus
.plugin
- A plugin Object
.public void onPlugged(PluginBus bus)
PluginComponent
PluginComponent
has been plugged to given PluginBus
.onPlugged
in interface PluginComponent
onPlugged
in class AbstractPluginComponent
bus
- A PluginBus
.public void onUnplugged(PluginBus bus)
PluginComponent
PluginComponent
has been unplugged from given PluginBus
.onUnplugged
in interface PluginComponent
onUnplugged
in class AbstractPluginComponent
bus
- A PluginBus
.public void onPluginPlugged(java.lang.Object plugin)
PluginComponent
PluginBus
.onPluginPlugged
in interface PluginComponent
onPluginPlugged
in class AbstractPluginComponent
plugin
- A plugin as a Object
.protected void updateListeners(PluginBus bus)
public void onViewCreated(View view, Params inState)
ViewObserver
View
implementation when it is created.onViewCreated
in interface ViewObserver
view
- A View
inState
- Params
containing the initial state.public void onViewResume(View view)
ViewObserver
View
implementation when it is resumed,
e.g. on ViewCompatFragment#onResume()
.onViewResume
in interface ViewObserver
view
- A View
public void onViewStart(View view)
ViewObserver
View
implementation when it is started,
e.g. on ViewCompatFragment#onStart()
.onViewStart
in interface ViewObserver
view
- A View
public void onViewPause(View view)
ViewObserver
View
implementation when it is paused,
e.g. on ViewCompatFragment#onPause()
.onViewPause
in interface ViewObserver
view
- A View
public void onViewStop(View view)
ViewObserver
View
implementation when it is stopped,
e.g. on ViewCompatFragment#onStop()
.onViewStop
in interface ViewObserver
view
- A View
public void onViewDestroy(View view)
ViewObserver
View
implementation when it is destroyed,
e.g. on ViewCompatFragment#onDestroy()
.onViewDestroy
in interface ViewObserver
view
- A View
public DependencyScope getScope()
getScope
in interface Scopeable
getScope
in class ScopedObject
public void setScope(DependencyScope scope)
setScope
in interface Scopeable
setScope
in class ScopedObject