本文整理汇总了Java中com.google.gwt.place.shared.PlaceHistoryHandler类的典型用法代码示例。如果您正苦于以下问题:Java PlaceHistoryHandler类的具体用法?Java PlaceHistoryHandler怎么用?Java PlaceHistoryHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlaceHistoryHandler类属于com.google.gwt.place.shared包,在下文中一共展示了PlaceHistoryHandler类的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: EditorWorkFlow
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入依赖的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);
}
示例3: 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();
}
示例4: onModuleLoad
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入依赖的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();
}
});
}
示例5: 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();
}
示例6: 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();
}
示例7: providePlaceHistoryHandler
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入依赖的package包/类
@Provides
@Singleton
PlaceHistoryHandler providePlaceHistoryHandler(AppPlaceHistoryMapper placeHistoryMapper, PlaceController placeController, EventBus eventBus) {
PlaceHistoryHandler placeHistoryHandler = new PlaceHistoryHandler(placeHistoryMapper);
placeHistoryHandler.register(placeController, eventBus, new WelcomePlace());
return placeHistoryHandler;
}
示例8: MvpController
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入依赖的package包/类
protected MvpController() {
super(EventBus.get());
this.activityManager = new ActivityManager(this, EventBus.get());
this.historyHandler = new PlaceHistoryHandler(this);
this.setDefaultPlace(this.defaultPlace);
}
示例9: 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();
}
示例10: 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();
}
示例11: App
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入依赖的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;
}
示例12: 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()));
}
});
}
}
示例13: 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();
}
示例14: getHistoryHandler
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入依赖的package包/类
@Provides
@Singleton
public final PlaceHistoryHandler getHistoryHandler( @Nonnull final PlaceController placeController,
@Nonnull final PlaceHistoryMapper historyMapper,
@Nonnull final com.google.web.bindery.event.shared.EventBus eventBus,
@Nonnull final Place place )
{
final PlaceHistoryHandler historyHandler = new PlaceHistoryHandler( historyMapper );
historyHandler.register( placeController, eventBus, place );
return historyHandler;
}
示例15: providePlaceHistoryHandler
import com.google.gwt.place.shared.PlaceHistoryHandler; //导入依赖的package包/类
@Provides
@Singleton
PlaceHistoryHandler providePlaceHistoryHandler(PlaceHistoryMapper historyMapper, Historian historian,
PlaceController placeController, EventBus eventBus, @DefaultPlace Place defaultPlace) {
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper, historian);
historyHandler.register(placeController, eventBus, defaultPlace);
return historyHandler;
}