Search in sources :

Example 1 with ReadTextColumn

use of org.activityinfo.client.page.common.columns.ReadTextColumn in project activityinfo by bedatadriven.

the class ColumnModelBuilder method maybeAddSingleLineLocationColumn.

public ColumnModelBuilder maybeAddSingleLineLocationColumn(ActivityDTO activity) {
    if (activity.getLocationType().getBoundAdminLevelId() == null) {
        ReadTextColumn column = new ReadTextColumn("locationName", activity.getLocationType().getName(), 100);
        columns.add(column);
    }
    return this;
}
Also used : ReadTextColumn(org.activityinfo.client.page.common.columns.ReadTextColumn)

Example 2 with ReadTextColumn

use of org.activityinfo.client.page.common.columns.ReadTextColumn in project activityinfo by bedatadriven.

the class PiechartLayerOptions method setupIndicatorOptionsGrid.

private void setupIndicatorOptionsGrid() {
    List<ColumnConfig> columnConfigs = new ArrayList<ColumnConfig>();
    columnConfigs.add(new EditColorColumn());
    columnConfigs.add(new ReadTextColumn("name", I18N.CONSTANTS.indicators(), 50));
    ColumnModel columnmodelIndicators = new ColumnModel(columnConfigs);
    indicatorOptionGrid = new EditorGrid<NamedSlice>(indicatorsStore, columnmodelIndicators);
    indicatorOptionGrid.setBorders(false);
    indicatorOptionGrid.setAutoExpandColumn("name");
    indicatorOptionGrid.setAutoWidth(true);
    indicatorOptionGrid.setHeight(100);
    indicatorOptionGrid.getView().setShowDirtyCells(false);
    indicatorOptionGrid.setSelectionModel(new CellSelectionModel<PiechartLayerOptions.NamedSlice>());
    indicatorOptionGrid.addListener(Events.AfterEdit, new Listener<GridEvent<NamedSlice>>() {

        @Override
        public void handleEvent(GridEvent<NamedSlice> be) {
            be.getModel().getSlice().setColor(be.getModel().getColor());
            ValueChangeEvent.fire(PiechartLayerOptions.this, piechartMapLayer);
        }
    });
    VBoxLayoutData vbld = new VBoxLayoutData();
    vbld.setFlex(1);
    panel.add(indicatorOptionGrid);
}
Also used : VBoxLayoutData(com.extjs.gxt.ui.client.widget.layout.VBoxLayoutData) GridEvent(com.extjs.gxt.ui.client.event.GridEvent) ColumnConfig(com.extjs.gxt.ui.client.widget.grid.ColumnConfig) ReadTextColumn(org.activityinfo.client.page.common.columns.ReadTextColumn) ArrayList(java.util.ArrayList) EditColorColumn(org.activityinfo.client.page.common.columns.EditColorColumn) ColumnModel(com.extjs.gxt.ui.client.widget.grid.ColumnModel)

Example 3 with ReadTextColumn

use of org.activityinfo.client.page.common.columns.ReadTextColumn in project activityinfo by bedatadriven.

the class LockedPeriodGrid method createGrid.

private void createGrid() {
    List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
    ColumnConfig columnEnabled = new EditCheckColumnConfig("enabled", I18N.CONSTANTS.enabledColumn(), 55);
    columnEnabled.setSortable(false);
    ColumnConfig columnPeriodType = new ReadLockedPeriodTypeColumn();
    columnPeriodType.setSortable(false);
    configs.add(columnEnabled);
    configs.add(columnPeriodType);
    configs.add(new ReadTextColumn("parentName", I18N.CONSTANTS.parentName(), 150));
    configs.add(new ReadTextColumn("name", I18N.CONSTANTS.name(), 100));
    configs.add(new EditableLocalDateColumn("fromDate", I18N.CONSTANTS.fromDate(), 100));
    configs.add(new EditableLocalDateColumn("toDate", I18N.CONSTANTS.toDate(), 100));
    lockedPeriodGrid = new EditorGrid<LockedPeriodDTO>(lockedPeriodStore, new ColumnModel(configs));
    lockedPeriodGrid.addListener(Events.OnClick, new Listener<ComponentEvent>() {

        @Override
        public void handleEvent(ComponentEvent be) {
            lockedPeriod = lockedPeriodGrid.getSelectionModel().getSelectedItem();
            setDeleteEnabled(lockedPeriodGrid.getSelectionModel().getSelectedItem() != null);
        }
    });
    add(lockedPeriodGrid);
}
Also used : ReadLockedPeriodTypeColumn(org.activityinfo.client.page.common.columns.ReadLockedPeriodTypeColumn) EditCheckColumnConfig(org.activityinfo.client.page.common.columns.EditCheckColumnConfig) ColumnConfig(com.extjs.gxt.ui.client.widget.grid.ColumnConfig) ReadTextColumn(org.activityinfo.client.page.common.columns.ReadTextColumn) ArrayList(java.util.ArrayList) EditableLocalDateColumn(org.activityinfo.client.page.common.columns.EditableLocalDateColumn) EditCheckColumnConfig(org.activityinfo.client.page.common.columns.EditCheckColumnConfig) LockedPeriodDTO(org.activityinfo.shared.dto.LockedPeriodDTO) ColumnModel(com.extjs.gxt.ui.client.widget.grid.ColumnModel) ComponentEvent(com.extjs.gxt.ui.client.event.ComponentEvent)

Example 4 with ReadTextColumn

use of org.activityinfo.client.page.common.columns.ReadTextColumn in project activityinfo by bedatadriven.

the class ColumnModelBuilder method addLocationColumn.

public ColumnModelBuilder addLocationColumn() {
    ReadTextColumn column = new ReadTextColumn("locationName", I18N.CONSTANTS.location(), 100);
    columns.add(column);
    return this;
}
Also used : ReadTextColumn(org.activityinfo.client.page.common.columns.ReadTextColumn)

Example 5 with ReadTextColumn

use of org.activityinfo.client.page.common.columns.ReadTextColumn in project activityinfo by bedatadriven.

the class ColumnModelBuilder method maybeAddTwoLineLocationColumn.

public ColumnModelBuilder maybeAddTwoLineLocationColumn(ActivityDTO activity) {
    if (activity.getLocationType().getBoundAdminLevelId() == null) {
        ReadTextColumn column = new ReadTextColumn("locationName", activity.getLocationType().getName(), 100);
        column.setRenderer(new LocationColumnRenderer());
        columns.add(column);
    }
    return this;
}
Also used : ReadTextColumn(org.activityinfo.client.page.common.columns.ReadTextColumn)

Aggregations

ReadTextColumn (org.activityinfo.client.page.common.columns.ReadTextColumn)5 ColumnConfig (com.extjs.gxt.ui.client.widget.grid.ColumnConfig)2 ColumnModel (com.extjs.gxt.ui.client.widget.grid.ColumnModel)2 ArrayList (java.util.ArrayList)2 ComponentEvent (com.extjs.gxt.ui.client.event.ComponentEvent)1 GridEvent (com.extjs.gxt.ui.client.event.GridEvent)1 VBoxLayoutData (com.extjs.gxt.ui.client.widget.layout.VBoxLayoutData)1 EditCheckColumnConfig (org.activityinfo.client.page.common.columns.EditCheckColumnConfig)1 EditColorColumn (org.activityinfo.client.page.common.columns.EditColorColumn)1 EditableLocalDateColumn (org.activityinfo.client.page.common.columns.EditableLocalDateColumn)1 ReadLockedPeriodTypeColumn (org.activityinfo.client.page.common.columns.ReadLockedPeriodTypeColumn)1 LockedPeriodDTO (org.activityinfo.shared.dto.LockedPeriodDTO)1