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;
}
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));
}
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()))));
}
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);
}
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();
}
});
}
Aggregations