use of org.activityinfo.client.event.NavigationEvent in project activityinfo by bedatadriven.
the class HistoryManager method onBrowserMovement.
private void onBrowserMovement(String token) {
Log.debug("HistoryManager: Browser movement observed (" + token + "), firing NavigationRequested");
PageState place = placeSerializer.deserialize(token);
if (place != null) {
eventBus.fireEvent(new NavigationEvent(NavigationHandler.NAVIGATION_REQUESTED, place));
} else {
Log.debug("HistoryManager: Could not deserialize '" + token + "', no action taken.");
}
}
use of org.activityinfo.client.event.NavigationEvent in project activityinfo by bedatadriven.
the class AppFrameSet method setupTabs.
private void setupTabs() {
appBar.getSectionTabStrip().addSelectionHandler(new SelectionHandler<Section>() {
@Override
public void onSelection(SelectionEvent<Section> event) {
onSectionClicked(event.getSelectedItem());
}
});
eventBus.addListener(NavigationHandler.NAVIGATION_AGREED, new Listener<NavigationEvent>() {
@Override
public void handleEvent(NavigationEvent event) {
appBar.getSectionTabStrip().setSelection(event.getPlace().getSection());
}
});
BorderLayoutData layout = new BorderLayoutData(LayoutRegion.NORTH);
layout.setSize(AppBar.HEIGHT);
viewport.add(appBar, layout);
}
use of org.activityinfo.client.event.NavigationEvent in project activityinfo by bedatadriven.
the class HistoryManager method fireInitialPage.
private void fireInitialPage() {
if (History.getToken().length() != 0) {
Log.debug("HistoryManager: firing initial placed based on intial token: " + History.getToken());
History.fireCurrentHistoryState();
} else {
eventBus.fireEvent(new NavigationEvent(NavigationHandler.NAVIGATION_REQUESTED, new DashboardPlace()));
}
}
use of org.activityinfo.client.event.NavigationEvent in project activityinfo by bedatadriven.
the class SettingsPopup method onUserProfileLink.
@UiHandler("userProfileLink")
public void onUserProfileLink(ClickEvent e) {
eventBus.fireEvent(new NavigationEvent(NavigationHandler.NAVIGATION_REQUESTED, new UserProfilePage.State()));
super.hide();
}
use of org.activityinfo.client.event.NavigationEvent in project activityinfo by bedatadriven.
the class AbstractGridPresenter method firePageEvent.
protected void firePageEvent(AbstractGridPageState place, LoadEvent le) {
Object config = le.getConfig();
if (config instanceof ListLoadConfig) {
place.setSortInfo(((ListLoadConfig) config).getSortInfo());
}
if (config instanceof PagingLoadConfig && place instanceof AbstractPagingGridPageState) {
int offset = ((PagingLoadConfig) config).getOffset();
((AbstractPagingGridPageState) place).setPageNum(pageFromOffset(offset));
}
eventBus.fireEvent(new NavigationEvent(NavigationHandler.NAVIGATION_AGREED, place));
}
Aggregations