Search in sources :

Example 1 with NavigationEvent

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.");
    }
}
Also used : NavigationEvent(org.activityinfo.client.event.NavigationEvent) PageState(org.activityinfo.client.page.PageState)

Example 2 with NavigationEvent

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);
}
Also used : NavigationEvent(org.activityinfo.client.event.NavigationEvent) BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)

Example 3 with NavigationEvent

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()));
    }
}
Also used : NavigationEvent(org.activityinfo.client.event.NavigationEvent) DashboardPlace(org.activityinfo.client.page.dashboard.DashboardPlace)

Example 4 with NavigationEvent

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();
}
Also used : NavigationEvent(org.activityinfo.client.event.NavigationEvent) State(org.activityinfo.client.local.LocalStateChangeEvent.State) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Example 5 with NavigationEvent

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));
}
Also used : NavigationEvent(org.activityinfo.client.event.NavigationEvent) ListLoadConfig(com.extjs.gxt.ui.client.data.ListLoadConfig) PagingLoadConfig(com.extjs.gxt.ui.client.data.PagingLoadConfig)

Aggregations

NavigationEvent (org.activityinfo.client.event.NavigationEvent)8 BorderLayoutData (com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)2 ListLoadConfig (com.extjs.gxt.ui.client.data.ListLoadConfig)1 PagingLoadConfig (com.extjs.gxt.ui.client.data.PagingLoadConfig)1 FieldEvent (com.extjs.gxt.ui.client.event.FieldEvent)1 Margins (com.extjs.gxt.ui.client.util.Margins)1 Label (com.extjs.gxt.ui.client.widget.Label)1 SeparatorToolItem (com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem)1 UiHandler (com.google.gwt.uibinder.client.UiHandler)1 State (org.activityinfo.client.local.LocalStateChangeEvent.State)1 PageState (org.activityinfo.client.page.PageState)1 ActionToolBar (org.activityinfo.client.page.common.toolbar.ActionToolBar)1 DashboardPlace (org.activityinfo.client.page.dashboard.DashboardPlace)1 GroupingComboBox (org.activityinfo.client.page.entry.grouping.GroupingComboBox)1 CreateReport (org.activityinfo.shared.command.CreateReport)1 Filter (org.activityinfo.shared.command.Filter)1 CreateResult (org.activityinfo.shared.command.result.CreateResult)1