Search in sources :

Example 6 with BorderLayoutData

use of com.extjs.gxt.ui.client.widget.layout.BorderLayoutData in project activityinfo by bedatadriven.

the class TargetIndicatorView method createGridAndAddToContainer.

@Override
protected Grid<ModelData> createGridAndAddToContainer(Store store) {
    final TreeStore treeStore = (TreeStore) store;
    tree = new EditorTreeGrid<ModelData>(treeStore, createColumnModel());
    tree.setAutoExpandColumn("name");
    tree.setSelectionModel(new ImprovedCellTreeGridSelectionModel<ModelData>());
    tree.setClicksToEdit(EditorGrid.ClicksToEdit.ONE);
    tree.setLoadMask(true);
    tree.setStateId("TargetValueGrid" + db.getId());
    tree.setStateful(true);
    tree.setIconProvider(new ModelIconProvider<ModelData>() {

        @Override
        public AbstractImagePrototype getIcon(ModelData model) {
            if (model instanceof IsActivityDTO) {
                return IconImageBundle.ICONS.activity();
            } else if (model instanceof TargetValueDTO) {
                return IconImageBundle.ICONS.indicator();
            } else if (model instanceof Link) {
                return IconImageBundle.ICONS.folder();
            } else {
                return null;
            }
        }
    });
    addBeforeEditListener();
    addAfterEditListener();
    add(tree, new BorderLayoutData(Style.LayoutRegion.CENTER));
    return tree;
}
Also used : AbstractImagePrototype(com.google.gwt.user.client.ui.AbstractImagePrototype) ModelData(com.extjs.gxt.ui.client.data.ModelData) TreeStore(com.extjs.gxt.ui.client.store.TreeStore) BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData) Link(org.activityinfo.ui.client.page.common.nav.Link)

Example 7 with BorderLayoutData

use of com.extjs.gxt.ui.client.widget.layout.BorderLayoutData in project activityinfo by bedatadriven.

the class DataEntryPage method addCenter.

private void addCenter() {
    gridPanel = new SiteGridPanel(dispatcher, new DefaultColumnModelProvider(dispatcher));
    gridPanel.setTopComponent(createToolBar());
    LayoutContainer center = new LayoutContainer();
    center.setLayout(new BorderLayout());
    center.add(createNewInterfaceLink(), new BorderLayoutData(LayoutRegion.NORTH, 30));
    center.add(gridPanel, new BorderLayoutData(LayoutRegion.CENTER));
    gridPanel.addSelectionChangedListener(new SelectionChangedListener<SiteDTO>() {

        @Override
        public void selectionChanged(SelectionChangedEvent<SiteDTO> se) {
            onSiteSelected(se);
        }
    });
    gridPanel.addRowDoubleClickListener(new SelectionChangedListener<SiteDTO>() {

        @Override
        public void selectionChanged(SelectionChangedEvent<SiteDTO> se) {
            editSite(se.getSelectedItem());
        }
    });
    detailTab = new DetailTab(dispatcher);
    monthlyPanel = new MonthlyReportsPanel(dispatcher);
    monthlyTab = new TabItem(I18N.CONSTANTS.monthlyReports());
    monthlyTab.setLayout(new FitLayout());
    monthlyTab.add(monthlyPanel);
    attachmentsTab = new AttachmentsTab(dispatcher, eventBus);
    siteHistoryTab = new SiteHistoryTab(resourceLocator);
    tabPanel = new CollapsibleTabPanel();
    tabPanel.add(detailTab);
    tabPanel.add(monthlyTab);
    tabPanel.add(attachmentsTab);
    tabPanel.add(siteHistoryTab);
    tabPanel.setSelection(detailTab);
    center.add(tabPanel, tabPanel.getBorderLayoutData());
    onNoSelection();
    add(center, new BorderLayoutData(LayoutRegion.CENTER));
}
Also used : BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData) DefaultColumnModelProvider(org.activityinfo.ui.client.page.entry.column.DefaultColumnModelProvider) SiteHistoryTab(org.activityinfo.ui.client.page.entry.sitehistory.SiteHistoryTab) BorderLayout(com.extjs.gxt.ui.client.widget.layout.BorderLayout) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Example 8 with BorderLayoutData

use of com.extjs.gxt.ui.client.widget.layout.BorderLayoutData 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(event -> eventBus.fireEvent(new NavigationEvent(NavigationHandler.NAVIGATION_REQUESTED, currentPlace.copy().setFilter(event.getValue()))));
}
Also used : BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData) Margins(com.extjs.gxt.ui.client.util.Margins)

Example 9 with BorderLayoutData

use of com.extjs.gxt.ui.client.widget.layout.BorderLayoutData in project activityinfo by bedatadriven.

the class FlatSiteGridPanel method initGrid.

public void initGrid(Filter filter, ColumnModel columnModel) {
    PagingLoader<PagingLoadResult<SiteDTO>> loader = new BasePagingLoader<PagingLoadResult<SiteDTO>>(new SiteProxy());
    loader.addLoadListener(new LoadListener() {

        @Override
        public void loaderLoadException(LoadEvent le) {
            Log.debug("Exception thrown during load of FlatSiteGrid: ", le.exception);
        }
    });
    loader.setRemoteSort(true);
    loader.setSortField("date2");
    loader.setSortDir(SortDir.DESC);
    pagingToolBar.bind(loader);
    listStore = new ListStore<>(loader);
    if (editorGrid == null) {
        editorGrid = new EditorGrid<SiteDTO>(listStore, columnModel);
        editorGrid.setLoadMask(true);
        // editorGrid.setStateful(true);
        editorGrid.setClicksToEdit(ClicksToEdit.TWO);
        editorGrid.setStripeRows(true);
        final GridSelectionModel<SiteDTO> sm = new GridSelectionModel<SiteDTO>();
        sm.setSelectionMode(SelectionMode.SINGLE);
        sm.addSelectionChangedListener(new SelectionChangedListener<SiteDTO>() {

            @Override
            public void selectionChanged(SelectionChangedEvent<SiteDTO> se) {
                fireEvent(Events.SelectionChange, se);
            }
        });
        editorGrid.setSelectionModel(sm);
        new QuickTip(editorGrid);
        editorGrid.addListener(Events.RowDoubleClick, new Listener<GridEvent>() {

            @Override
            public void handleEvent(GridEvent be) {
                SiteDTO site = listStore.getAt(be.getRowIndex());
                SelectionChangedEvent<SiteDTO> event = new SelectionChangedEvent<>(sm, site);
                fireEvent(Events.RowDoubleClick, event);
            }
        });
        add(editorGrid, new BorderLayoutData(Style.LayoutRegion.CENTER));
        layout();
    } else {
        editorGrid.reconfigure(listStore, columnModel);
    }
    this.currentFilter = filter;
    loader.load();
    new QuickTip(editorGrid);
}
Also used : QuickTip(com.extjs.gxt.ui.client.widget.tips.QuickTip) BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData) GridSelectionModel(com.extjs.gxt.ui.client.widget.grid.GridSelectionModel) SiteDTO(org.activityinfo.legacy.shared.model.SiteDTO)

Example 10 with BorderLayoutData

use of com.extjs.gxt.ui.client.widget.layout.BorderLayoutData in project activityinfo by bedatadriven.

the class ReportDesignPage method createToolbar.

public void createToolbar() {
    reportBar = new ReportBar();
    BorderLayoutData reportBarLayout = new BorderLayoutData(LayoutRegion.NORTH);
    reportBarLayout.setSize(35);
    add(reportBar, reportBarLayout);
    reportBar.getExportButton().setCallback(this);
    reportBar.addTitleEditCompleteListener(new Listener<EditorEvent>() {

        @Override
        public void handleEvent(final EditorEvent be) {
            String newTitle = (String) be.getValue();
            if (newTitle != null && !newTitle.equals(currentModel.getTitle())) {
                currentModel.setTitle(newTitle);
                reportBar.setReportTitle(newTitle);
                save(new SaveCallback());
            }
        }
    });
    reportBar.getSaveButton().setCallback(new SaveCallback());
    reportBar.getShareButton().addSelectionListener(new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(final ButtonEvent ce) {
            showShareForm();
        }
    });
    reportBar.getDashboardButton().addSelectionListener(new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(final ButtonEvent ce) {
            pinToDashboard(reportBar.getDashboardButton().isPressed());
        }
    });
    reportBar.getSwitchViewButton().addSelectionListener(new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(final ButtonEvent ce) {
            switchView();
        }
    });
}
Also used : BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)

Aggregations

BorderLayoutData (com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)22 Margins (com.extjs.gxt.ui.client.util.Margins)7 BorderLayout (com.extjs.gxt.ui.client.widget.layout.BorderLayout)4 ContentPanel (com.extjs.gxt.ui.client.widget.ContentPanel)2 LayoutContainer (com.extjs.gxt.ui.client.widget.LayoutContainer)2 FitLayout (com.extjs.gxt.ui.client.widget.layout.FitLayout)2 PivotGridPanel (org.activityinfo.ui.client.component.report.view.PivotGridPanel)2 ModelData (com.extjs.gxt.ui.client.data.ModelData)1 ListStore (com.extjs.gxt.ui.client.store.ListStore)1 TreeStore (com.extjs.gxt.ui.client.store.TreeStore)1 Button (com.extjs.gxt.ui.client.widget.button.Button)1 GridSelectionModel (com.extjs.gxt.ui.client.widget.grid.GridSelectionModel)1 FlowLayout (com.extjs.gxt.ui.client.widget.layout.FlowLayout)1 QuickTip (com.extjs.gxt.ui.client.widget.tips.QuickTip)1 AbstractImagePrototype (com.google.gwt.user.client.ui.AbstractImagePrototype)1 Filter (org.activityinfo.legacy.shared.command.Filter)1 SiteDTO (org.activityinfo.legacy.shared.model.SiteDTO)1 TargetDTO (org.activityinfo.legacy.shared.model.TargetDTO)1 PivotFilterPanel (org.activityinfo.ui.client.component.report.editor.chart.PivotFilterPanel)1 ChartOFCView (org.activityinfo.ui.client.component.report.view.ChartOFCView)1