Search in sources :

Example 6 with BaseEvent

use of com.extjs.gxt.ui.client.event.BaseEvent in project activityinfo by bedatadriven.

the class EmailDialog method createLayout.

public void createLayout() {
    FormPanel form = new FormPanel();
    form.setHeaderVisible(false);
    form.setLabelWidth(100);
    setLayout(new FitLayout());
    add(form);
    none = new Radio();
    none.setBoxLabel(I18N.CONSTANTS.none());
    weekly = new Radio();
    weekly.setBoxLabel(I18N.CONSTANTS.weekly());
    weekly.setValue(true);
    monthly = new Radio();
    monthly.setBoxLabel(I18N.CONSTANTS.monthly());
    emailFrequency = new RadioGroup();
    emailFrequency.setFieldLabel(I18N.CONSTANTS.emailFrequency());
    emailFrequency.setOrientation(Orientation.VERTICAL);
    emailFrequency.add(none);
    emailFrequency.add(weekly);
    emailFrequency.add(monthly);
    form.add(emailFrequency);
    dayOfWeek = new MappingComboBox<Integer>();
    dayOfWeek.setAllowBlank(false);
    dayOfWeek.setEditable(false);
    dayOfWeek.setFieldLabel(I18N.CONSTANTS.dayOfWeek());
    String[] weekDays = LocaleInfo.getCurrentLocale().getDateTimeConstants().weekdays();
    for (int i = 0; i != weekDays.length; ++i) {
        dayOfWeek.add(i + 1, weekDays[i]);
    }
    form.add(dayOfWeek);
    dayOfMonth = new MappingComboBox<Integer>();
    dayOfMonth.setEditable(false);
    dayOfMonth.hide();
    dayOfMonth.setFieldLabel(I18N.CONSTANTS.dayOfMonth());
    for (int i = 1; i <= 31; i++) {
        dayOfMonth.add(i, String.valueOf(i));
    }
    form.add(dayOfMonth);
    emailFrequency.addListener(Events.Change, new Listener<BaseEvent>() {

        @Override
        public void handleEvent(BaseEvent be) {
            if (weekly.getValue()) {
                showWeek();
            } else if (monthly.getValue()) {
                showMonth();
            }
        }
    });
}
Also used : FormPanel(com.extjs.gxt.ui.client.widget.form.FormPanel) RadioGroup(com.extjs.gxt.ui.client.widget.form.RadioGroup) BaseEvent(com.extjs.gxt.ui.client.event.BaseEvent) Radio(com.extjs.gxt.ui.client.widget.form.Radio) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Example 7 with BaseEvent

use of com.extjs.gxt.ui.client.event.BaseEvent in project activityinfo by bedatadriven.

the class NewLocationPresenter method setLatLng.

public void setLatLng(AiLatLng latLng) {
    this.latLng = latLng;
    this.provisional = false;
    fireEvent(POSITION_CHANGED, new BaseEvent(POSITION_CHANGED));
}
Also used : BaseEvent(com.extjs.gxt.ui.client.event.BaseEvent)

Example 8 with BaseEvent

use of com.extjs.gxt.ui.client.event.BaseEvent in project activityinfo by bedatadriven.

the class AdminLevelPanel method showOptions.

protected void showOptions(List<AdminLevelDTO> levels) {
    removeAll();
    if (radioGroup != null) {
        radioGroup.removeAllListeners();
    }
    radioGroup = new RadioGroup();
    boolean missingPolygons = false;
    for (AdminLevelDTO level : levels) {
        Radio radio = new Radio();
        radio.setBoxLabel(level.getName());
        radio.setEnabled(level.getPolygons());
        radio.setData("adminLevelId", level.getId());
        radioGroup.add(radio);
        add(radio);
        if (!level.getPolygons()) {
            missingPolygons = true;
        }
    }
    if (missingPolygons) {
        addMissingPolygonMessage();
    }
    radioGroup.addListener(Events.Change, new Listener<BaseEvent>() {

        @Override
        public void handleEvent(BaseEvent be) {
            AdminLevelPanel.this.fireEvent(Events.Change, new BaseEvent(Events.Change));
        }
    });
    layout();
}
Also used : RadioGroup(com.extjs.gxt.ui.client.widget.form.RadioGroup) AdminLevelDTO(org.activityinfo.legacy.shared.model.AdminLevelDTO) BaseEvent(com.extjs.gxt.ui.client.event.BaseEvent) Radio(com.extjs.gxt.ui.client.widget.form.Radio)

Example 9 with BaseEvent

use of com.extjs.gxt.ui.client.event.BaseEvent in project activityinfo by bedatadriven.

the class MapEditor method createLayersOptionsPanel.

protected void createLayersOptionsPanel() {
    optionsPanel = new LayerOptionsPanel(dispatcher);
    optionsPanel.setVisible(false);
    optionsPanel.addListener(Events.Hide, new Listener<BaseEvent>() {

        @Override
        public void handleEvent(BaseEvent be) {
            mapPanel.setZoomControlOffsetX(ZOOM_CONTROL_LEFT_MARGIN);
        }
    });
    optionsPanel.addListener(Events.Show, new Listener<BaseEvent>() {

        @Override
        public void handleEvent(BaseEvent be) {
            mapPanel.setZoomControlOffsetX(LayerOptionsPanel.WIDTH + ZOOM_CONTROL_LEFT_MARGIN);
        }
    });
    optionsPanel.addValueChangeHandler(new ValueChangeHandler<MapLayer>() {

        @Override
        public void onValueChange(ValueChangeEvent<MapLayer> event) {
            MapEditor.this.mapReportElement.setFilter(event.getValue().getFilter());
            reportEventBus.fireChange();
        }
    });
    add(optionsPanel, new AbsoluteData(0, CONTROL_TOP_MARGIN));
}
Also used : MapLayer(org.activityinfo.legacy.shared.reports.model.layers.MapLayer) BaseEvent(com.extjs.gxt.ui.client.event.BaseEvent) AbsoluteData(com.extjs.gxt.ui.client.widget.layout.AbsoluteData) LayerOptionsPanel(org.activityinfo.ui.client.component.report.editor.map.layerOptions.LayerOptionsPanel)

Aggregations

BaseEvent (com.extjs.gxt.ui.client.event.BaseEvent)9 Radio (com.extjs.gxt.ui.client.widget.form.Radio)2 RadioGroup (com.extjs.gxt.ui.client.widget.form.RadioGroup)2 FitLayout (com.extjs.gxt.ui.client.widget.layout.FitLayout)2 Chart (com.extjs.gxt.charts.client.Chart)1 FilledBarChart (com.extjs.gxt.charts.client.model.charts.FilledBarChart)1 LineChart (com.extjs.gxt.charts.client.model.charts.LineChart)1 PieChart (com.extjs.gxt.charts.client.model.charts.PieChart)1 BaseListLoader (com.extjs.gxt.ui.client.data.BaseListLoader)1 Dialog (com.extjs.gxt.ui.client.widget.Dialog)1 FormPanel (com.extjs.gxt.ui.client.widget.form.FormPanel)1 AbsoluteData (com.extjs.gxt.ui.client.widget.layout.AbsoluteData)1 MarginData (com.extjs.gxt.ui.client.widget.layout.MarginData)1 AdminLevelDTO (org.activityinfo.legacy.shared.model.AdminLevelDTO)1 MapLayer (org.activityinfo.legacy.shared.reports.model.layers.MapLayer)1 LeafletMap (org.activityinfo.ui.client.component.report.editor.map.LeafletMap)1 LayerOptionsPanel (org.activityinfo.ui.client.component.report.editor.map.layerOptions.LayerOptionsPanel)1 MapOptions (org.discotools.gwt.leaflet.client.map.MapOptions)1