org.overlord.sramp.ui.client.activities
Class AbstractActivity<P extends com.google.gwt.place.shared.Place,V extends IView<?>>

java.lang.Object
  extended by com.google.gwt.activity.shared.AbstractActivity
      extended by org.overlord.sramp.ui.client.activities.AbstractActivity<P,V>
All Implemented Interfaces:
com.google.gwt.activity.shared.Activity, IActivity
Direct Known Subclasses:
ArtifactActivity, BrowseActivity, DashboardActivity

public abstract class AbstractActivity<P extends com.google.gwt.place.shared.Place,V extends IView<?>>
extends com.google.gwt.activity.shared.AbstractActivity
implements IActivity

Base class for all s-ramp-ui activities.

Author:
eric.wittmann@redhat.com

Constructor Summary
AbstractActivity(P place, IClientFactory clientFactory)
          Constructor.
 
Method Summary
protected abstract  V createView(com.google.gwt.event.shared.EventBus eventBus)
          Called to create/get the view.
protected  void doStart(com.google.gwt.user.client.ui.AcceptsOneWidget panel, com.google.gwt.event.shared.EventBus eventBus)
          Start the activity.
 IClientFactory getClientFactory()
           
 P getPlace()
           
protected
<T extends IService>
T
getService(Class<T> serviceType)
          Gets a service.
 V getView()
           
 void goTo(com.google.gwt.place.shared.Place place)
           
protected  ILocalizationService i18n()
          Convenience method for getting the localization service.
 void setClientFactory(IClientFactory clientFactory)
           
 void setPlace(P place)
           
 void setView(V view)
           
 void start(com.google.gwt.user.client.ui.AcceptsOneWidget panel, com.google.gwt.event.shared.EventBus eventBus)
           
protected abstract  void updateBreadcrumb(BreadcrumbPanel breadcrumbPanel)
          Called to update the breadcrumb panel.
 
Methods inherited from class com.google.gwt.activity.shared.AbstractActivity
mayStop, onCancel, onStop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractActivity

public AbstractActivity(P place,
                        IClientFactory clientFactory)
Constructor.

Parameters:
place -
clientFactory -
Method Detail

goTo

public void goTo(com.google.gwt.place.shared.Place place)
Specified by:
goTo in interface IActivity
See Also:
IActivity.goTo(com.google.gwt.place.shared.Place)

getPlace

public P getPlace()
Returns:
the place

setPlace

public void setPlace(P place)
Parameters:
place - the place to set

getView

public V getView()
Returns:
the view

setView

public void setView(V view)
Parameters:
view - the view to set

getClientFactory

public IClientFactory getClientFactory()
Returns:
the clientFactory

setClientFactory

public void setClientFactory(IClientFactory clientFactory)
Parameters:
clientFactory - the clientFactory to set

start

public final void start(com.google.gwt.user.client.ui.AcceptsOneWidget panel,
                        com.google.gwt.event.shared.EventBus eventBus)
Specified by:
start in interface com.google.gwt.activity.shared.Activity
See Also:
Activity.start(com.google.gwt.user.client.ui.AcceptsOneWidget, com.google.gwt.event.shared.EventBus)

updateBreadcrumb

protected abstract void updateBreadcrumb(BreadcrumbPanel breadcrumbPanel)
Called to update the breadcrumb panel. Must be implemented by subclasses.

Parameters:
breadcrumbPanel - the breadcrumb panel

createView

protected abstract V createView(com.google.gwt.event.shared.EventBus eventBus)
Called to create/get the view.

Parameters:
eventBus -

doStart

protected void doStart(com.google.gwt.user.client.ui.AcceptsOneWidget panel,
                       com.google.gwt.event.shared.EventBus eventBus)
Start the activity.

Parameters:
panel -
eventBus -

getService

protected <T extends IService> T getService(Class<T> serviceType)
                                 throws ServiceNotFoundException
Gets a service.

Parameters:
serviceType - the type of service desired
Returns:
the service
Throws:
ServiceNotFoundException

i18n

protected ILocalizationService i18n()
Convenience method for getting the localization service.



Copyright © 2012-2013 JBoss, a division of Red Hat. All Rights Reserved.