Search in sources :

Example 36 with FormLayout

use of com.extjs.gxt.ui.client.widget.layout.FormLayout in project geo-platform by geosdi.

the class GPPrintWidget method addCheckPrintBaseMap.

private void addCheckPrintBaseMap() {
    fieldSet = new FieldSet();
    fieldSet.setHeadingHtml(INSTANCE.GPPrintWidget_checkPrintFieldSetHeadingText());
    FormLayout layout = new FormLayout();
    layout.setLabelWidth(100);
    layout.setLabelPad(5);
    fieldSet.setLayout(layout);
    this.checkPrintBaseMap = new CheckBox();
    this.checkPrintBaseMap.setFieldLabel(INSTANCE.GPPrintWidget_checkBoxPrintBaseMapFieldLabelText());
    this.checkPrintBaseMap.setToolTip(INSTANCE.GPPrintWidget_checkBoxPrintBaseMapTooltipText());
    fieldSet.add(this.checkPrintBaseMap);
    super.formPanel.add(fieldSet);
}
Also used : FormLayout(com.extjs.gxt.ui.client.widget.layout.FormLayout) FieldSet(com.extjs.gxt.ui.client.widget.form.FieldSet) CheckBox(com.extjs.gxt.ui.client.widget.form.CheckBox)

Example 37 with FormLayout

use of com.extjs.gxt.ui.client.widget.layout.FormLayout in project geo-platform by geosdi.

the class GPPrintWidget method addScaleCombo.

private void addScaleCombo() {
    fieldSet = new FieldSet();
    fieldSet.setHeadingHtml(INSTANCE.GPPrintWidget_scaleFieldSetHeadingText());
    FormLayout layout = new FormLayout();
    layout.setLabelWidth(100);
    layout.setLabelPad(5);
    fieldSet.setLayout(layout);
    this.storeScale = new ListStore<Scale>();
    this.storeScale.add(PrintUtility.getScale());
    this.comboScale = new ComboBox<Scale>();
    this.comboScale.setFieldLabel(INSTANCE.GPPrintWidget_comboScaleFieldLabelText());
    // this.comboScale.setEmptyText("Choose Scale....");
    this.comboScale.setValue(new Scale("1:4.000.000"));
    this.comboScale.setDisplayField(Scale.ScaleEnum.SCALE.getValue());
    this.comboScale.setEditable(false);
    this.comboScale.setAllowBlank(false);
    this.comboScale.setForceSelection(true);
    this.comboScale.setTypeAhead(true);
    this.comboScale.setTriggerAction(TriggerAction.ALL);
    this.comboScale.setStore(this.storeScale);
    fieldSet.add(this.comboScale);
    super.formPanel.add(fieldSet);
    comboScale.addSelectionChangedListener(new SelectionChangedListener<Scale>() {

        @Override
        public void selectionChanged(SelectionChangedEvent<Scale> se) {
            if (se != null) {
                if (GPApplicationMap.getInstance().getApplicationMap().getMap().getLayerByName(PRINT_VECTOR_NAME) != null) {
                    printExtent.removeAllFeatures();
                    String scaleString = se.getSelectedItem().getScale();
                    String scaleStringRight = scaleString.substring(scaleString.indexOf(":") + 1);
                    String scaleStringWithoutDot = scaleStringRight.replaceAll("\\.", "");
                    float scale = Float.parseFloat(scaleStringWithoutDot);
                    printExtent.addFeature(PrintUtility.updateRectangle(GPApplicationMap.getInstance().getApplicationMap().getMap().getCenter(), scale, GPApplicationMap.getInstance().getApplicationMap().getMap(), sizeFactor, rotation));
                }
            }
        }
    });
}
Also used : FormLayout(com.extjs.gxt.ui.client.widget.layout.FormLayout) FieldSet(com.extjs.gxt.ui.client.widget.form.FieldSet) Scale(org.geosdi.geoplatform.gui.client.model.Scale)

Example 38 with FormLayout

use of com.extjs.gxt.ui.client.widget.layout.FormLayout in project geo-platform by geosdi.

the class INCQLButton method initialize.

@Override
protected void initialize() {
    formData = new FormData("98%");
    final CQLLayerAttributesComboBox attributesComboBox = new CQLLayerAttributesComboBox(this.treePanel);
    attributesComboBox.setFieldLabel(LayerFiltersModuleConstants.INSTANCE.INCQLButton_attributeLabelText());
    this.parameter1.setFieldLabel(LayerFiltersModuleConstants.INSTANCE.INCQLButton_parameter1LabelText());
    this.parameter2.setFieldLabel(LayerFiltersModuleConstants.INSTANCE.INCQLButton_parameter2LabelText());
    this.parameterPanel.setHeaderVisible(Boolean.FALSE);
    this.parameterPanel.add(parameter1, formData);
    this.parameterPanel.add(parameter2, formData);
    this.fieldList.add(parameter1);
    this.fieldList.add(parameter2);
    this.insertButton = new Button(ButtonsConstants.INSTANCE.insertText(), new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent be) {
            String attribute = null;
            if (attributesComboBox.getValue() != null) {
                attribute = attributesComboBox.getValue().get(GPAttributeKey.ATTRIBUTE_VALUE.toString()).toString();
            }
            attribute = attribute != null ? attribute + " " : "";
            StringBuilder stringToInsert = new StringBuilder(attribute);
            stringToInsert.append("IN(");
            boolean isFirstIteration = true;
            for (GPSecureStringTextField textField : fieldList) {
                String parameterValue = textField.getValue();
                if (isFirstIteration) {
                    stringToInsert.append(parameterValue);
                    isFirstIteration = false;
                } else {
                    stringToInsert.append(", ");
                    stringToInsert.append(parameterValue);
                }
            }
            stringToInsert.append(")");
            INCQLButton.super.insertTextIntoFilterArea(stringToInsert.toString());
            window.hide();
        }
    });
    super.window = new GeoPlatformWindow(true) {

        @Override
        public void addComponent() {
            add(new Label(LayerFiltersModuleConstants.INSTANCE.INCQLButton_windowResultLabelText()));
            add(attributesComboBox, formData);
            add(parameterPanel, formData);
            Button addExpressionButton = new Button(LayerFiltersModuleConstants.INSTANCE.INCQLButton_windowAddParameterButtonText());
            addExpressionButton.setIcon(AbstractImagePrototype.create(BasicWidgetResources.ICONS.done()));
            addExpressionButton.setToolTip(LayerFiltersModuleConstants.INSTANCE.INCQLButton_windowExpressionTooltipText());
            addExpressionButton.addSelectionListener(new SelectionListener<ButtonEvent>() {

                @Override
                public void componentSelected(ButtonEvent ce) {
                    INCQLButton.this.addParameterFieldRow();
                }
            });
            add(addExpressionButton);
            add(new Label(LayerFiltersModuleConstants.INSTANCE.INCQLButton_windowResultLabelText()));
            insertButton.disable();
            addButton(insertButton);
        }

        @Override
        public void initSize() {
            super.setSize("370", "350");
        }

        @Override
        public void setWindowProperties() {
            super.setHeadingHtml(LayerFiltersModuleConstants.INSTANCE.INCQLButton_windowHeadingText());
            super.setLayout(new FormLayout());
        }
    };
    this.keyUplistener = new Listener<BaseEvent>() {

        @Override
        public void handleEvent(BaseEvent be) {
            for (GPSecureStringTextField textField : fieldList) {
                String parameterValue = textField.getValue();
                if (parameterValue == null || parameterValue.isEmpty()) {
                    insertButton.disable();
                    return;
                }
            }
            insertButton.enable();
        }
    };
    parameter1.addListener(Events.OnKeyUp, keyUplistener);
    parameter2.addListener(Events.OnKeyUp, keyUplistener);
    attributesComboBox.addSelectionChangedListener(new SelectionChangedListener<GPLayerAttributes>() {

        @Override
        public void selectionChanged(SelectionChangedEvent<GPLayerAttributes> se) {
            keyUplistener.handleEvent(se);
        }
    });
    super.initialized = Boolean.TRUE;
}
Also used : FormData(com.extjs.gxt.ui.client.widget.layout.FormData) FormLayout(com.extjs.gxt.ui.client.widget.layout.FormLayout) GPSecureStringTextField(org.geosdi.geoplatform.gui.configuration.GPSecureStringTextField) GPLayerAttributes(org.geosdi.geoplatform.gui.model.tree.GPLayerAttributes) Label(com.extjs.gxt.ui.client.widget.Label) BaseEvent(com.extjs.gxt.ui.client.event.BaseEvent) GeoPlatformWindow(org.geosdi.geoplatform.gui.client.widget.GeoPlatformWindow) Button(com.extjs.gxt.ui.client.widget.button.Button) ButtonEvent(com.extjs.gxt.ui.client.event.ButtonEvent) CQLLayerAttributesComboBox(org.geosdi.geoplatform.gui.client.widget.cql.combobox.CQLLayerAttributesComboBox) SelectionListener(com.extjs.gxt.ui.client.event.SelectionListener)

Example 39 with FormLayout

use of com.extjs.gxt.ui.client.widget.layout.FormLayout in project geo-platform by geosdi.

the class TimeInputWidget method setWindowProperties.

@Override
public void setWindowProperties() {
    super.setHeadingHtml("Time Filter Composition");
    super.setLayout(new FormLayout());
    super.setModal(true);
}
Also used : FormLayout(com.extjs.gxt.ui.client.widget.layout.FormLayout)

Example 40 with FormLayout

use of com.extjs.gxt.ui.client.widget.layout.FormLayout in project geo-platform by geosdi.

the class CSWServerFormWidget method createFieldSet.

private void createFieldSet() {
    fieldSet = new FieldSet();
    fieldSet.setHeadingHtml(CatalogFinderConstants.INSTANCE.CSWServerFormWidget_fieldSetHeadingText());
    FormLayout layout = new FormLayout();
    layout.setLabelWidth(70);
    layout.setDefaultWidth(250);
    fieldSet.setLayout(layout);
    aliasField = new GPSecureStringTextField();
    aliasField.setFieldLabel(CatalogFinderConstants.INSTANCE.CSWServerFormWidget_aliasFieldLabelText());
    aliasField.setEmptyText(CatalogFinderConstants.INSTANCE.CSWServerFormWidget_aliasEmptyText());
    aliasField.setToolTip(CatalogFinderConstants.INSTANCE.CSWServerFormWidget_aliasTooltipText());
    aliasField.setAllowBlank(false);
    aliasField.setAutoValidate(true);
    urlField = new GPSecureStringTextField();
    urlField.setFieldLabel(CatalogFinderConstants.INSTANCE.CSWServerFormWidget_urlFieldLabelText());
    urlField.setEmptyText(CatalogFinderConstants.INSTANCE.CSWServerFormWidget_urlEmptyText());
    urlField.setToolTip(CatalogFinderConstants.INSTANCE.CSWServerFormWidget_urlTooltipText());
    urlField.setAllowBlank(false);
    urlField.setAutoValidate(true);
    urlField.setValidator(new Validator() {

        @Override
        public String validate(Field<?> field, String value) {
            if (!value.startsWith("http://") && !value.startsWith("https://")) {
                return CatalogFinderConstants.INSTANCE.CSWServerFormWidget_urlValidateMessageText();
            }
            urlEncoding = deleteQueryStringFromURL(value.trim());
            return null;
        }
    });
    fieldSet.add(aliasField);
    fieldSet.add(urlField);
    formPanel.add(fieldSet);
}
Also used : FormLayout(com.extjs.gxt.ui.client.widget.layout.FormLayout) GPSecureStringTextField(org.geosdi.geoplatform.gui.configuration.GPSecureStringTextField)

Aggregations

FormLayout (com.extjs.gxt.ui.client.widget.layout.FormLayout)61 FieldSet (com.extjs.gxt.ui.client.widget.form.FieldSet)37 FormPanel (com.extjs.gxt.ui.client.widget.form.FormPanel)29 FormData (com.extjs.gxt.ui.client.widget.layout.FormData)26 Button (com.extjs.gxt.ui.client.widget.button.Button)24 ButtonEvent (com.extjs.gxt.ui.client.event.ButtonEvent)19 FlowLayout (com.extjs.gxt.ui.client.widget.layout.FlowLayout)18 SelectionListener (com.extjs.gxt.ui.client.event.SelectionListener)15 GPSecureStringTextField (org.geosdi.geoplatform.gui.configuration.GPSecureStringTextField)15 FitLayout (com.extjs.gxt.ui.client.widget.layout.FitLayout)12 BaseEvent (com.extjs.gxt.ui.client.event.BaseEvent)11 LabelField (com.extjs.gxt.ui.client.widget.form.LabelField)10 NumberField (com.extjs.gxt.ui.client.widget.form.NumberField)9 CheckBox (com.extjs.gxt.ui.client.widget.form.CheckBox)7 TextField (com.extjs.gxt.ui.client.widget.form.TextField)7 ComponentEvent (com.extjs.gxt.ui.client.event.ComponentEvent)6 Margins (com.extjs.gxt.ui.client.util.Margins)6 Label (com.extjs.gxt.ui.client.widget.Label)6 Radio (com.extjs.gxt.ui.client.widget.form.Radio)6 RadioGroup (com.extjs.gxt.ui.client.widget.form.RadioGroup)6