use of com.extjs.gxt.ui.client.widget.layout.FormLayout in project geo-platform by geosdi.
the class GeocodingGridWidget method initFormPanel.
private void initFormPanel() {
formPanel = new FormPanel();
formPanel.setHeaderVisible(false);
formPanel.setFrame(true);
formPanel.setLayout(new FlowLayout());
searchFieldSet = new FieldSet();
searchFieldSet.setHeadingHtml(GeocodingModuleConstants.INSTANCE.GeocodingGridWidget_searchFieldHeadingText());
FormLayout layout = new FormLayout();
layout.setLabelWidth(60);
searchFieldSet.setLayout(layout);
addSearchTextField();
addComboGeocodingServices();
formPanel.add(searchFieldSet);
locations = new FieldSet();
locations.setHeadingHtml(GeocodingModuleConstants.INSTANCE.GeocodingGridWidget_locationsFieldHeadingText());
locations.setCollapsible(true);
locations.add(this.grid);
formPanel.add(locations);
}
use of com.extjs.gxt.ui.client.widget.layout.FormLayout in project geo-platform by geosdi.
the class LoadKmlFromUrlWidget method addComponentToForm.
@Override
public void addComponentToForm() {
super.fieldSet = new FieldSet();
super.fieldSet.setHeadingHtml(LayerModuleConstants.INSTANCE.LoadKmlFromUrlWidget_fieldSetHeadingText());
FormLayout layout = new FormLayout();
layout.setLabelWidth(40);
super.fieldSet.setLayout(layout);
urlText = new GPSecureStringTextField();
urlText.setFieldLabel(LayerModuleConstants.INSTANCE.urlLabelText());
this.addListenerToUrlText();
super.fieldSet.add(urlText);
super.getFormPanel().add(super.fieldSet);
super.saveStatus = new KmlUrlStatus();
super.saveStatus.setAutoWidth(true);
super.getFormPanel().getButtonBar().add(super.saveStatus);
super.getFormPanel().setButtonAlign(HorizontalAlignment.RIGHT);
buttonAdd = new Button(ButtonsConstants.INSTANCE.addText(), AbstractImagePrototype.create(LayerResources.ICONS.addRasterLayer()), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
execute();
}
});
buttonAdd.setEnabled(false);
super.getFormPanel().addButton(buttonAdd);
Button buttonCancel = new Button(ButtonsConstants.INSTANCE.cancelText(), AbstractImagePrototype.create(BasicWidgetResources.ICONS.cancel()), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
clearComponents();
}
});
super.getFormPanel().addButton(buttonCancel);
setFocusWidget(urlText);
}
use of com.extjs.gxt.ui.client.widget.layout.FormLayout 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 com.extjs.gxt.ui.client.widget.layout.FormLayout in project geo-platform by geosdi.
the class BetweenCQLButton method initialize.
@Override
protected void initialize() {
this.formData = new FormData("98%");
this.comparisonParameter.setFieldLabel(LayerFiltersModuleConstants.INSTANCE.BetweenCQLButton_comparisonLabelText());
this.firstParameter.setFieldLabel(LayerFiltersModuleConstants.INSTANCE.BetweenCQLButton_firstParameterLabelText());
this.secondParameter.setFieldLabel(LayerFiltersModuleConstants.INSTANCE.BetweenCQLButton_secondParameterLabelText());
final Button insertButton = new Button(ButtonsConstants.INSTANCE.insertText(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent be) {
BetweenCQLButton.super.insertTextIntoFilterArea(comparisonParameter.getValue() + " BETWEEN " + firstParameter.getValue() + " AND " + secondParameter.getValue());
window.hide();
}
});
super.window = new GeoPlatformWindow(true) {
@Override
public void addComponent() {
add(new Label(LayerFiltersModuleConstants.INSTANCE.BetweenCQLButton_windowInsertLabelText()));
add(comparisonParameter, formData);
add(firstParameter, formData);
add(secondParameter, formData);
add(new Label(LayerFiltersModuleConstants.INSTANCE.BetweenCQLButton_windowResultLabelText()));
insertButton.disable();
addButton(insertButton);
}
@Override
public void initSize() {
super.setSize("300", "220");
}
@Override
public void setWindowProperties() {
super.setHeadingHtml(LayerFiltersModuleConstants.INSTANCE.BetweenCQLButton_windowHeadingText());
super.setLayout(new FormLayout());
}
};
Listener listener = new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
String comparisonValue = comparisonParameter.getValue();
String firstValue = firstParameter.getValue();
String secondValue = secondParameter.getValue();
if (comparisonValue == null || comparisonValue.trim().equals("") || firstValue == null || firstValue.trim().equals("") || secondValue == null || secondValue.trim().equals("")) {
insertButton.disable();
} else {
insertButton.enable();
}
}
};
comparisonParameter.addListener(Events.OnKeyUp, listener);
firstParameter.addListener(Events.OnKeyUp, listener);
secondParameter.addListener(Events.OnKeyUp, listener);
super.initialized = Boolean.TRUE;
}
use of com.extjs.gxt.ui.client.widget.layout.FormLayout in project jahia by Jahia.
the class DistributionServerWindow method onRender.
@Override
protected void onRender(Element parent, int pos) {
super.onRender(parent, pos);
addStyleName("distribution-server-window");
setLayout(new FitLayout());
setHeadingHtml(Messages.get("label.releaseModule.distributionServer", "Distribution server (Maven)"));
setModal(true);
setWidth(500);
setHeight(380);
VerticalPanel p = new VerticalPanel();
p.add(new Label(Messages.get("label.releaseModule.distributionServer.notProvided", "No target distribution server configured for this module yet.")));
p.add(new HTML("<br/>"));
p.add(new Label(Messages.get("label.releaseModule.distributionServer.purpose", "A target distribution server is a Maven repository," + " where built module artifacts (module JAR file)" + " are pushed to during module release process.")));
p.add(new Label(Messages.get("label.releaseModule.distributionServer.authentication", "If your distribution server requires authentication, please, provide the corresponding" + " <server/> section in your Maven's settings.xml file.")));
p.add(new HTML("<br/>"));
p.add(new Label(Messages.get("label.releaseModule.distributionServer.provideNow", "Would you like to configure the distribution server now?")));
final FormPanel formPanel = new FormPanel();
formPanel.setHeaderVisible(false);
formPanel.setLabelWidth(100);
formPanel.setFieldWidth(330);
formPanel.setButtonAlign(Style.HorizontalAlignment.CENTER);
formPanel.setBorders(false);
final ComboBox<GWTJahiaValueDisplayBean> combo = new ComboBox<GWTJahiaValueDisplayBean>();
combo.setFieldLabel("Repository type");
combo.setValueField("value");
combo.setDisplayField("display");
combo.setStore(new ListStore<GWTJahiaValueDisplayBean>());
combo.getStore().add(new GWTJahiaValueDisplayBean("forge", "Jahia Private App Store"));
combo.getStore().add(new GWTJahiaValueDisplayBean("maven", "Maven repository"));
combo.setForceSelection(true);
combo.setTypeAhead(false);
combo.setTriggerAction(ComboBox.TriggerAction.ALL);
formPanel.add(combo);
final FieldSet forgeFs = new FieldSet();
final FormLayout forgeFl = new FormLayout();
forgeFl.setLabelWidth(100);
forgeFl.setDefaultWidth(330);
forgeFs.setLayout(forgeFl);
final TextField<String> tfForgeUrl = new TextField<String>();
tfForgeUrl.setFieldLabel(Messages.get("label.url", "URL"));
String separator = tfForgeUrl.getLabelSeparator() != null ? tfForgeUrl.getLabelSeparator() : "";
tfForgeUrl.setLabelSeparator(separator + " <img width='16px' height='16px' src='" + JahiaGWTParameters.getContextPath() + "/modules/default/images/icons/information.png' title='" + Messages.get("label.releaseModule.distributionServer.url.help", "Copy URL displayed on the Private App Store home page").replace("'", " ") + "'/>");
tfForgeUrl.setAllowBlank(false);
if (info.getForgeUrl() != null) {
tfForgeUrl.setValue(info.getForgeUrl());
}
forgeFs.add(tfForgeUrl);
final TextField<String> tfUsername = new TextField<String>();
final TextField<String> tfPassword = new TextField<String>();
tfUsername.setFieldLabel(Messages.get("label.username", "Username"));
tfPassword.setFieldLabel(Messages.get("label.password", "Password"));
tfPassword.setPassword(true);
tfUsername.setValue(ForgeLoginWindow.username);
tfPassword.setValue(ForgeLoginWindow.password);
forgeFs.add(tfUsername);
forgeFs.add(tfPassword);
final FieldSet mavenFs = new FieldSet();
final FormLayout mavenfl = new FormLayout();
mavenfl.setLabelWidth(30);
mavenfl.setDefaultWidth(400);
mavenFs.setLayout(mavenfl);
final TextField<String> tfRepoId = new TextField<String>();
tfRepoId.setFieldLabel(Messages.get("label.id", "ID"));
tfRepoId.setAllowBlank(false);
if (info.getRepositoryId() != null) {
tfRepoId.setValue(info.getRepositoryId());
}
mavenFs.add(tfRepoId);
final TextField<String> tfRepoUrl = new TextField<String>();
tfRepoUrl.setFieldLabel(Messages.get("label.url", "URL"));
tfRepoUrl.setAllowBlank(false);
if (info.getRepositoryUrl() != null) {
tfRepoUrl.setValue(info.getRepositoryUrl());
}
mavenFs.add(tfRepoUrl);
formPanel.add(mavenFs);
if (info.getForgeUrl() == null && info.getRepositoryUrl() != null) {
combo.setValue(combo.getStore().getAt(1));
forgeFs.hide();
} else {
combo.setValue(combo.getStore().getAt(0));
mavenFs.hide();
}
formPanel.add(forgeFs);
combo.addSelectionChangedListener(new SelectionChangedListener<GWTJahiaValueDisplayBean>() {
@Override
public void selectionChanged(SelectionChangedEvent<GWTJahiaValueDisplayBean> se) {
if (se.getSelectedItem().getValue().equals("forge")) {
mavenFs.hide();
forgeFs.show();
} else {
forgeFs.hide();
mavenFs.show();
}
formPanel.layout();
}
});
final Window w = this;
Button button = new Button(Messages.get("label.save", "Save"), new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent event) {
w.hide();
if (combo.getValue().getValue().equals("forge")) {
info.setForgeUrl(tfForgeUrl.getValue());
info.setUsername(tfUsername.getValue());
info.setPassword(tfPassword.getValue());
ForgeLoginWindow.username = tfUsername.getValue();
ForgeLoginWindow.password = tfPassword.getValue();
} else {
info.setForgeUrl(null);
info.setRepositoryUrl(tfRepoUrl.getValue());
info.setRepositoryId(tfRepoId.getValue());
}
callback(info);
}
});
button.addStyleName("button-save");
formPanel.addButton(button);
Button skip = new Button(Messages.get("label.skip", "Skip"), new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent event) {
w.hide();
callback(null);
}
});
skip.addStyleName("button-skip");
formPanel.addButton(skip);
p.add(formPanel);
add(p, new MarginData(5));
}
Aggregations