本文整理汇总了Java中com.google.gwt.activity.shared.ActivityManager.setDisplay方法的典型用法代码示例。如果您正苦于以下问题:Java ActivityManager.setDisplay方法的具体用法?Java ActivityManager.setDisplay怎么用?Java ActivityManager.setDisplay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.activity.shared.ActivityManager
的用法示例。
在下文中一共展示了ActivityManager.setDisplay方法的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: 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();
}
示例4: 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();
}
示例5: 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
}
示例6: 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));
}
示例7: 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();
}
示例8: 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();
}
示例9: 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();
}
示例10: 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();
}
示例11: 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);
}
});
}
}
});
}
示例12: init
import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
private void init() {
Utils.injectKaaStyles();
ClientFactory clientFactory = GWT.create(ClientFactory.class);
EventBus eventBus = clientFactory.getEventBus();
dataSource = new DataSource(eventBus);
ActivityMapper headerActivityMapper = new HeaderActivityMapper(clientFactory);
ActivityManager headerActivityManager = new ActivityManager(headerActivityMapper, eventBus);
headerActivityManager.setDisplay(appWidget.getAppHeaderHolder());
ActivityMapper navigationActivityMapper = new NavigationActivityMapper(
clientFactory, eventBus);
ActivityManager navigationActivityManager = new ActivityManager(
navigationActivityMapper, eventBus);
navigationActivityManager.setDisplay(appWidget.getNavContentHolder());
ActivityMapper appActivityMapper = new AppActivityMapper(clientFactory);
ActivityManager appActivityManager = new ActivityManager(appActivityMapper, eventBus);
appActivityManager.setDisplay(appWidget.getAppContentHolder());
PlaceHistoryMapper historyMapper = null;
switch (authInfo.getAuthority()) {
case KAA_ADMIN:
historyMapper = GWT.create(KaaAdminPlaceHistoryMapper.class);
clientFactory.setHomePlace(new TenantsPlace());
break;
case TENANT_ADMIN:
historyMapper = GWT.create(TenantAdminPlaceHistoryMapper.class);
clientFactory.setHomePlace(new ApplicationsPlace());
break;
case TENANT_DEVELOPER:
historyMapper = GWT.create(TenantDeveloperPlaceHistoryMapper.class);
clientFactory.setHomePlace(new ApplicationsPlace());
break;
case TENANT_USER:
historyMapper = GWT.create(TenantUserPlaceHistoryMapper.class);
clientFactory.setHomePlace(new ApplicationsPlace());
break;
default:
break;
}
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
Place place;
if (authInfo.getAuthority() == KaaAuthorityDto.KAA_ADMIN) {
place = new TenantsPlace();
} else {
place = new ApplicationsPlace();
}
PlaceController placeController = clientFactory.getPlaceController();
historyHandler.register(placeController, eventBus, place);
RootLayoutPanel.get().add(appWidget);
// Goes to the place represented on URL else default place
historyHandler.handleCurrentHistory();
}
示例13: run
import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
@Override
public void run(HasWidgets.ForIsWidget parentView) {
setUncaughtExceptionHandler();
log.info("DesktopApp is running.");
setPlaceChangeEventHandler();
shell.setEventBus(eventBus);
ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
activityManager.setDisplay(shell.getView());
PlaceHistoryHandler placeHistoryHandler = new PlaceHistoryHandler(placeHistoryMapper);
placeHistoryHandler.register(placeController, eventBus, defaultPlace);
parentView.add(shell.getView());
placeHistoryHandler.handleCurrentHistory();
}
示例14: run
import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
@Override
public void run() {
/* Add handlers, setup activities */
GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
@Override
public void onUncaughtException(Throwable e) {
/* open the umbrella if it's an umbrella */
e = unwrapException(e);
e.printStackTrace();
LOG.log(Level.SEVERE, "Uncaught exception", e);
}
private static final int MAX_UNWRAPS = 10;
private Throwable unwrapException(Throwable throwable) {
Throwable result = throwable;
int attempts = 0;
while (attempts < MAX_UNWRAPS) {
if (result instanceof UmbrellaException && ((UmbrellaException) result).getCauses().size() == 1) {
result = ((UmbrellaException) throwable).getCauses().iterator().next();
} else if (result instanceof com.google.web.bindery.event.shared.UmbrellaException
&& ((com.google.web.bindery.event.shared.UmbrellaException) result).getCauses().size() == 1) {
result = ((com.google.web.bindery.event.shared.UmbrellaException) throwable).getCauses()
.iterator().next();
} else {
break;
}
attempts++;
}
return result;
}
});
/* activity management */
CachingActivityMapper cached = new CachingActivityMapper(mainActivityMapper);
ActivityManager mainActivityManager = new ActivityManager(cached, eventBus);
mainActivityManager.setDisplay(applicationActivity.getViewPanel());
/* add a panel for the desktop to add to if it needs to */
SimpleLayoutPanel sp = new SimpleLayoutPanel();
RootLayoutPanel.get().add(sp);
applicationActivity.start(sp, eventBus);
}
示例15: onModuleLoad
import com.google.gwt.activity.shared.ActivityManager; //导入方法依赖的package包/类
@Override
public void onModuleLoad() {
RootView.Presenter rootPresenter = injector.getRootPresenter();
PlaceControllerHolder placeControllerHolder = injector.getPlaceControllerHolder();
// Initialize a manager per region
ActivityManager northActivityManager = new ActivityManager(injector.getNorthActivityMapper(), placeControllerHolder.getEventBus());
northActivityManager.setDisplay(rootPresenter.getView().getRegion(Region.North));
ActivityManager westActivityManager = new ActivityManager(injector.getWestActivityMapper(), placeControllerHolder.getEventBus());
westActivityManager.setDisplay(rootPresenter.getView().getRegion(Region.West));
// Do the same for center, south ...
AppPlaceHistoryMapper historyMapper= injector.getAppPlaceHistoryMapper();
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
historyHandler.register(placeControllerHolder.getPlaceController(), placeControllerHolder.getEventBus(), new Place1("test"));
RootLayoutPanel.get().add(rootPresenter.getView().asWidget());
// Activate navigation history and go to default place
historyHandler.handleCurrentHistory();
}