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 Presenters.| 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
PresenterListeners. |
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, stoponPluginUnpluggedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonPluginUnpluggedprotected final java.util.List<PresenterListener> listeners
public Params getParams()
getParams in class AbstractPluginStateComponentprotected T_View getAttachedView()
View attached to this AbstractPresenter.View.protected java.util.List<PresenterListener> getListeners()
PresenterListeners.List containing the PresenterListeners.protected abstract T_View getViewPlug()
PlugInvoker as a View.protected boolean isAttached()
AbstractPresenter has an attached View.boolean.public void finish()
PresenterPresenter.public <T> T plug(java.lang.Class<?> pluginClass)
Class to PluginBus.pluginClass - A ClassObjectpublic <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)
PluginComponentPluginComponent has been plugged to given PluginBus.onPlugged in interface PluginComponentonPlugged in class AbstractPluginComponentbus - A PluginBus.public void onUnplugged(PluginBus bus)
PluginComponentPluginComponent has been unplugged from given PluginBus.onUnplugged in interface PluginComponentonUnplugged in class AbstractPluginComponentbus - A PluginBus.public void onPluginPlugged(java.lang.Object plugin)
PluginComponentPluginBus.onPluginPlugged in interface PluginComponentonPluginPlugged in class AbstractPluginComponentplugin - A plugin as a Object.protected void updateListeners(PluginBus bus)
public void onViewCreated(View view, Params inState)
ViewObserverView implementation when it is created.onViewCreated in interface ViewObserverview - A ViewinState - Params containing the initial state.public void onViewResume(View view)
ViewObserverView implementation when it is resumed,
e.g. on ViewCompatFragment#onResume().onViewResume in interface ViewObserverview - A Viewpublic void onViewStart(View view)
ViewObserverView implementation when it is started,
e.g. on ViewCompatFragment#onStart().onViewStart in interface ViewObserverview - A Viewpublic void onViewPause(View view)
ViewObserverView implementation when it is paused,
e.g. on ViewCompatFragment#onPause().onViewPause in interface ViewObserverview - A Viewpublic void onViewStop(View view)
ViewObserverView implementation when it is stopped,
e.g. on ViewCompatFragment#onStop().onViewStop in interface ViewObserverview - A Viewpublic void onViewDestroy(View view)
ViewObserverView implementation when it is destroyed,
e.g. on ViewCompatFragment#onDestroy().onViewDestroy in interface ViewObserverview - A Viewpublic DependencyScope getScope()
getScope in interface ScopeablegetScope in class ScopedObjectpublic void setScope(DependencyScope scope)
setScope in interface ScopeablesetScope in class ScopedObject