use of com.extjs.gxt.ui.client.widget.layout.ColumnData in project geo-platform by geosdi.
the class CatalogSearchWidget method onRender.
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
LayoutContainer left = new LayoutContainer();
left.setLayout(new ColumnLayout());
Label searchLabel = new Label(CatalogFinderConstants.INSTANCE.CatalogSearchWidget_searchLabelText());
searchLabel.setStyleName("catalogSearch-Label");
left.add(searchLabel, new ColumnData(300.0));
HorizontalPanel panel = new HorizontalPanel();
panel.setStyleAttribute("padding-top", "8px");
searchTextField = new GPSecureStringTextField();
searchTextField.setWidth(250);
searchTextField.addKeyListener(new KeyListener() {
@Override
public void componentKeyPress(ComponentEvent event) {
if (searchButton.isEnabled() && event.getKeyCode() == KeyCodes.KEY_ENTER) {
searchButton.fireEvent(Events.Select);
}
}
@Override
public void componentKeyUp(ComponentEvent event) {
if (searchTextField.getValue() == null) {
if (event.getKeyCode() == KeyCodes.KEY_BACKSPACE || event.getKeyCode() == KeyCodes.KEY_DELETE) {
resetSearch();
}
}
}
});
panel.add(searchTextField);
searchButton = new Button(ButtonsConstants.INSTANCE.searchText(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
String searchText = searchTextField.getValue();
if (searchText != null && !optionsCheckboxgroup.isValid(true)) {
GeoPlatformMessage.alertMessage(CatalogFinderConstants.INSTANCE.CatalogSearchWidget_errorSearchTitleText(), CatalogFinderMessages.INSTANCE.CatalogSearchWidget_errorSearchBodyMessage(searchText));
return;
}
// Manual binding
textInfo.setText(searchText);
textInfo.setSearchTitle(titleCheckbox.getValue().booleanValue());
textInfo.setSearchAbstract(abstractCheckbox.getValue().booleanValue());
textInfo.setSearchSubjects(subjectsCheckbox.getValue().booleanValue());
// Performing the search
recordsContainer.searchRecords();
}
});
searchButton.setStyleAttribute("margin-left", "20px");
searchButton.disable();
panel.add(searchButton);
left.add(panel);
// Search Panel - Right
LayoutContainer right = new LayoutContainer();
right.setLayout(new ColumnLayout());
Label optionsLabel = new Label(CatalogFinderConstants.INSTANCE.CatalogSearchWidget_optionsLabelText());
optionsLabel.setStyleName("catalogOptions-Label");
right.add(optionsLabel, new ColumnData(240.0));
optionsCheckboxgroup = new CheckBoxGroup();
optionsCheckboxgroup.setOrientation(Orientation.VERTICAL);
optionsCheckboxgroup.setValidator(new Validator() {
@Override
public String validate(Field<?> field, String value) {
CheckBoxGroup group = (CheckBoxGroup) field;
if (group.getValue() == null) {
return CatalogFinderConstants.INSTANCE.CatalogSearchWidget_optionsCheckboxValidateText();
}
return null;
}
});
Listener<FieldEvent> checkBoxListener = new Listener<FieldEvent>() {
@Override
public void handleEvent(FieldEvent fe) {
manageAllSelectedCheckbox();
}
};
titleCheckbox = new CheckBox();
titleCheckbox.setBoxLabel(CatalogFinderConstants.INSTANCE.CatalogSearchWidget_titleLabelText());
// Enabled by default
titleCheckbox.setValue(true);
titleCheckbox.addListener(Events.Change, checkBoxListener);
optionsCheckboxgroup.add(titleCheckbox);
abstractCheckbox = new CheckBox();
abstractCheckbox.setBoxLabel(CatalogFinderConstants.INSTANCE.CatalogSearchWidget_abstractLabelText());
// Enabled by default
abstractCheckbox.setValue(true);
abstractCheckbox.addListener(Events.Change, checkBoxListener);
optionsCheckboxgroup.add(abstractCheckbox);
subjectsCheckbox = new CheckBox();
subjectsCheckbox.setBoxLabel(CatalogFinderConstants.INSTANCE.CatalogSearchWidget_keywordsLabelText());
// Enabled by default
subjectsCheckbox.setValue(true);
subjectsCheckbox.addListener(Events.Change, checkBoxListener);
optionsCheckboxgroup.add(subjectsCheckbox);
right.add(optionsCheckboxgroup);
allSelectedCheckbox = new CheckBox();
allSelectedCheckbox.setBoxLabel(CatalogFinderConstants.INSTANCE.CatalogSearchWidget_allSelectLabelText());
// Enabled by default
allSelectedCheckbox.setValue(true);
allSelectedCheckbox.addListener(Events.Change, new Listener<FieldEvent>() {
@Override
public void handleEvent(FieldEvent fe) {
Boolean allSelected = (Boolean) fe.getValue();
titleCheckbox.setValue(allSelected);
abstractCheckbox.setValue(allSelected);
subjectsCheckbox.setValue(allSelected);
}
});
right.add(allSelectedCheckbox);
add(left, new ColumnData(0.6));
add(right, new ColumnData(0.4));
}
use of com.extjs.gxt.ui.client.widget.layout.ColumnData in project geo-platform by geosdi.
the class TimePeriodFormPanel method buildTimeTimension.
/**
*/
private void buildTimeTimension() {
HorizontalPanel buttonsContainer = new HorizontalPanel();
buttonsContainer.setSpacing(2);
this.periodSlider = new Slider() {
@Override
public void setValue(int value) {
if (value >= 0 && !partialStore.isEmpty()) {
super.setValue(value);
currentValue = value;
super.setMessage("" + fmt.format(partialStore.get(currentValue)));
labelCurrenteTime.setValue(fmt.format(partialStore.get(currentValue)));
saveLayer(sdf.format(partialStore.get(currentValue), TimeZone.createTimeZone(0)).concat(".000Z"));
enableOnPlaying();
}
}
};
this.periodSlider.setIncrement(1);
this.periodSlider.setUseTip(Boolean.TRUE);
this.periodSlider.setDraggable(Boolean.FALSE);
this.playButton.setToolTip(ButtonsConstants.INSTANCE.playText());
this.reversePlayButton.setToolTip(ButtonsConstants.INSTANCE.playReverseText());
this.forwardPlayButton.setToolTip(ButtonsConstants.INSTANCE.nextText());
this.backwardButton.setToolTip(ButtonsConstants.INSTANCE.prevText());
this.addListener();
this.playButton.addSelectionListener(this.periodPlaySelectioListener);
this.reversePlayButton.addSelectionListener(this.periodReversePlaySelectioListener);
buttonsContainer.add((this.backwardButton));
buttonsContainer.add((this.reversePlayButton));
buttonsContainer.add((this.playButton));
buttonsContainer.add((this.forwardPlayButton));
this.periodSliderContainer.setLayout(new ColumnLayout());
this.periodSliderContainer.add(buttonsContainer, new ColumnData(.3));
this.periodSliderContainer.add(this.periodSlider, new ColumnData(.7));
this.periodSlider.setAutoWidth(Boolean.TRUE);
super.add(this.periodSliderContainer);
}
use of com.extjs.gxt.ui.client.widget.layout.ColumnData in project geo-platform by geosdi.
the class TimePeriodFormPanel method addComponents.
/**
*/
private void addComponents() {
super.setHeaderVisible(Boolean.FALSE);
super.setFrame(Boolean.TRUE);
super.setBorders(Boolean.FALSE);
super.setHeight(WIDGET_HEIGHT);
super.setAutoWidth(Boolean.TRUE);
this.labelRange = new LabelField();
this.labelPeriod = new LabelField();
this.labelPeriod.addStyleName("label_period");
this.labelRange.addStyleName("label_period");
this.labelRange.setFieldLabel(LayerModuleConstants.INSTANCE.LayerTimeFilterWidget_rangeLabelText());
this.labelPeriod.setFieldLabel(LayerModuleConstants.INSTANCE.LayerTimeFilterWidget_periodLabelText());
this.labelPeriod.setLabelSeparator(":");
this.labelRange.setLabelSeparator(":");
super.add(labelRange, new FlowData(5));
super.add(labelPeriod, new FlowData(5));
super.add(this.startDateMultifield, new FlowData(5));
this.endDateCheckBox = new CheckBox();
this.endDateCheckBox.setValue(true);
this.endDateCheckBox.setBoxLabel(LayerModuleConstants.INSTANCE.LayerTimeFilterWidget_enableToDate());
this.endDateCheckBox.addListener(Events.Change, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
endDateMultifield.setEnabled(endDateCheckBox.getValue());
endDateMultifield.reset();
endDateMultifield.clearInvalid();
refreshDateTo(!endDateCheckBox.getValue() ? ((Date) iStrategyView.getExtentValues().get(DATE_TO)) : null);
}
});
LayoutContainer container = new LayoutContainer();
container.setLayout(new ColumnLayout());
container.add(this.endDateCheckBox);
super.add(container, new FlowData(5));
super.add(this.endDateMultifield, new FlowData(5));
this.showAllCheckBox = new CheckBox();
this.showAllCheckBox.setValue(false);
this.showAllCheckBox.setBoxLabel(LayerModuleConstants.INSTANCE.LayerTimeFilterWidget_showAllTimeLayers());
this.showAllCheckBox.addListener(Events.Change, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
timerAnimation.setEnabled(!showAllCheckBox.getValue());
periodSlider.setEnabled(!showAllCheckBox.getValue());
}
});
LayoutContainer containerShow = new LayoutContainer();
containerShow.setLayout(new ColumnLayout());
containerShow.add(this.showAllCheckBox, new ColumnData(.3));
this.labelDates = new Label(DATE_SEPARATOR);
this.labelDates.setStyleAttribute("margin-top", "5px");
containerShow.add(this.labelDates, new ColumnData(.7));
super.add(containerShow, new FlowData(5));
// buildDatesAvailables();
this.labelCurrenteTime = new LabelField();
this.labelCurrenteTime.setFieldLabel(LayerModuleConstants.INSTANCE.LayerTimeFilterWidget_currentDateTooltipText());
this.labelCurrenteTime.setLabelSeparator(":");
this.timerAnimation = new SpinnerField();
this.timerAnimation.setFieldLabel(LayerModuleConstants.INSTANCE.LayerTimeFilterWidget_refreshTooltipText());
// this.timerAnimation.setWidth("76px");
this.timerAnimation.addStyleName("label_animation");
this.timerAnimation.setMinValue(1);
this.timerAnimation.setValue(1);
this.timerAnimation.setAllowBlank(Boolean.FALSE);
super.add(this.timerAnimation, new FlowData(5));
this.buildTimeTimension();
super.add(this.labelCurrenteTime, new FlowData(5));
this.labelStep = new LabelField();
this.labelStep.setFieldLabel(LayerModuleConstants.INSTANCE.LayerTimeFilterWidget_stepTooltipText());
this.labelStep.setLabelSeparator(":");
super.add(this.labelStep, new FlowData(5));
this.apply = new Button(ButtonsConstants.INSTANCE.applyText());
this.apply.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
validateForm();
}
});
super.addButton(this.apply);
Button close = new Button(ButtonsConstants.INSTANCE.closeText(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
stopPlayer();
WidgetPropertiesHandlerManager.fireEvent(new GPHideFilterWidgetEvent());
}
});
this.addButton(close);
}
Aggregations