Search in sources :

Example 1 with DefaultColumnModelProvider

use of org.activityinfo.ui.client.page.entry.column.DefaultColumnModelProvider 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)

Aggregations

BorderLayout (com.extjs.gxt.ui.client.widget.layout.BorderLayout)1 BorderLayoutData (com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)1 FitLayout (com.extjs.gxt.ui.client.widget.layout.FitLayout)1 DefaultColumnModelProvider (org.activityinfo.ui.client.page.entry.column.DefaultColumnModelProvider)1 SiteHistoryTab (org.activityinfo.ui.client.page.entry.sitehistory.SiteHistoryTab)1