use of org.geosdi.geoplatform.gui.client.widget.cql.combobox.CQLLayerAttributesComboBox in project geo-platform by geosdi.
the class BBOXCQLButton method initialize.
@Override
protected void initialize() {
formData = new FormData("98%");
final CQLLayerAttributesComboBox attributesComboBox = new CQLLayerAttributesComboBox(this.treePanel);
attributesComboBox.setFieldLabel(LayerFiltersModuleConstants.INSTANCE.BBOXCQLButton_attributeComboBoxLabelText());
this.minXField.setFieldLabel(LayerFiltersModuleConstants.INSTANCE.BBOXCQLButton_minXLabelText());
this.maxXField.setFieldLabel(LayerFiltersModuleConstants.INSTANCE.BBOXCQLButton_maxXLabelText());
this.minYField.setFieldLabel(LayerFiltersModuleConstants.INSTANCE.BBOXCQLButton_minYLabelText());
this.maxYField.setFieldLabel(LayerFiltersModuleConstants.INSTANCE.BBOXCQLButton_maxYLabelText());
final Button insertButton = new Button(ButtonsConstants.INSTANCE.insertText(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent be) {
String theGeom = attributesComboBox.getValue().get(GPAttributeKey.ATTRIBUTE_VALUE.toString()).toString();
BBOXCQLButton.super.insertTextIntoFilterArea("BBOX(" + theGeom + ", " + minXField.getValue() + ", " + maxXField.getValue() + ", " + minYField.getValue() + ", " + maxYField.getValue() + ")");
window.hide();
}
});
super.window = new GeoPlatformWindow(true) {
@Override
public void addComponent() {
add(new Label(LayerFiltersModuleConstants.INSTANCE.BBOXCQLButton_windowInsertParametersLabelText()));
add(attributesComboBox, formData);
add(minXField, formData);
add(minYField, formData);
add(maxXField, formData);
add(maxYField, formData);
add(new Label(LayerFiltersModuleConstants.INSTANCE.BBOXCQLButton_windowResultLabelText()));
insertButton.disable();
addButton(insertButton);
}
@Override
public void initSize() {
super.setSize("300", "280");
}
@Override
public void setWindowProperties() {
super.setHeadingHtml(LayerFiltersModuleConstants.INSTANCE.BBOXCQLButton_windowHeadingText());
super.setLayout(new FormLayout());
}
};
final Listener listener = new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
String theGeomValue = attributesComboBox.getValue().get(GPAttributeKey.ATTRIBUTE_VALUE.toString()).toString();
Number minXValue = minXField.getValue();
Number maxXValue = maxXField.getValue();
Number maxYValue = maxYField.getValue();
Number minYValue = minYField.getValue();
if (minXValue == null || minXValue.toString().isEmpty() || maxXValue == null || maxXValue.toString().isEmpty() || maxYValue == null || maxYValue.toString().isEmpty() || minYValue == null || minYValue.toString().isEmpty() || theGeomValue == null || theGeomValue.isEmpty()) {
insertButton.disable();
} else {
insertButton.enable();
}
}
};
minXField.addListener(Events.OnKeyUp, listener);
maxXField.addListener(Events.OnKeyUp, listener);
maxYField.addListener(Events.OnKeyUp, listener);
minYField.addListener(Events.OnKeyUp, listener);
attributesComboBox.addSelectionChangedListener(new SelectionChangedListener<GPLayerAttributes>() {
@Override
public void selectionChanged(SelectionChangedEvent<GPLayerAttributes> se) {
listener.handleEvent(se);
}
});
super.initialized = Boolean.TRUE;
}
use of org.geosdi.geoplatform.gui.client.widget.cql.combobox.CQLLayerAttributesComboBox in project geo-platform by geosdi.
the class CQLFilterAdvancedTab method addComponents.
@Override
public void addComponents() {
setSize(CQLFilterTabWidget.TAB_WIDGET_WIDTH, CQLFilterTabWidget.TAB_WIDGET_HEIGHT);
this.filterTextArea = new TextArea();
this.guideFilterWidget = new GuideFilterWidget(Boolean.TRUE);
HorizontalPanel uniqueValuePanel = new HorizontalPanel();
uniqueValuePanel.setSpacing(2);
final CQLUniqueValuesComboBox uniqueValueComboBox = new CQLUniqueValuesComboBox(this.treePanel);
uniqueValueComboBox.setEmptyText(LayerFiltersModuleConstants.INSTANCE.CQLFilterAdvancedTab_uniqueOperatorTooltipText());
uniqueValueComboBox.setEnabled(false);
uniqueValueComboBox.addSelectionChangedListener(new SelectionChangedListener<GPUniqueValues>() {
@Override
public void selectionChanged(SelectionChangedEvent<GPUniqueValues> se) {
GPUniqueValues gpUniqueValues = se.getSelectedItem();
if (gpUniqueValues != null) {
String uniqueValue = gpUniqueValues.get(GPUniqueValues.GPUniqueValueKey.UNIQUE_VALUE.toString()).toString();
if (isString)
uniqueValue = "'".concat(uniqueValue).concat("'");
insertTextIntoFilterArea(uniqueValue);
uniqueValueComboBox.reset();
}
}
});
uniqueValuePanel.add(uniqueValueComboBox);
HorizontalPanel functionPanel = new HorizontalPanel();
functionPanel.setSpacing(2);
final CQLLayerAttributesComboBox attributesComboBox = new CQLLayerAttributesComboBox(this.treePanel);
attributesComboBox.addSelectionChangedListener(new SelectionChangedListener<GPLayerAttributes>() {
@Override
public void selectionChanged(SelectionChangedEvent<GPLayerAttributes> se) {
GPLayerAttributes layerAttribute = se.getSelectedItem();
if (layerAttribute != null) {
insertTextIntoFilterArea(layerAttribute.get(GPAttributeKey.ATTRIBUTE_VALUE.toString()).toString());
attributesComboBox.reset();
uniqueValueComboBox.setEnabled(true);
isString = layerAttribute.get(GPAttributeKey.ATTRIBUTE_TYPE.toString()).toString().equals("java.lang.String");
uniqueValueComboBox.setLayerAttribute(layerAttribute.get(GPAttributeKey.ATTRIBUTE_VALUE.toString()).toString());
}
}
});
attributesComboBox.setEmptyText(LayerFiltersModuleConstants.INSTANCE.CQLFilterAdvancedTab_attributeEmptyText());
functionPanel.add(attributesComboBox);
final CQLLogicalOperatorComboBox logicalOperatorComboBox = new CQLLogicalOperatorComboBox();
logicalOperatorComboBox.setEmptyText(LayerFiltersModuleConstants.INSTANCE.CQLFilterAdvancedTab_logicalOperatorEmptyText());
logicalOperatorComboBox.addSelectionChangedListener(new SelectionChangedListener<LogicalOperator>() {
@Override
public void selectionChanged(SelectionChangedEvent<LogicalOperator> se) {
LogicalOperator logicalOperator = se.getSelectedItem();
if (logicalOperator != null) {
insertTextIntoFilterArea(logicalOperator.getKeyValue());
logicalOperatorComboBox.reset();
}
}
});
functionPanel.add(logicalOperatorComboBox);
final ListStore<CQLOperatorValue> operatorListStore = new ListStore<CQLOperatorValue>();
operatorListStore.add(CQLOperatorValue.getOperatorList());
final ComboBox<CQLOperatorValue> operatorComboBox = new ComboBox<CQLOperatorValue>();
operatorComboBox.setStore(operatorListStore);
operatorComboBox.setDisplayField(CQLOperatorValue.LimitConditionEnum.OPERATOR.toString());
operatorComboBox.setEditable(Boolean.FALSE);
operatorComboBox.setForceSelection(Boolean.TRUE);
operatorComboBox.setTypeAhead(Boolean.TRUE);
operatorComboBox.setTriggerAction(ComboBox.TriggerAction.ALL);
operatorComboBox.setEmptyText(LayerFiltersModuleConstants.INSTANCE.CQLFilterAdvancedTab_operatorEmptyText());
operatorComboBox.addSelectionChangedListener(new SelectionChangedListener<CQLOperatorValue>() {
@Override
public void selectionChanged(SelectionChangedEvent<CQLOperatorValue> se) {
CQLOperatorValue cQLOperatorValue = se.getSelectedItem();
if (cQLOperatorValue != null) {
insertTextIntoFilterArea(((CQLOperatorEnum) cQLOperatorValue.get(CQLOperatorValue.LimitConditionEnum.OPERATOR.toString())).getValue());
operatorComboBox.reset();
}
}
});
functionPanel.add(operatorComboBox);
HorizontalPanel symbolPanel = new HorizontalPanel();
symbolPanel.setSpacing(2);
Button openBracket = new Button("(", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("(");
}
});
symbolPanel.add(openBracket);
Button openSquareBracket = new Button("[", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("]");
}
});
symbolPanel.add(openSquareBracket);
Button closedBracket = new Button(")", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea(")");
}
});
symbolPanel.add(closedBracket);
Button closedSquareBracket = new Button("]", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("]");
}
});
symbolPanel.add(closedSquareBracket);
Button plusOperator = new Button("+", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("+");
}
});
symbolPanel.add(plusOperator);
Button minusOperator = new Button("-", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("-");
}
});
symbolPanel.add(minusOperator);
Button timesOperator = new Button("*", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("*");
}
});
symbolPanel.add(timesOperator);
Button divisionOperator = new Button("/", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("/");
}
});
symbolPanel.add(divisionOperator);
Button apexElement = new Button("'", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("'");
}
});
apexElement.setToolTip(LayerFiltersModuleConstants.INSTANCE.CQLFilterAdvancedTab_apexElementTooltipText());
symbolPanel.add(apexElement);
Button jollyCharacter = new Button("%", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("%");
}
});
jollyCharacter.setToolTip(LayerFiltersModuleConstants.INSTANCE.CQLFilterAdvancedTab_jollyCharacterTooltipText());
symbolPanel.add(jollyCharacter);
Button notOperator = new Button("NOT", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("NOT");
}
});
notOperator.setTitle(LayerFiltersModuleConstants.INSTANCE.CQLFilterAdvancedTab_notOperatorTooltipText());
symbolPanel.add(notOperator);
Button isNullOperator = new Button("IS NULL", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("IS NULL");
}
});
isNullOperator.setTitle(LayerFiltersModuleConstants.INSTANCE.CQLFilterAdvancedTab_isNullOperatorTooltipText());
symbolPanel.add(isNullOperator);
Button existOperator = new Button("EXIST", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("EXIST");
}
});
existOperator.setTitle(LayerFiltersModuleConstants.INSTANCE.CQLFilterAdvancedTab_existOperatorTooltipText());
symbolPanel.add(existOperator);
Button doesNotExistOperator = new Button("DOES-NOT-EXIST", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("DOES-NOT-EXIST");
}
});
doesNotExistOperator.setTitle(LayerFiltersModuleConstants.INSTANCE.CQLFilterAdvancedTab_doesNotExistOperatorTooltipText());
symbolPanel.add(doesNotExistOperator);
HorizontalPanel spatialPanel = new HorizontalPanel();
spatialPanel.setSpacing(2);
BetweenCQLButton betweenCQLButton = new BetweenCQLButton(filterTextArea);
spatialPanel.add(betweenCQLButton);
INCQLButton incqlb = new INCQLButton(filterTextArea, this.treePanel);
spatialPanel.add(incqlb);
BBOXCQLButton bboxcqlb = new BBOXCQLButton(filterTextArea, this.treePanel);
spatialPanel.add(bboxcqlb);
Button includeOperator = new Button("INCLUDE", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("INCLUDE");
}
});
includeOperator.setTitle(LayerFiltersModuleConstants.INSTANCE.CQLFilterAdvancedTab_includeOperatorTooltipText());
spatialPanel.add(includeOperator);
Button excludeOperator = new Button("EXCLUDE", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
insertTextIntoFilterArea("EXCLUDE");
}
});
excludeOperator.setTitle(LayerFiltersModuleConstants.INSTANCE.CQLFilterAdvancedTab_excludeOperatorTooltipText());
spatialPanel.add(excludeOperator);
TimeCQLButton timeCQLButton = new TimeCQLButton(filterTextArea);
spatialPanel.add(timeCQLButton);
Button infoButton = new Button("", AbstractImagePrototype.create(BasicWidgetResources.ICONS.info()), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
guideFilterWidget.show();
}
});
infoButton.setTitle(LayerFiltersModuleConstants.INSTANCE.CQLFilterAdvancedTab_cqlGuideTooltipText());
spatialPanel.add(infoButton);
super.add(symbolPanel);
super.add(spatialPanel);
super.add(functionPanel);
super.add(uniqueValuePanel);
this.filterTextArea.setSize(CQLFilterTabWidget.TAB_WIDGET_WIDTH, CQLFilterTabWidget.TAB_WIDGET_HEIGHT - 80);
super.add(this.filterTextArea, new FormData("98%"));
}
use of org.geosdi.geoplatform.gui.client.widget.cql.combobox.CQLLayerAttributesComboBox in project geo-platform by geosdi.
the class CQLFilterBasicRow method initializeRow.
private void initializeRow() {
attributesComboBox = new CQLLayerAttributesComboBox(this.treePanel);
attributesComboBox.addSelectionChangedListener(new SelectionChangedListener<GPLayerAttributes>() {
@Override
public void selectionChanged(SelectionChangedEvent<GPLayerAttributes> se) {
GPLayerAttributes layerAttribute = se.getSelectedItem();
if (layerAttribute != null) {
verifyAndProcessFieldValuesNotNull();
}
}
});
super.add(attributesComboBox);
this.logicalOperatorComboBox = new CQLLogicalOperatorComboBox();
this.logicalOperatorComboBox.setValue(this.logicalOperatorComboBox.getStore().getAt(0));
final ListStore<CQLOperatorValue> operatorListStore = new ListStore<CQLOperatorValue>();
operatorListStore.add(CQLOperatorValue.getOperatorList());
operatorComboBox = new ComboBox<CQLOperatorValue>();
operatorComboBox.setStore(operatorListStore);
operatorComboBox.setDisplayField(CQLOperatorValue.LimitConditionEnum.OPERATOR.toString());
operatorComboBox.setEditable(Boolean.FALSE);
operatorComboBox.setForceSelection(Boolean.TRUE);
operatorComboBox.setTypeAhead(Boolean.TRUE);
operatorComboBox.setTriggerAction(ComboBox.TriggerAction.ALL);
this.operatorComboBox.setValue(operatorListStore.getAt(0));
operatorComboBox.addSelectionChangedListener(new SelectionChangedListener<CQLOperatorValue>() {
@Override
public void selectionChanged(SelectionChangedEvent<CQLOperatorValue> se) {
CQLOperatorValue limitConditionValue = se.getSelectedItem();
if (limitConditionValue != null) {
verifyAndProcessFieldValuesNotNull();
}
}
});
operatorComboBox.setWidth("80");
super.add(operatorComboBox);
this.conditionValueTextfield = new GPSecureStringTextField();
this.conditionValueTextfield.addListener(Events.Change, new Listener<FieldEvent>() {
@Override
public void handleEvent(FieldEvent be) {
verifyAndProcessFieldValuesNotNull();
}
});
super.add(conditionValueTextfield);
}
use of org.geosdi.geoplatform.gui.client.widget.cql.combobox.CQLLayerAttributesComboBox 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;
}
Aggregations