Search in sources :

Example 6 with NavigationEvent

use of org.activityinfo.client.event.NavigationEvent in project activityinfo by bedatadriven.

the class DataEntryPage method addFilterPane.

private void addFilterPane() {
    filterPane = new FilterPane(dispatcher);
    BorderLayoutData filterLayout = new BorderLayoutData(LayoutRegion.WEST);
    filterLayout.setCollapsible(true);
    filterLayout.setMargins(new Margins(0, 5, 0, 0));
    filterLayout.setSplit(true);
    add(filterPane, filterLayout);
    filterPane.getSet().addValueChangeHandler(new ValueChangeHandler<Filter>() {

        @Override
        public void onValueChange(ValueChangeEvent<Filter> event) {
            eventBus.fireEvent(new NavigationEvent(NavigationHandler.NAVIGATION_REQUESTED, currentPlace.copy().setFilter(event.getValue())));
        }
    });
}
Also used : NavigationEvent(org.activityinfo.client.event.NavigationEvent) Filter(org.activityinfo.shared.command.Filter) BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData) Margins(com.extjs.gxt.ui.client.util.Margins)

Example 7 with NavigationEvent

use of org.activityinfo.client.event.NavigationEvent in project activityinfo by bedatadriven.

the class DataEntryPage method createToolBar.

private ActionToolBar createToolBar() {
    toolBar = new ActionToolBar(this);
    groupingComboBox = new GroupingComboBox(dispatcher);
    groupingComboBox.withSelectionListener(new Listener<FieldEvent>() {

        @Override
        public void handleEvent(FieldEvent be) {
            eventBus.fireEvent(new NavigationEvent(NavigationHandler.NAVIGATION_REQUESTED, currentPlace.copy().setGrouping(groupingComboBox.getGroupingModel())));
        }
    });
    toolBar.add(new Label(I18N.CONSTANTS.grouping()));
    toolBar.add(groupingComboBox);
    toolBar.addButton(UIActions.ADD, I18N.CONSTANTS.newSite(), IconImageBundle.ICONS.add());
    toolBar.addButton(UIActions.EDIT, I18N.CONSTANTS.edit(), IconImageBundle.ICONS.edit());
    toolBar.addDeleteButton(I18N.CONSTANTS.deleteSite());
    toolBar.add(new SeparatorToolItem());
    toolBar.addButton("IMPORT", "Import", IconImageBundle.ICONS.importIcon());
    toolBar.addExcelExportButton();
    toolBar.addPrintButton();
    toolBar.addButton("EMBED", I18N.CONSTANTS.embed(), IconImageBundle.ICONS.embed());
    return toolBar;
}
Also used : NavigationEvent(org.activityinfo.client.event.NavigationEvent) FieldEvent(com.extjs.gxt.ui.client.event.FieldEvent) SeparatorToolItem(com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem) Label(com.extjs.gxt.ui.client.widget.Label) ActionToolBar(org.activityinfo.client.page.common.toolbar.ActionToolBar) GroupingComboBox(org.activityinfo.client.page.entry.grouping.GroupingComboBox)

Example 8 with NavigationEvent

use of org.activityinfo.client.event.NavigationEvent in project activityinfo by bedatadriven.

the class ReportDesignPage method performCreate.

private void performCreate() {
    currentModel.setTitle(currentModel.getTitle() + " (" + I18N.CONSTANTS.copy() + ")");
    dispatcher.execute(new CreateReport(currentModel), new AsyncCallback<CreateResult>() {

        @Override
        public void onFailure(final Throwable caught) {
        }

        @Override
        public void onSuccess(final CreateResult created) {
            eventBus.fireEvent(new NavigationEvent(NavigationHandler.NAVIGATION_REQUESTED, new ReportDesignPageState(created.getNewId())));
        }
    });
}
Also used : NavigationEvent(org.activityinfo.client.event.NavigationEvent) CreateResult(org.activityinfo.shared.command.result.CreateResult) CreateReport(org.activityinfo.shared.command.CreateReport)

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