Search in sources :

Example 1 with NavigationEvent

use of org.activityinfo.ui.client.page.NavigationEvent in project activityinfo by bedatadriven.

the class AppBar method localeClick.

@UiHandler("localeButton")
void localeClick(ClickEvent e) {
    if (localeMenu == null) {
        localeMenu = new Menu();
        for (final ApplicationLocale applicationLocale : ApplicationLocale.values()) {
            CheckMenuItem menuItem = new CheckMenuItem(applicationLocale.getLocalizedName());
            menuItem.setChecked(LocaleSwitcher.isCurrent(applicationLocale));
            menuItem.setGroup("lang");
            menuItem.setDirectionEstimated(false);
            menuItem.addSelectionListener(new SelectionListener<MenuEvent>() {

                @Override
                public void componentSelected(MenuEvent ce) {
                    LocaleSwitcher.switchLocale(applicationLocale);
                }
            });
            localeMenu.add(menuItem);
        }
        localeMenu.add(new SeparatorMenuItem());
        MenuItem preferenceItem = new MenuItem(I18N.CONSTANTS.language());
        preferenceItem.setDirectionEstimated(false);
        preferenceItem.addSelectionListener(new SelectionListener<MenuEvent>() {

            @Override
            public void componentSelected(MenuEvent ce) {
                eventBus.fireEvent(new NavigationEvent(NavigationHandler.NAVIGATION_REQUESTED, new UserProfilePage.State()));
            }
        });
        localeMenu.add(preferenceItem);
    }
    localeMenu.show(localeButton.getElement(), "?");
}
Also used : CheckMenuItem(com.extjs.gxt.ui.client.widget.menu.CheckMenuItem) NavigationEvent(org.activityinfo.ui.client.page.NavigationEvent) ApplicationLocale(org.activityinfo.i18n.shared.ApplicationLocale) SeparatorMenuItem(com.extjs.gxt.ui.client.widget.menu.SeparatorMenuItem) MenuItem(com.extjs.gxt.ui.client.widget.menu.MenuItem) CheckMenuItem(com.extjs.gxt.ui.client.widget.menu.CheckMenuItem) Menu(com.extjs.gxt.ui.client.widget.menu.Menu) SeparatorMenuItem(com.extjs.gxt.ui.client.widget.menu.SeparatorMenuItem) MenuEvent(com.extjs.gxt.ui.client.event.MenuEvent) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Example 2 with NavigationEvent

use of org.activityinfo.ui.client.page.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.ui.client.page.NavigationEvent) State(org.activityinfo.ui.client.local.LocalStateChangeEvent.State) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Aggregations

UiHandler (com.google.gwt.uibinder.client.UiHandler)2 NavigationEvent (org.activityinfo.ui.client.page.NavigationEvent)2 MenuEvent (com.extjs.gxt.ui.client.event.MenuEvent)1 CheckMenuItem (com.extjs.gxt.ui.client.widget.menu.CheckMenuItem)1 Menu (com.extjs.gxt.ui.client.widget.menu.Menu)1 MenuItem (com.extjs.gxt.ui.client.widget.menu.MenuItem)1 SeparatorMenuItem (com.extjs.gxt.ui.client.widget.menu.SeparatorMenuItem)1 ApplicationLocale (org.activityinfo.i18n.shared.ApplicationLocale)1 State (org.activityinfo.ui.client.local.LocalStateChangeEvent.State)1