Search in sources :

Example 1 with HorizontalPanel

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

the class WarningBar method initializeComponent.

private void initializeComponent() {
    panelMain = new HorizontalPanel();
    add(panelMain);
    imageLocked = IconImageBundle.ICONS.lockedPeriod().createImage();
    panelMain.add(imageLocked);
    labelMessage = new LabelField();
    panelMain.add(labelMessage);
    setStyleAttribute("padding", "0.25em");
    setStyleAttribute("background-color", "#F5A9A9");
}
Also used : HorizontalPanel(com.extjs.gxt.ui.client.widget.HorizontalPanel) LabelField(com.extjs.gxt.ui.client.widget.form.LabelField)

Example 2 with HorizontalPanel

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

the class AddLockedPeriodDialog method initializeComponent.

private void initializeComponent() {
    setWidth(400);
    setHeight(280);
    setHeaderVisible(false);
    fieldsetContainer = new FieldSet();
    fieldsetContainer.setHeading(I18N.CONSTANTS.type());
    comboboxProjects = new ComboBox<ProjectDTO>();
    storeProjects = new ListStore<ProjectDTO>();
    comboboxProjects.setStore(storeProjects);
    comboboxProjects.setDisplayField("name");
    comboboxProjects.setForceSelection(true);
    comboboxProjects.setTriggerAction(TriggerAction.ALL);
    comboboxProjects.setEditable(false);
    comboboxActivities = new ComboBox<ActivityDTO>();
    storeActivities = new ListStore<ActivityDTO>();
    comboboxActivities.setStore(storeActivities);
    comboboxActivities.setDisplayField("name");
    comboboxActivities.setForceSelection(true);
    comboboxActivities.setTriggerAction(TriggerAction.ALL);
    comboboxActivities.setEditable(false);
    radiogroupContainer = new RadioGroup();
    radiogroupContainer.setFieldLabel(I18N.CONSTANTS.type());
    labelDatabase = new LabelField(I18N.CONSTANTS.database());
    labelDatabase.setWidth(100);
    labelDatabaseName = new LabelField();
    radioDatabase = new Radio();
    radioDatabase.setFieldLabel(I18N.CONSTANTS.database());
    radioDatabase.addListener(Events.Change, new Listener<FieldEvent>() {

        @Override
        public void handleEvent(FieldEvent be) {
        }
    });
    radiogroupContainer.add(radioDatabase);
    panelDatabase = new HorizontalPanel();
    panelDatabase.add(labelDatabase);
    panelDatabase.add(radioDatabase);
    panelDatabase.add(labelDatabaseName);
    fieldsetContainer.add(panelDatabase);
    radioActivity = new Radio();
    radioActivity.setFieldLabel(I18N.CONSTANTS.activity());
    labelActivity = new LabelField(I18N.CONSTANTS.activity());
    labelActivity.setWidth(100);
    panelActivity = new HorizontalPanel();
    panelActivity.add(labelActivity);
    panelActivity.add(radioActivity);
    panelActivity.add(comboboxActivities);
    fieldsetContainer.add(panelActivity);
    radiogroupContainer.add(radioActivity);
    radioProject = new Radio();
    radioProject.setFieldLabel(I18N.CONSTANTS.project());
    radioProject.addListener(Events.Change, new Listener<FieldEvent>() {

        @Override
        public void handleEvent(FieldEvent be) {
            comboboxProjects.setEnabled(radioProject.getValue());
        }
    });
    labelProject = new LabelField(I18N.CONSTANTS.project());
    labelProject.setWidth(100);
    panelProject = new HorizontalPanel();
    panelProject.add(labelProject);
    panelProject.add(radioProject);
    panelProject.add(comboboxProjects);
    fieldsetContainer.add(panelProject);
    radiogroupContainer.add(radioProject);
    add(fieldsetContainer);
    textfieldName = new TextField<String>();
    textfieldName.setFieldLabel(I18N.CONSTANTS.name());
    textfieldName.setAllowBlank(false);
    add(textfieldName);
    checkboxEnabled = new CheckBox();
    checkboxEnabled.setFieldLabel(I18N.CONSTANTS.enabledColumn());
    add(checkboxEnabled);
    datefieldFromDate = new DateField();
    datefieldFromDate.setFieldLabel(I18N.CONSTANTS.fromDate());
    datefieldFromDate.setAllowBlank(false);
    add(datefieldFromDate);
    datefieldToDate = new DateField();
    datefieldToDate.setFieldLabel(I18N.CONSTANTS.toDate());
    datefieldFromDate.setAllowBlank(false);
    add(datefieldToDate);
    radiogroupContainer.addListener(Events.Change, new Listener<FieldEvent>() {

        @Override
        public void handleEvent(FieldEvent be) {
            comboboxActivities.setAllowBlank(!radioActivity.getValue());
            comboboxProjects.setAllowBlank(!radioProject.getValue());
            comboboxActivities.clearInvalid();
            comboboxProjects.clearInvalid();
        }
    });
}
Also used : ProjectDTO(org.activityinfo.shared.dto.ProjectDTO) RadioGroup(com.extjs.gxt.ui.client.widget.form.RadioGroup) FieldEvent(com.extjs.gxt.ui.client.event.FieldEvent) Radio(com.extjs.gxt.ui.client.widget.form.Radio) ActivityDTO(org.activityinfo.shared.dto.ActivityDTO) FieldSet(com.extjs.gxt.ui.client.widget.form.FieldSet) CheckBox(com.extjs.gxt.ui.client.widget.form.CheckBox) HorizontalPanel(com.extjs.gxt.ui.client.widget.HorizontalPanel) DateField(com.extjs.gxt.ui.client.widget.form.DateField) LabelField(com.extjs.gxt.ui.client.widget.form.LabelField)

Example 3 with HorizontalPanel

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

the class WarningBar method initializeComponent.

private void initializeComponent() {
    panelMain = new HorizontalPanel();
    add(panelMain);
    imageLocked = IconImageBundle.ICONS.lockedPeriod().createImage();
    panelMain.add(imageLocked);
    labelMessage = new LabelField();
    panelMain.add(labelMessage);
    setStyleAttribute("padding", "0.25em");
    setStyleAttribute("background-color", "#F5A9A9");
}
Also used : HorizontalPanel(com.extjs.gxt.ui.client.widget.HorizontalPanel) LabelField(com.extjs.gxt.ui.client.widget.form.LabelField)

Example 4 with HorizontalPanel

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

the class AddLockedPeriodDialog method initializeComponent.

private void initializeComponent() {
    setWidth(400);
    setHeight(280);
    setHeaderVisible(false);
    fieldsetContainer = new FieldSet();
    fieldsetContainer.setHeadingHtml(SafeHtmlUtils.htmlEscape(I18N.CONSTANTS.type()));
    comboboxProjects = new ComboBox<>();
    storeProjects = new ListStore<>();
    comboboxProjects.setStore(storeProjects);
    comboboxProjects.setDisplayField("name");
    comboboxProjects.setForceSelection(true);
    comboboxProjects.setTriggerAction(TriggerAction.ALL);
    comboboxProjects.setEditable(false);
    comboboxProjects.setItemRenderer(new MultilineRenderer<>(new ModelPropertyRenderer<>("name")));
    comboBoxFolder = new ComboBox<>();
    storeFolders = new ListStore<>();
    comboBoxFolder.setStore(storeFolders);
    comboBoxFolder.setDisplayField("name");
    comboBoxFolder.setForceSelection(true);
    comboBoxFolder.setTriggerAction(TriggerAction.ALL);
    comboBoxFolder.setEditable(false);
    comboboxProjects.setItemRenderer(new MultilineRenderer<>(new ModelPropertyRenderer<>("name")));
    comboboxActivities = new ComboBox<>();
    storeActivities = new ListStore<>();
    comboboxActivities.setStore(storeActivities);
    comboboxActivities.setDisplayField("name");
    comboboxActivities.setForceSelection(true);
    comboboxActivities.setTriggerAction(TriggerAction.ALL);
    comboboxActivities.setEditable(false);
    comboboxActivities.setItemRenderer(new MultilineRenderer<>(new ModelPropertyRenderer<>("name")));
    radiogroupContainer = new RadioGroup();
    radiogroupContainer.setFieldLabel(I18N.CONSTANTS.type());
    labelDatabase = new LabelField(I18N.CONSTANTS.database());
    labelDatabase.setWidth(100);
    labelDatabaseName = new LabelField();
    radioDatabase = new Radio();
    radioDatabase.setFieldLabel(I18N.CONSTANTS.database());
    radioDatabase.addListener(Events.Change, be -> setState());
    radiogroupContainer.add(radioDatabase);
    panelDatabase = new HorizontalPanel();
    panelDatabase.add(labelDatabase);
    panelDatabase.add(radioDatabase);
    panelDatabase.add(labelDatabaseName);
    fieldsetContainer.add(panelDatabase);
    radioFolder = new Radio();
    radioFolder.setFieldLabel(I18N.CONSTANTS.folder());
    radioFolder.addListener(Events.Change, be -> setState());
    labelFolder = new LabelField(I18N.CONSTANTS.folder());
    labelFolder.setWidth(100);
    panelFolder = new HorizontalPanel();
    panelFolder.add(labelFolder);
    panelFolder.add(radioFolder);
    panelFolder.add(comboBoxFolder);
    panelFolder.add(panelFolder);
    fieldsetContainer.add(panelFolder);
    radiogroupContainer.add(radioFolder);
    radioActivity = new Radio();
    radioActivity.setFieldLabel(I18N.CONSTANTS.activity());
    radioActivity.addListener(Events.Change, be -> setState());
    labelActivity = new LabelField(I18N.CONSTANTS.activity());
    labelActivity.setWidth(100);
    panelActivity = new HorizontalPanel();
    panelActivity.add(labelActivity);
    panelActivity.add(radioActivity);
    panelActivity.add(comboboxActivities);
    fieldsetContainer.add(panelActivity);
    radiogroupContainer.add(radioActivity);
    radioProject = new Radio();
    radioProject.setFieldLabel(I18N.CONSTANTS.project());
    radioProject.addListener(Events.Change, be -> setState());
    labelProject = new LabelField(I18N.CONSTANTS.project());
    labelProject.setWidth(100);
    panelProject = new HorizontalPanel();
    panelProject.add(labelProject);
    panelProject.add(radioProject);
    panelProject.add(comboboxProjects);
    fieldsetContainer.add(panelProject);
    radiogroupContainer.add(radioProject);
    add(fieldsetContainer);
    textfieldName = new TextField<>();
    textfieldName.setFieldLabel(I18N.CONSTANTS.name());
    textfieldName.setAllowBlank(false);
    add(textfieldName);
    checkboxEnabled = new CheckBox();
    checkboxEnabled.setFieldLabel(I18N.CONSTANTS.enabledColumn());
    add(checkboxEnabled);
    datefieldToDate = new DateField();
    datefieldFromDate = new DateField();
    datefieldFromDate.setFieldLabel(I18N.CONSTANTS.fromDate());
    datefieldFromDate.setAllowBlank(false);
    datefieldFromDate.setValidator((field, value) -> {
        if (datefieldFromDate.getValue().after(datefieldToDate.getValue())) {
            return I18N.CONSTANTS.fromDateIsBeforeToDate();
        }
        return null;
    });
    add(datefieldFromDate);
    datefieldToDate.setFieldLabel(I18N.CONSTANTS.toDate());
    datefieldToDate.setAllowBlank(false);
    add(datefieldToDate);
    radiogroupContainer.addListener(Events.Change, be -> {
        comboboxActivities.setAllowBlank(!radioActivity.getValue());
        comboboxProjects.setAllowBlank(!radioProject.getValue());
        comboboxActivities.clearInvalid();
        comboboxProjects.clearInvalid();
    });
    Scheduler.get().scheduleDeferred(this::setState);
}
Also used : ModelPropertyRenderer(com.extjs.gxt.ui.client.widget.ModelPropertyRenderer) HorizontalPanel(com.extjs.gxt.ui.client.widget.HorizontalPanel)

Example 5 with HorizontalPanel

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

the class SearchResultItem method setChilds.

public void setChilds(List<Axis> childList) {
    for (Axis axis : childList) {
        VerticalPanel panelAll = new VerticalPanel();
        HorizontalPanel panelChild = new HorizontalPanel();
        HorizontalPanel spacer = new HorizontalPanel();
        spacer.setWidth(20);
        panelChild.add(spacer);
        Image image = IconImageBundle.ICONS.activity().createImage();
        panelChild.add(image);
        panelAll.add(panelChild);
        EntityCategory activity = (EntityCategory) axis.getCategory();
        Hyperlink link = new Hyperlink(axis.getLabel(), PageStateSerializer.serialize(new DataEntryPlace(Filter.filter().onActivity(activity.getId()))));
        link.setStylePrimaryName("link");
        panelChild.add(link);
        for (Axis childAxis : axis.getChildren()) {
            HorizontalPanel panelIndicator = new HorizontalPanel();
            HorizontalPanel spacerIndicator = new HorizontalPanel();
            spacerIndicator.setWidth(40);
            panelIndicator.add(spacerIndicator);
            panelIndicator.add(IconImageBundle.ICONS.indicator().createImage());
            // Hyperlink linkIndicator = new Hyperlink(childAxis.getLabel(),
            // "site-grid/" +
            // ((EntityCategory)childAxis.getCategory()).getId());
            // linkIndicator.setStylePrimaryName("link");
            // panelIndicator.add(linkIndicator);
            LabelField labelIndicator = new LabelField(childAxis.getLabel());
            panelIndicator.add(labelIndicator);
            panelAll.add(panelIndicator);
            indicatorCount++;
        }
        activityCount++;
        childPanel.add(panelAll);
    }
}
Also used : VerticalPanel(com.extjs.gxt.ui.client.widget.VerticalPanel) DataEntryPlace(org.activityinfo.client.page.entry.place.DataEntryPlace) HorizontalPanel(com.extjs.gxt.ui.client.widget.HorizontalPanel) Image(com.google.gwt.user.client.ui.Image) EntityCategory(org.activityinfo.shared.report.content.EntityCategory) LabelField(com.extjs.gxt.ui.client.widget.form.LabelField) Axis(org.activityinfo.shared.report.content.PivotTableData.Axis) Hyperlink(com.google.gwt.user.client.ui.Hyperlink)

Aggregations

HorizontalPanel (com.extjs.gxt.ui.client.widget.HorizontalPanel)5 LabelField (com.extjs.gxt.ui.client.widget.form.LabelField)4 FieldEvent (com.extjs.gxt.ui.client.event.FieldEvent)1 ModelPropertyRenderer (com.extjs.gxt.ui.client.widget.ModelPropertyRenderer)1 VerticalPanel (com.extjs.gxt.ui.client.widget.VerticalPanel)1 CheckBox (com.extjs.gxt.ui.client.widget.form.CheckBox)1 DateField (com.extjs.gxt.ui.client.widget.form.DateField)1 FieldSet (com.extjs.gxt.ui.client.widget.form.FieldSet)1 Radio (com.extjs.gxt.ui.client.widget.form.Radio)1 RadioGroup (com.extjs.gxt.ui.client.widget.form.RadioGroup)1 Hyperlink (com.google.gwt.user.client.ui.Hyperlink)1 Image (com.google.gwt.user.client.ui.Image)1 DataEntryPlace (org.activityinfo.client.page.entry.place.DataEntryPlace)1 ActivityDTO (org.activityinfo.shared.dto.ActivityDTO)1 ProjectDTO (org.activityinfo.shared.dto.ProjectDTO)1 EntityCategory (org.activityinfo.shared.report.content.EntityCategory)1 Axis (org.activityinfo.shared.report.content.PivotTableData.Axis)1