use of com.extjs.gxt.ui.client.widget.layout.FormLayout in project jahia by Jahia.
the class ExecuteRemotePublicationActionItem method onComponentSelection.
@Override
public void onComponentSelection() {
if (wnd != null) {
wnd.show();
return;
}
wnd = new Window();
wnd.setWidth(550);
wnd.setHeight(showOptions ? 220 : 120);
wnd.setModal(true);
wnd.setBlinkModal(true);
wnd.setHeadingHtml(titleKey != null ? Messages.get(titleKey) : Messages.get("label.information", "Information"));
wnd.setLayout(new FitLayout());
final FormPanel form = new FormPanel();
form.setHeight(showOptions ? 180 : 80);
form.setHeaderVisible(false);
form.setFrame(false);
form.setLabelWidth(250);
VerticalPanel vpLabels = new VerticalPanel();
vpLabels.add(new Label(confirmationMessageKey != null ? Messages.get(confirmationMessageKey, "You are about to execute action " + action + ". Do you want to continue?") : "You are about to execute action " + action + ". Do you want to continue?"));
form.add(vpLabels);
if (showOptions) {
FieldSet fieldSet = new FieldSet();
fieldSet.setHeadingHtml(Messages.get("label.options", "Options"));
FormLayout layout = new FormLayout();
layout.setLabelWidth(250);
fieldSet.setLayout(layout);
fieldSet.setCollapsible(true);
fieldSet.collapse();
fieldSet.addListener(Events.Expand, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent componentEvent) {
wnd.setHeight(wnd.getHeight() + 70);
}
});
fieldSet.addListener(Events.Collapse, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent componentEvent) {
wnd.setHeight(wnd.getHeight() - 70);
}
});
calendarFieldStart = new CalendarField("yyyy-MM-dd HH:mm", true, false, "startDate", false, null);
calendarFieldStart.setFieldLabel(Messages.get("label.remotePublication.startDate", "Start time of the replication (optional)"));
calendarFieldStart.setAllowBlank(true);
fieldSet.add(calendarFieldStart);
calendarFieldEnd = new CalendarField("yyyy-MM-dd HH:mm", true, false, "endDate", false, null);
calendarFieldEnd.setFieldLabel(Messages.get("label.remotePublication.endDate", "End time of the replication (optional)"));
calendarFieldEnd.setAllowBlank(true);
fieldSet.add(calendarFieldEnd);
form.add(fieldSet);
}
Button btnSubmit = new Button(Messages.get("label.yes", "Yes"), new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent event) {
wnd.mask(Messages.get("label.executing", "Executing action..."));
doAction();
}
});
btnSubmit.addStyleName("button-yes");
form.addButton(btnSubmit);
Button btnCancel = new Button(Messages.get("label.no", "No"), new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent event) {
wnd.hide();
}
});
btnCancel.addStyleName("button-no");
form.addButton(btnCancel);
form.setButtonAlign(HorizontalAlignment.CENTER);
wnd.add(form);
wnd.layout();
wnd.show();
}
use of com.extjs.gxt.ui.client.widget.layout.FormLayout in project geo-platform by geosdi.
the class GeoPlatformSearchPanel method initFormPanel.
private void initFormPanel() {
formPanel = new FormPanel();
formPanel.setHeaderVisible(false);
formPanel.setFrame(true);
formPanel.setLayout(new FlowLayout());
FieldSet searchFieldSet = new FieldSet();
searchFieldSet.setHeadingHtml(INSTANCE.GeoPlatformSearchPanel_headingText());
FormLayout layout = new FormLayout();
layout.setLabelWidth(80);
searchFieldSet.setLayout(layout);
search = new GPSecureStringTextField();
search.setLabelStyle("width:100px");
search.setFieldLabel(INSTANCE.GeoPlatformSearchPanel_searchFieldLabelText());
search.addKeyListener(new KeyListener() {
@Override
public void componentKeyUp(ComponentEvent event) {
if (((event.getKeyCode() == KeyCodes.KEY_BACKSPACE) || (event.getKeyCode() == KeyCodes.KEY_DELETE)) && (search.getValue() == null)) {
reset();
}
}
@Override
public void componentKeyPress(ComponentEvent event) {
if ((event.getKeyCode() == KeyCodes.KEY_ENTER)) {
searchText = search.getValue() == null ? "" : search.getValue();
loader.load(0, 25);
}
}
});
BorderLayoutData data = new BorderLayoutData(LayoutRegion.CENTER);
data.setMargins(new Margins(5, 5, 5, 5));
searchFieldSet.add(search, data);
formPanel.add(searchFieldSet);
if (widget == null) {
throw new NullPointerException("Widget must be not null (create widget into initWidget method).");
}
formPanel.add(widget);
this.searchStatus = new SearchStatus();
searchStatus.setAutoWidth(true);
formPanel.getButtonBar().add(this.searchStatus);
formPanel.getButtonBar().add(new LabelToolItem(" "));
formPanel.setButtonAlign(HorizontalAlignment.RIGHT);
selectButton = new Button();
selectButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
executeSelect();
}
});
setTextSelectButton();
setIconSelectButton();
selectButton.disable();
formPanel.addButton(this.selectButton);
cancelButton = new Button(ButtonsConstants.INSTANCE.cancelText(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
executeCancel();
}
});
cancelButton.setIcon(AbstractImagePrototype.create(BasicWidgetResources.ICONS.cancel()));
formPanel.addButton(cancelButton);
formPanel.setBottomComponent(this.toolBar);
vp.add(formPanel);
}
use of com.extjs.gxt.ui.client.widget.layout.FormLayout in project geo-platform by geosdi.
the class GeoPlatformSearchWindow method initFormPanel.
private void initFormPanel() {
formPanel = new FormPanel();
formPanel.setHeaderVisible(false);
formPanel.setFrame(true);
formPanel.setLayout(new FlowLayout());
this.searchFieldSet = new FieldSet();
searchFieldSet.setHeadingHtml(BasicWidgetConstants.INSTANCE.GeoPlatformSearchWindow_headingText());
FormLayout layout = new FormLayout();
layout.setLabelWidth(80);
searchFieldSet.setLayout(layout);
search = new GPSecureStringTextField();
search.setFieldLabel(BasicWidgetConstants.INSTANCE.GeoPlatformSearchWindow_searchFieldLabelText());
search.addKeyListener(new KeyListener() {
@Override
public void componentKeyUp(ComponentEvent event) {
if (((event.getKeyCode() == KeyCodes.KEY_BACKSPACE) || (event.getKeyCode() == KeyCodes.KEY_DELETE)) && (search.getValue() == null)) {
reset();
}
}
@Override
public void componentKeyPress(ComponentEvent event) {
if ((event.getKeyCode() == KeyCodes.KEY_ENTER)) {
searchText = search.getValue() == null ? "" : search.getValue();
loader.load(0, 25);
}
}
});
searchFieldSet.add(search, new FormData("98%"));
formPanel.add(searchFieldSet);
initWidget();
if (widget == null) {
throw new NullPointerException("Widget must be not null (create widget into initWidget method).");
}
formPanel.add(widget);
this.searchStatus = new SearchStatus();
searchStatus.setAutoWidth(true);
formPanel.getButtonBar().add(this.searchStatus);
formPanel.getButtonBar().add(new LabelToolItem(" "));
formPanel.setButtonAlign(HorizontalAlignment.RIGHT);
selectButton = new Button(ButtonsConstants.INSTANCE.selectText(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
executeSelect();
}
});
selectButton.setIcon(AbstractImagePrototype.create(BasicWidgetResources.ICONS.select()));
selectButton.disable();
formPanel.addButton(this.selectButton);
closeButton = new Button(ButtonsConstants.INSTANCE.closeText(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
executeClose();
}
});
closeButton.setIcon(AbstractImagePrototype.create(BasicWidgetResources.ICONS.cancel()));
formPanel.addButton(closeButton);
formPanel.setBottomComponent(this.toolBar);
vp.add(formPanel);
}
use of com.extjs.gxt.ui.client.widget.layout.FormLayout in project geo-platform by geosdi.
the class GPSecurityWidget method createBasicComponents.
private void createBasicComponents() {
FormLayout layout = new FormLayout();
layout.setLabelWidth(90);
layout.setDefaultWidth(180);
setLayout(layout);
setButtonAlign(HorizontalAlignment.LEFT);
setButtons("");
setIcon(AbstractImagePrototype.create(BasicWidgetResources.ICONS.search()));
setHeadingText(BasicWidgetConstants.INSTANCE.GPSecurityWidget_headingText());
setModal(true);
setBodyBorder(true);
setBodyStyle("padding: 8px;background: none");
setWidth(330);
setResizable(false);
setClosable(false);
KeyListener keyListener = new KeyListener() {
@Override
public void componentKeyPress(ComponentEvent event) {
if (event.getKeyCode() == KeyCodes.KEY_ENTER && login.isEnabled()) {
onSubmit();
}
}
@Override
public void componentKeyUp(ComponentEvent event) {
validate();
}
};
userName = new GPSecureStringTextField();
userName.setFieldLabel(BasicWidgetConstants.INSTANCE.GPSecurityWidget_usernameText());
// userName.setValue("admin");
userName.addKeyListener(keyListener);
add(userName);
password = new GPSecureStringTextField();
password.setPassword(true);
password.setFieldLabel(BasicWidgetConstants.INSTANCE.GPSecurityWidget_passwordText());
// password.setValue("admin");
password.addKeyListener(keyListener);
add(password);
setFocusWidget(userName);
}
use of com.extjs.gxt.ui.client.widget.layout.FormLayout in project geo-platform by geosdi.
the class GeocodingFieldsetProvider method get.
@Override
public FieldSet get() {
FieldSet searchFieldSet = new FieldSet();
searchFieldSet.setHeadingHtml(this.wfstWidgetConstants.searchLabel());
FormLayout layout = new FormLayout();
layout.setLabelWidth(30);
searchFieldSet.setLayout(layout);
return searchFieldSet;
}
Aggregations