本文整理汇总了Java中com.google.gwt.activity.shared.ActivityManager类的典型用法代码示例。如果您正苦于以下问题:Java ActivityManager类的具体用法?Java ActivityManager怎么用?Java ActivityManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActivityManager类属于com.google.gwt.activity.shared包,在下文中一共展示了ActivityManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onModuleLoad
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
@Override
public void onModuleLoad() {
ClientFactory clientFactory = GWT.create(ClientFactory.class);
EventBus eventBus = clientFactory.getEventBus();
PlaceController placeController = clientFactory.getPlaceController();
// Start ActivityManager for the twitter widget with our ActivityMapper
ActivityMapper activityMapper = new AppActivityMapper(clientFactory);
ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
activityManager.setDisplay(appWidget);
// Start PlaceHistoryHandler with our PlaceHistoryMapper
AppPlaceHistoryMapper historyMapper= GWT.create(AppPlaceHistoryMapper.class);
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
historyHandler.register(placeController, eventBus, defaultPlace);
RootPanel.get().add(appWidget);
// Goes to the place represented on URL else default place
historyHandler.handleCurrentHistory();
}
示例2: initDigitalObjectEditor
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
private Canvas initDigitalObjectEditor(DigitalObjectEditor childEditor, SimpleEventBus eventBus) {
childEditor.setImportView(true);
RelationDataSource relationDataSource = RelationDataSource.getInstance();
relationDataSource.addRelationChangeHandler(new RelationChangeHandler() {
@Override
public void onRelationChange(RelationChangeEvent event) {
// issue 262: isVisible seems to be always true and isAttached is always null.
// Add test isDrawn that seems to change for dettached widgets.
if (batchItemGrid.isVisible() && batchItemGrid.isDrawn()) {
updateCache();
}
}
});
ActivityManager activityManager = new ActivityManager(
new ChildActivities(childEditor), eventBus);
VLayout editorsLayout = new VLayout();
editorsLayout.addStyleName("defaultBorder");
activityManager.setDisplay(new ChildEditorDisplay(editorsLayout));
return editorsLayout;
}
示例3: EditorWorkFlow
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
public EditorWorkFlow(EventBus ebus, PlaceController placeController,
ActivityManager activityManager, Layout delegate,
PresenterFactory presenterFactory, ClientMessages i18n) {
this.presenterFactory = presenterFactory;
this.i18n = i18n;
this.ebus = (ebus != null) ? ebus : new SimpleEventBus();
// PlaceController uses delegate to ask user with blocking Window.confirm
// whether to leave the current place.
// In order to use non blocking SmartGWT dialog
// it will be necessary to override PlaceController.goto method.
this.placeController = (placeController != null) ? placeController
: new PlaceController(this.ebus);
this.activityManager = (activityManager != null) ? activityManager
: new ActivityManager(new EditorActivityMapper(), this.ebus);
this.activityManager.setDisplay(new EditorDisplay(delegate));
EditorPlaceHistoryMapper historyMapper = GWT.create(EditorPlaceHistoryMapper.class);
placeHistoryHandler = new PlaceHistoryHandler(historyMapper);
placeHistoryHandler.register(this.placeController, this.ebus, Place.NOWHERE);
}
示例4: onModuleLoad
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
/**
* This is the entry point method.
*/
public void onModuleLoad() {
ClientFactory clientFactory = GWT.create(ClientFactory.class);
EventBus eventBus = clientFactory.getEventBus();
PlaceController placeController = clientFactory.getPlaceController();
// Start ActivityManager for the main widget with our ActivityMapper
ActivityMapper activityMapper = new AppMapper(clientFactory);
ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
activityManager.setDisplay(new SimplePanel());
// Start PlaceHistoryHandler with our PlaceHistoryMapper
AppPlaceHistoryMapper historyMapper = GWT.create(AppPlaceHistoryMapper.class);
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
historyHandler.register(placeController, eventBus, defaultPlace);
// Goes to the place represented on URL else default place
historyHandler.handleCurrentHistory();
}
示例5: onModuleLoad
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
@Override
public void onModuleLoad() {
ApplicationGinjector.INSTANCE.inject(this);
R.init(colorPicker);
appActivityManager = new ActivityManager(actvityMapper, eventBus);
historyHandler = new PlaceHistoryHandler(placeHistoryMapper);
configService.getApplicationConfig(new AppAsyncCallback<UserApplicationConfig>() {
@Override
public void onSuccess(final UserApplicationConfig result) {
configProvider.setApplicationConfig(result);
onFinishedLoading();
}
});
}
示例6: onModuleLoad
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
@Override
public void onModuleLoad() {
ensureCssInjected();
ManagerClientFactory clientFactory = new DefaultManagerClientFactoryImpl();
EventBus eventBus = clientFactory.getEventBus();
PlaceController placeController = clientFactory.getPlaceController();
// Start ActivityManager for the main widget with our ActivityMapper
ActivityMapper activityMapper = new ManagerActivityMapper(clientFactory);
ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
activityManager.setDisplay(clientFactory.getLayoutView());
// Start PlaceHistoryHandler with our PlaceHistoryMapper
ManagerPlaceHistoryMapper historyMapper= GWT.create(ManagerPlaceHistoryMapper.class);
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
historyHandler.register(placeController, eventBus, defaultPlace);
RootLayoutPanel.get().add(clientFactory.getLayoutView());
historyHandler.handleCurrentHistory();
}
示例7: onModuleLoad
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
@Override
public void onModuleLoad() {
GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
public void onUncaughtException(Throwable e) {
Log.log(Level.SEVERE, e.getMessage(), e);
MaterialToast.fireToast("Unknown error, please reload application");
}
});
Theme.bundle(); // inject
workPanel = new SimplePanel();
workPanel.setSize("100%", "100%");
ActivityMapper activityMapper = new MentorActivityMapper();
ActivityManager activityManager = new ActivityManager(activityMapper, MentorBus.get());
activityManager.setDisplay(workPanel);
Element loader = Document.get().getElementById("loader");
if (loader != null)
loader.removeFromParent();
RootPanel.get().add(workPanel, 0, 0);
Places.handler().handleCurrentHistory(); // goes to the place represented on URL, else default place
}
示例8: OptionalEditor
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
private OptionalEditor(ClientMessages i18n, Layout previewContainer) {
SimpleEventBus eventBus = new SimpleEventBus();
embeddedPlaces = new PlaceController(eventBus);
DigitalObjectEditor embeddedEditor = new DigitalObjectEditor(i18n, embeddedPlaces, true);
embeddedEditor.setOptionalView(true);
ActivityManager activityManager = new ActivityManager(
new ChildActivities(embeddedEditor), eventBus);
activityManager.setDisplay(new ChildEditorDisplay(previewContainer));
}
示例9: onModuleLoad
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
public void onModuleLoad() {
AppInjector injector = GWT.create(AppInjector.class);
PlaceHistoryHandler placeHistoryHandler = injector.getPlaceHistoryHandler();
ActivityManager activityManager = injector.getActivityManager();
SimplePanel panel = new SimplePanel();
activityManager.setDisplay(panel);
RootPanel.get().add(panel);
placeHistoryHandler.handleCurrentHistory();
}
示例10: MvpController
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
protected MvpController() {
super(EventBus.get());
this.activityManager = new ActivityManager(this, EventBus.get());
this.historyHandler = new PlaceHistoryHandler(this);
this.setDefaultPlace(this.defaultPlace);
}
示例11: onModuleLoad
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
@Override
public void onModuleLoad() {
populateMenu();
// Create view container
final SimplePanel container = new SimplePanel();
container.setStyleName("container requestor-showcase-container");
RootPanel.get().add(container);
// Main Factory (Dependency Injector)
ShowcaseClientFactory clientFactory = CLIENT_FACTORY;
EventBus eventBus = clientFactory.getEventBus();
PlaceController placeController = clientFactory.getPlaceController();
// Activity-Place binding
ActivityMapper activityMapper = new ShowcaseActivityMapper();
ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
activityManager.setDisplay(container);
// Place-History binding
PlaceHistoryMapper historyMapper = new ShowcasePlaceHistoryMapper();
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
historyHandler.register(placeController, eventBus, defaultPlace);
// Add Loading widget
RootPanel.get().add(new Loading(eventBus));
// Goes to place represented on URL or default place
historyHandler.handleCurrentHistory();
}
示例12: App
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
public App(Storage storage, EventBus eventBus, PlaceController placeController,
ActivityManager activityManager, AppPlaceHistoryMapper historyMapper,
PlaceHistoryHandler historyHandler,
ReloadOnAuthenticationFailure reloadOnAuthenticationFailure, MobileWebAppShell shell) {
this.storage = storage;
this.eventBus = eventBus;
this.placeController = placeController;
this.activityManager = activityManager;
this.historyMapper = historyMapper;
this.historyHandler = historyHandler;
this.reloadOnAuthenticationFailure = reloadOnAuthenticationFailure;
this.shell = shell;
}
示例13: onModuleLoad
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
@Override
public void onModuleLoad() {
GWT.setUncaughtExceptionHandler(new DialogBoxUncaughtExceptionHandler());
ApplicationRequestFactory requestFactory = GWT
.create(ApplicationRequestFactory.class);
Logger.getLogger("").addHandler(new SimpleRemoteLogHandler());
ClientFactory clientFactory = GWT.create(ClientFactory.class);
EventBus eventBus = clientFactory.getEventBus();
PlaceController placeController = clientFactory.getPlaceController();
// Start ActivityManager for the main widget with our ActivityMapper
requestFactory.initialize(eventBus, new EventSourceRequestTransport(
eventBus));
ActivityMapper activityMapper = new AppActivityMapper(clientFactory,
requestFactory);
ActivityManager activityManager = new ActivityManager(activityMapper,
eventBus);
HasBody template = clientFactory.getTemplate();
activityManager.setDisplay(template.getBody());
// Start PlaceHistoryHandler with our PlaceHistoryMapper
AppPlaceHistoryMapper historyMapper = GWT
.create(AppPlaceHistoryMapper.class);
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(
historyMapper);
historyHandler.register(placeController, eventBus, defaultPlace);
RootLayoutPanel.get().add(template);
// Goes to the place represented on URL else default place
historyHandler.handleCurrentHistory();
}
示例14: loadApp
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
private void loadApp() {
// Show login links
Element userLinks = Document.get().getElementById(AppStyles.ID_USER_LINKS);
UListElement ul = Document.get().createULElement();
LIElement liSignedIn = Document.get().createLIElement();
LIElement liSignOut = Document.get().createLIElement();
User me = App.getAppModel().getMe();
String firstName = me.firstName;
String lastName = me.lastName;
liSignedIn.setInnerHTML("Signed in as <span class=\"nameText\">" + firstName + " " + lastName + "</span>");
liSignOut.setInnerHTML("<span class=\"listmaker-userEmail\">" + me.emailAddress + "</span>");
liSignOut.setInnerHTML("<a href=\"" + LOGOUT_URL + "\">Sign out</a>");
ul.appendChild(liSignedIn);
ul.appendChild(liSignOut);
userLinks.appendChild(ul);
//gwt-activities-and-places
ActivityMapper userActivityMapper = new UserActivityMapper();
ActivityManager userActivityManager = new ActivityManager(userActivityMapper, App.getEventBus());
userActivityManager.setDisplay(userDisplay);
ActivityMapper addNoteActivityMapper = new AddNoteActivityMapper();
ActivityManager addNoteActivityManager = new ActivityManager(addNoteActivityMapper, App.getEventBus());
addNoteActivityManager.setDisplay(addNote);
ActivityMapper navActivityMapper = new NavActivityMapper();
ActivityManager navActivityManager = new ActivityManager(navActivityMapper, App.getEventBus());
navActivityManager.setDisplay(nav);
ActivityMapper mainActivityMapper = new AppActivityMapper();
ActivityManager noteDisplayActivityManager = new ActivityManager(mainActivityMapper, App.getEventBus());
noteDisplayActivityManager.setDisplay(mainDisplay);
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(App.getPlaceHistoryMapper());
historyHandler.register(App.getClientFactory().getPlaceController(), App.getEventBus(), defaultPlace);
DOM.removeChild(RootPanel.getBodyElement(), DOM.getElementById(AppStyles.ID_SPLASH));
RootPanel.get(AppStyles.BODY_PANEL_USER_ID).add(userDisplay);
RootPanel.get(AppStyles.BODY_PANEL_TOP_ID).add(addNote);
RootPanel.get(AppStyles.BODY_PANEL_CONTENT_ID).add(mainDisplay);
RootPanel.get(AppStyles.BODY_PANEL_NAV_ID).add(nav);
historyHandler.handleCurrentHistory();
}
示例15: DigitalObjectChildrenEditor
import com.google.gwt.activity.shared.ActivityManager; //导入依赖的package包/类
public DigitalObjectChildrenEditor(ClientMessages i18n, PlaceController places, OptionalEditor preview) {
this.i18n = i18n;
this.places = places;
this.preview = preview;
this.actionSource = new ActionSource(this);
this.goDownAction = DigitalObjectNavigateAction.child(i18n, places);
relationDataSource = RelationDataSource.getInstance();
childrenListGrid = initChildrenListGrid();
this.selectionCache = SelectionCache.selector(childrenListGrid);
VLayout childrenLayout = new VLayout();
childrenLayout.setMembers(childrenListGrid);
childrenLayout.setWidth("40%");
childrenLayout.setShowResizeBar(true);
SimpleEventBus eventBus = new SimpleEventBus();
childPlaces = new PlaceController(eventBus);
childEditor = new DigitalObjectEditor(i18n, childPlaces, true);
ActivityManager activityManager = new ActivityManager(
new ChildActivities(childEditor), eventBus);
VLayout editorsLayout = new VLayout();
VLayout editorsOuterLayout = new VLayout();
// editorsLayout.setBorder("1px solid grey");
editorsLayout.addStyleName("defaultBorder");
editorsOuterLayout.setLayoutLeftMargin(4);
editorsOuterLayout.setMembers(editorsLayout);
activityManager.setDisplay(new ChildEditorDisplay(editorsLayout));
widget = new HLayout();
widget.setMembers(childrenLayout, editorsOuterLayout);
relationDataSource.addRelationChangeHandler(new RelationChangeHandler() {
@Override
public void onRelationChange(RelationChangeEvent event) {
// issue 262: isVisible seems to be always true and isAttached is always null.
// Add test isDrawn that seems to change for dettached widgets.
if (digitalObject != null && childrenListGrid.isVisible() && childrenListGrid.isDrawn()) {
String changedPid = event.getPid();
if (changedPid != null) {
Record changedRecord = childrenListGrid.getDataAsRecordList()
.find(RelationDataSource.FIELD_PID, changedPid);
if (changedRecord == null) {
// moved object(s)
// ListGrid does not remove selection of removed/moved rows
// and it does not fire selection change
// issue 246: clear selection of moved row
childrenListGrid.deselectAllRecords();
DigitalObjectCopyMetadataAction.resetSelection();
showCopySelection(new Record[0]);
return ;
}
}
final ListGridRecord[] selection = childrenListGrid.getSelectedRecords();
relationDataSource.updateCaches(digitalObject.getPid(), new BooleanCallback() {
@Override
public void execute(Boolean value) {
// refresh the copy selection as updated records are missing the copy attribute
showCopySelection(DigitalObjectCopyMetadataAction.getSelection());
// refresh the list selection
selectChildren(selection);
}
});
}
}
});
}