Search in sources :

Example 31 with FormLayout

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();
}
Also used : Window(com.extjs.gxt.ui.client.widget.Window) FormLayout(com.extjs.gxt.ui.client.widget.layout.FormLayout) CalendarField(org.jahia.ajax.gwt.client.widget.form.CalendarField) Label(com.extjs.gxt.ui.client.widget.Label) VerticalPanel(com.extjs.gxt.ui.client.widget.VerticalPanel) FieldSet(com.extjs.gxt.ui.client.widget.form.FieldSet) FormPanel(com.extjs.gxt.ui.client.widget.form.FormPanel) Button(com.extjs.gxt.ui.client.widget.button.Button) ButtonEvent(com.extjs.gxt.ui.client.event.ButtonEvent) ComponentEvent(com.extjs.gxt.ui.client.event.ComponentEvent) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Example 32 with FormLayout

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);
}
Also used : FormLayout(com.extjs.gxt.ui.client.widget.layout.FormLayout) GPSecureStringTextField(org.geosdi.geoplatform.gui.configuration.GPSecureStringTextField) FlowLayout(com.extjs.gxt.ui.client.widget.layout.FlowLayout) BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData) LabelToolItem(com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem) FieldSet(com.extjs.gxt.ui.client.widget.form.FieldSet) FormPanel(com.extjs.gxt.ui.client.widget.form.FormPanel) SearchStatus(org.geosdi.geoplatform.gui.client.widget.SearchStatus) EnumSearchStatus(org.geosdi.geoplatform.gui.client.widget.SearchStatus.EnumSearchStatus) Button(com.extjs.gxt.ui.client.widget.button.Button) Margins(com.extjs.gxt.ui.client.util.Margins)

Example 33 with FormLayout

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);
}
Also used : FormLayout(com.extjs.gxt.ui.client.widget.layout.FormLayout) FormData(com.extjs.gxt.ui.client.widget.layout.FormData) GPSecureStringTextField(org.geosdi.geoplatform.gui.configuration.GPSecureStringTextField) FlowLayout(com.extjs.gxt.ui.client.widget.layout.FlowLayout) LabelToolItem(com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem) FieldSet(com.extjs.gxt.ui.client.widget.form.FieldSet) FormPanel(com.extjs.gxt.ui.client.widget.form.FormPanel) SearchStatus(org.geosdi.geoplatform.gui.client.widget.SearchStatus) EnumSearchStatus(org.geosdi.geoplatform.gui.client.widget.SearchStatus.EnumSearchStatus) Button(com.extjs.gxt.ui.client.widget.button.Button)

Example 34 with FormLayout

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);
}
Also used : FormLayout(com.extjs.gxt.ui.client.widget.layout.FormLayout) GPSecureStringTextField(org.geosdi.geoplatform.gui.configuration.GPSecureStringTextField) KeyListener(com.extjs.gxt.ui.client.event.KeyListener) ComponentEvent(com.extjs.gxt.ui.client.event.ComponentEvent)

Example 35 with FormLayout

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;
}
Also used : FormLayout(com.extjs.gxt.ui.client.widget.layout.FormLayout) FieldSet(com.extjs.gxt.ui.client.widget.form.FieldSet)

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