本文整理汇总了Java中com.google.gwt.place.shared.PlaceHistoryHandler.handleCurrentHistory方法的典型用法代码示例。如果您正苦于以下问题:Java PlaceHistoryHandler.handleCurrentHistory方法的具体用法?Java PlaceHistoryHandler.handleCurrentHistory怎么用?Java PlaceHistoryHandler.handleCurrentHistory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.place.shared.PlaceHistoryHandler
的用法示例。
在下文中一共展示了PlaceHistoryHandler.handleCurrentHistory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onModuleLoad
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的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: onModuleLoad
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的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();
}
示例3: onModuleLoad
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的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();
}
示例4: onModuleLoad
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的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();
}
示例5: init
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的package包/类
public void init(PlaceHistoryMapper placeHistoryMapper, Place defaultPlace, Place homePlace) {
this.placeHistoryMapper = placeHistoryMapper;
this.defaultPlace = defaultPlace;
this.homePlace = homePlace;
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(placeHistoryMapper);
historyHandler.register(placeController, eventBus, defaultPlace);
GWT.log("Here?");
historyHandler.handleCurrentHistory();
}
示例6: onModuleLoad
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的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();
}
示例7: initBrowserHistory
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的package包/类
/**
* Initialize browser history / bookmarking. If LocalStorage is available, use
* it to make the user's default location in the app the last one seen.
*/
private void initBrowserHistory(final AppPlaceHistoryMapper historyMapper,
PlaceHistoryHandler historyHandler, TaskListPlace defaultPlace) {
Place savedPlace = null;
if (storage != null) {
try {
// wrap in try-catch in case stored value is invalid
savedPlace = historyMapper.getPlace(storage.getItem(HISTORY_SAVE_KEY));
} catch (Throwable t) {
// ignore error and use the default-default
}
}
if (savedPlace == null) {
savedPlace = defaultPlace;
}
historyHandler.register(placeController, eventBus, savedPlace);
/*
* Go to the place represented in the URL. This is what makes bookmarks
* work.
*/
historyHandler.handleCurrentHistory();
/*
* Monitor the eventbus for place changes and note them in LocalStorage for
* the next launch.
*/
if (storage != null) {
eventBus.addHandler(PlaceChangeEvent.TYPE, new PlaceChangeEvent.Handler() {
public void onPlaceChange(PlaceChangeEvent event) {
storage.setItem(HISTORY_SAVE_KEY, historyMapper.getToken(event.getNewPlace()));
}
});
}
}
示例8: onModuleLoad
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的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();
}
示例9: loadApp
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的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();
}
示例10: init
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的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();
}
示例11: run
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的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();
}
示例12: onModuleLoad
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的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();
}
示例13: init
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的package包/类
private void init() {
ClientFactory clientFactory = GWT.create(ClientFactory.class);
EventBus eventBus = clientFactory.getEventBus();
PlaceController placeController = clientFactory.getPlaceController();
ActivityMapper headerActivityMapper = new HeaderActivityMapper(clientFactory);
ActivityManager headerActivityManager = new ActivityManager(headerActivityMapper, eventBus);
headerActivityManager.setDisplay(appWidget.getAppHeaderHolder());
ActivityMapper leftPanelActivityMapper = new LeftPanelActivityMapper(clientFactory);
ActivityManager leftPanelActivityManager = new ActivityManager(leftPanelActivityMapper, eventBus);
leftPanelActivityManager.setDisplay(appWidget.getLeftPanel());
ActivityMapper appActivityMapper = new SandboxActivityMapper(clientFactory);
ActivityManager appActivityManager = new ActivityManager(appActivityMapper, eventBus);
appActivityManager.setDisplay(appWidget.getAppContentHolder());
PlaceHistoryMapper historyMapper = GWT.create(SandboxPlaceHistoryMapper.class);
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
Place place = new MainPlace();
historyHandler.register(placeController, eventBus, place);
RootLayoutPanel.get().add(appWidget);
// Goes to the place represented on URL else default place
historyHandler.handleCurrentHistory();
}
示例14: onModuleLoad
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的package包/类
@Override
public void onModuleLoad() {
Viewport mainPanel = new Viewport();
RootPanel.get().add(mainPanel);
Highcharts.setOptions(new Highcharts.Options().setGlobal(new Global().setUseUTC(false)));
ClientFactory clientFactory = new ClientFactoryImpl();
EventBus eventBus = clientFactory.getEventBus();
PlaceController placeController = clientFactory.getPlaceController();
// Start ActivityManager
ActivityMapper activityMapper = new MainActivityMapper(clientFactory);
ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
activityManager.setDisplay(mainPanel);
// Start PlaceHistoryHandler with our PlaceHistoryMapper
MainPlaceHistoryMapper historyMapper = GWT.create(MainPlaceHistoryMapper.class);
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
historyHandler.register(placeController, eventBus, new MainPlace());
// Goes to the default place
historyHandler.handleCurrentHistory();
Notification.showNotification("Stratehm", "IMPORTANT: This service will shutdown in few days. See <a href=\"\">here</a> for more details.");
}
示例15: init
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入方法依赖的package包/类
private void init() {
Utils.injectSandboxStyles();
ClientFactory clientFactory = GWT.create(ClientFactory.class);
EventBus eventBus = clientFactory.getEventBus();
PlaceController placeController = clientFactory.getPlaceController();
ActivityMapper headerActivityMapper = new HeaderActivityMapper(clientFactory);
ActivityManager headerActivityManager = new ActivityManager(headerActivityMapper, eventBus);
headerActivityManager.setDisplay(appWidget.getAppHeaderHolder());
ActivityMapper appActivityMapper = new AvroUiSandboxActivityMapper(clientFactory);
ActivityManager appActivityManager = new ActivityManager(appActivityMapper, eventBus);
appActivityManager.setDisplay(appWidget.getAppContentHolder());
PlaceHistoryMapper historyMapper = GWT.create(AvroUiSandboxPlaceHistoryMapper.class);
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
Place place = new MainPlace();
historyHandler.register(placeController, eventBus, place);
RootLayoutPanel.get().add(appWidget);
// Goes to the place represented on URL else default place
historyHandler.handleCurrentHistory();
}