Example usage for com.google.gwt.user.client.ui HorizontalPanel setSpacing

List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setSpacing

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HorizontalPanel setSpacing.

Prototype

public void setSpacing(int spacing) 

Source Link

Document

Sets the amount of spacing between this panel's cells.

Usage

From source file:org.geomajas.plugin.deskmanager.client.gwt.manager.datalayer.panels.UploadShapefileForm.java

License:Open Source License

public UploadShapefileForm() {
    form = new FormPanel();
    form.setAction(SERVICE_NAME);/*from   ww  w .ja va2  s .c o  m*/
    form.setEncoding(FormPanel.ENCODING_MULTIPART);
    form.setMethod(FormPanel.METHOD_POST);

    // Create a panel to hold all of the form widgets.
    VerticalPanel panel = new VerticalPanel();
    hiddenLayerName = new Hidden("layername");
    panel.add(hiddenLayerName);
    hiddenToken = new Hidden(URL_TOKEN);
    panel.add(hiddenToken);
    form.setWidget(panel);

    // Create a FileUpload widget.
    upload = new FileUpload();
    upload.setName("uploadFormElement");
    upload.addChangeHandler(new ChangeHandler() {

        public void onChange(ChangeEvent event) {
            for (ItemChangedHandler item : handlers) {
                ItemChangedEvent ice = new ItemChangedEvent(null);
                item.onItemChanged(ice);
            }
        }
    });
    HorizontalPanel hp = new HorizontalPanel();
    hp.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    hp.setSpacing(3);
    com.google.gwt.user.client.ui.Label lblUpload = new com.google.gwt.user.client.ui.Label(
            MESSAGES.uploadShapefileLabelText() + " : ");
    lblUpload.setStyleName("formTitle");
    hp.add(lblUpload);
    hp.add(upload);
    panel.add(hp);

    form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {

        public void onSubmitComplete(SubmitCompleteEvent event) {
            String res = event.getResults().trim();
            if (res.startsWith("<")) {
                int start = res.indexOf(">") + 1;
                int end = res.indexOf("<", start);
                res = res.substring(start, end);
            }
            uploadFinished(res);
        }
    });

    // -------------------------------------------------

    addMember(form);
}

From source file:org.geosdi.geoplatform.gui.configuration.choice.mediator.AbstractChoiseMediator.java

License:Open Source License

final HorizontalPanel buildHorizontalPanel() {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    panel.setSpacing(16);
    for (Map.Entry<K, V> entry : choiseColleagueRegistry.entrySet()) {
        V getMapChoiseColleague = entry.getValue();
        panel.add(getMapChoiseColleague.getChoiseButton());
    }/*  w w  w  . ja  v  a 2 s.  c  o m*/

    return panel;
}

From source file:org.geowe.client.local.layermanager.tool.export.ExportDataDialog.java

License:Open Source License

private Widget createPanel() {
    String comboWidth = "150px";

    vectorFormatCombo = new VectorFormatComboBox(comboWidth, VectorFormat.getSupportedExportVectorFormat());
    vectorFormatCombo.addSelectionHandler(getVectorComboSelectionHandler());
    vectorFormatCombo.setValue(VectorFormat.GEO_JSON_FORMAT);
    epsgCombo = new ProjectionComboBox(comboWidth);

    downloadFileButton = new TextButton(UIMessages.INSTANCE.downloadfileText());
    downloadFileButton.setIcon(ImageProvider.INSTANCE.download32());
    downloadFileButton.setIconAlign(IconAlign.TOP);

    gitHubButton = new TextButton("GitHub");
    gitHubButton.setIcon(ImageProvider.INSTANCE.github32());
    gitHubButton.setIconAlign(IconAlign.TOP);

    HorizontalPanel horizontalGroup = new HorizontalPanel();
    horizontalGroup.getElement().getStyle().setBackgroundColor("#E0ECF8");
    horizontalGroup.setSpacing(10);

    VerticalPanel vPanel = new VerticalPanel();
    vPanel.setSpacing(5);/*from   w w  w  . j  a v  a  2 s . co m*/
    vPanel.add(vectorFormatCombo);
    vPanel.add(epsgCombo);

    horizontalGroup.add(vPanel);

    horizontalGroup.add(downloadFileButton);
    horizontalGroup.add(gitHubButton);

    return horizontalGroup;
}

From source file:org.geowe.client.local.main.GeocodingPanelWidget.java

License:Open Source License

@Override
public Widget asWidget() {

    if (panel == null) {
        panel = new ContentPanel();
        panel.setBorders(true);//w w w  . j  a v  a2s. c om
        panel.setPixelSize(490, 47);
        panel.setHeaderVisible(false);
        panel.setPosition(300, 0);
        panel.getElement().getStyle().setPosition(Position.ABSOLUTE);

        StyleInjector.inject(".statusBarStyle { " + "position: absolute; " + "bottom: 35 px;"
                + "background: #E0ECF8;" + "border-radius: 5px 10px;" + "opacity: 0.8}");
        panel.setStyleName("geocodingPanelStyle");

        final HorizontalPanel horizontalGroup = new HorizontalPanel();
        horizontalGroup.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
        horizontalGroup.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        horizontalGroup.setSpacing(5);
        horizontalGroup.getElement().getStyle().setBackgroundColor("#E0ECF8");

        addressTextField.setWidth("320px");
        addressTextField.setEmptyText(UIMessages.INSTANCE.gcAddressTextField());
        addressTextField.getElement().setId("autocompletar");

        addressTextField.addKeyDownHandler(new KeyDownHandler() {
            @Override
            public void onKeyDown(final KeyDownEvent event) {
                if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
                    searchGeocoding(addressTextField.getText());
                }
            }
        });

        horizontalGroup.add(addressTextField);
        horizontalGroup.add(getSearchButton());
        horizontalGroup.add(getW3WLocationButton());
        horizontalGroup.add(getLocationMenuButton());
        panel.setWidget(horizontalGroup);
        panel.setVisible(false);
    }
    return panel;
}

From source file:org.geowe.client.local.main.map.SimpleMapVerticalLegend.java

License:Open Source License

@Override
protected List<Widget> getData() {
    List<Widget> widgets = new ArrayList<Widget>();
    for (Layer layer : layers) {
        HorizontalPanel hpanel = new HorizontalPanel();
        hpanel.setSpacing(2);
        hpanel.add(getColorPanel(layer));
        hpanel.add(new Label(layer.getName()));

        widgets.add(hpanel);//w ww  .j a va2 s. c  om
    }
    return widgets;
}

From source file:org.geowe.client.local.main.MenuPanelWidget.java

License:Open Source License

private HorizontalPanel getMapGroupTools() {
    HorizontalPanel horizontalGroup = new HorizontalPanel();
    horizontalGroup.setSpacing(5);
    horizontalGroup.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);

    horizontalGroup.add(layerManagerTool);
    horizontalGroup.add(layerCatalogTool);
    horizontalGroup.add(basicToolBarTool);

    return horizontalGroup;
}

From source file:org.geowe.client.local.main.MenuPanelWidget.java

License:Open Source License

private HorizontalPanel getViewGroupTools() {
    HorizontalPanel horizontalGroup = new HorizontalPanel();
    horizontalGroup.setSpacing(5);
    horizontalGroup.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);

    horizontalGroup.add(w3wTool);// w ww.j  ava2s.  c om
    horizontalGroup.add(mapToolTipTool);
    horizontalGroup.add(graticuleTool);

    return horizontalGroup;
}

From source file:org.geowe.client.local.main.MenuPanelWidget.java

License:Open Source License

private HorizontalPanel getExtentGroupTools() {
    HorizontalPanel horizontalGroup = new HorizontalPanel();
    horizontalGroup.setSpacing(5);
    horizontalGroup.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);

    horizontalGroup.add(currentExtentTool);
    horizontalGroup.add(customExtentTool);
    horizontalGroup.add(lockCurrentExtentTool);

    return horizontalGroup;
}

From source file:org.geowe.client.local.main.MenuPanelWidget.java

License:Open Source License

private HorizontalPanel getProjectGroupTools() {
    HorizontalPanel horizontalGroup = new HorizontalPanel();
    horizontalGroup.setSpacing(5);
    horizontalGroup.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);

    horizontalGroup.add(openProjectTool);
    horizontalGroup.add(saveProjectTool);
    horizontalGroup.add(infoProjectTool);

    return horizontalGroup;
}

From source file:org.geowe.client.local.main.MenuPanelWidget.java

License:Open Source License

private HorizontalPanel getLayerGroupTools() {
    HorizontalPanel horizontalGroup = new HorizontalPanel();
    horizontalGroup.setSpacing(5);
    horizontalGroup.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);

    horizontalGroup.add(addLayerTool);/*from www  .j  a  v a 2 s  .  c  om*/
    horizontalGroup.add(layerInfoTool);
    horizontalGroup.add(changeStyleTool);

    return horizontalGroup;
}