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

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

Introduction

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

Prototype

public HorizontalPanel() 

Source Link

Document

Creates an empty horizontal panel.

Usage

From source file:br.usp.icmc.gazetteer.client.view.impl.Mapa.java

License:Apache License

public void addButtons() {

    addPoint(map);//from   w w w .j  a  va  2  s .co m
    addLineString(map);
    addPolygon(map);
    deleteFeatures(map);
    components.addStyleName("button_map");
    components.add(rbNavigate);
    components.add(rbDrawPoint);
    components.add(rbDrawLine);
    components.add(rbDrawPolygon);
    components.add(cbClickOut);
    final HorizontalPanel hpCbClickOut = new HorizontalPanel();
    hpCbClickOut.add(new HTML("         "));
    components.add(hpCbClickOut);

    rbNavigate.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            desativeAll();
        }
    });
    rbDrawPoint.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            desativeAll();
            clearAllPoint();
            drawPointFeatureControl.activate();
        }
    });
    rbDrawLine.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            desativeAll();
            clearAllPoint();
            drawLineFeatureControl.activate();

        }
    });
    rbDrawPolygon.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            desativeAll();
            clearAllPoint();
            drawPolygonFeatureControl.activate();
        }
    });
    cbClickOut.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            desativeAll();
            clearAllPoint();
            deleteFeatureControl.activate();
        }
    });

}

From source file:bufferings.ktr.wjr.client.ui.WjrPopupPanel.java

License:Apache License

/**
 * Constructs the WjrPopupPanel.//from w w  w  . ja  va  2  s  .  c om
 */
public WjrPopupPanel() {
    HorizontalPanel mainPanel = new HorizontalPanel();
    mainPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    mainPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    mainPanel.setSpacing(5);
    mainPanel.setStyleName(UI_STATE_HIGHLIGHT);
    mainPanel.setSize("200px", "30px");
    mainPanel.setVisible(false);
    mainPanel.getElement().getStyle().setPosition(Position.ABSOLUTE);
    mainPanel.getElement().getStyle().setPropertyPx("left", -9999);
    mainPanel.getElement().setId(DOM.createUniqueId());

    label = new Label();
    label.setStyleName(UI_WIDGET);
    mainPanel.add(label);

    initWidget(mainPanel);
    RootPanel.get().add(this);
}

From source file:burrito.client.crud.CrudIndexPanel.java

License:Apache License

protected void init(List<CrudEntityInfo> result) {
    Label descLabel;//from w w w. j ava  2s  .co  m
    wrapper.add((descLabel = new Label(messages.chooseEntity())));
    if (result.isEmpty()) {
        wrapper.add((descLabel = new Label(messages.noEntitiesToEdit())));
        wrapper.add(new VerticalSpacer(10));
    }
    descLabel.addStyleName("k5-CrudPanel-indexDesc");
    for (CrudEntityInfo crudEntityInfo : result) {
        HorizontalPanel fp = new HorizontalPanel();
        String underscore = crudEntityInfo.getEntityName().replace('.', '_');
        Hyperlink entityName = new Hyperlink(CrudLabelHelper.getString(underscore),
                crudEntityInfo.getEntityName());
        entityName.addStyleName("k5-CrudPanel-entityName");
        fp.add(entityName);
        String desc = CrudLabelHelper.getNullableString(underscore + "_desc");
        if (desc != null) {
            HTML descHtml = new HTML("&nbsp;-&nbsp;" + desc);
            descHtml.addStyleName("k5-CrudPanel-entityDesc");
            fp.add(descHtml);
        }
        wrapper.add(fp);
        wrapper.add(new VerticalSpacer(10));
    }

    wrapper.add(new VerticalSpacer(30));
    wrapper.add(new Label(messages.administrativeTasksHeader()));

    wrapper.add(new VerticalSpacer(10));
    wrapper.add(new Hyperlink(messages.reindex(), "reindex"));

}

From source file:burrito.client.crud.widgets.CrudRichTextArea.java

License:Apache License

private Widget createCommandsArea() {
    HorizontalPanel hp = new HorizontalPanel();
    this.bold = new ToggleButton(new Image(GWT.getModuleBaseURL() + "images/format-text-bold.png"),
            new ClickHandler() {

                public void onClick(ClickEvent event) {
                    formatter.toggleBold();
                }/*w  ww .ja v a 2 s  .  com*/
            });
    bold.setTitle(labels.bold());
    hp.add(bold);

    this.italics = new ToggleButton(new Image(GWT.getModuleBaseURL() + "images/format-text-italic.png"),
            new ClickHandler() {

                public void onClick(ClickEvent event) {
                    formatter.toggleItalic();
                }
            });
    italics.setTitle(labels.italic());
    hp.add(italics);

    this.strikethrough = new ToggleButton(
            new Image(GWT.getModuleBaseURL() + "images/format-text-strikethrough.png"), new ClickHandler() {

                public void onClick(ClickEvent event) {
                    formatter.toggleStrikethrough();
                }
            });
    strikethrough.setTitle(labels.strikethrough());
    hp.add(strikethrough);

    this.underline = new ToggleButton(new Image(GWT.getModuleBaseURL() + "images/format-text-underline.png"),
            new ClickHandler() {

                public void onClick(ClickEvent event) {
                    formatter.toggleUnderline();
                }
            });
    underline.setTitle(labels.underline());
    hp.add(underline);

    PushButton image = new PushButton(new Image(GWT.getModuleBaseURL() + "images/image-x-generic.png"),
            new ClickHandler() {

                public void onClick(ClickEvent event) {
                    imagePicker.center();
                    imagePicker.show();
                }
            });
    image.setTitle(labels.insertImage());
    hp.add(image);

    PushButton link = new PushButton(labels.link(), new ClickHandler() {

        public void onClick(ClickEvent event) {
            formatter.createLink(Window.prompt(labels.pasteLinkHere(), null));
        }
    });
    link.setTitle(labels.insertLink());
    hp.add(link);

    for (CrudRichTextPlugin control : PLUGGED_IN_CONTROLLERS) {
        hp.add(control.getWidget(formatter));
    }

    return hp;

}

From source file:burrito.client.crud.widgets.LinkedEntityWidget.java

License:Apache License

protected void reloadLinkViews() {
    VerticalPanel vp = new VerticalPanel();
    for (final LinkedEntityValue v : added) {
        HorizontalPanel hp = new HorizontalPanel();
        hp.add(v);/*from w  w  w  .ja v  a 2  s .c  om*/
        Anchor remove = new Anchor(labels.delete());
        remove.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                added.remove(v);
                reloadLinkViews();
                add.setVisible(true);
            }
        });
        hp.add(remove);
        vp.add(hp);
    }
    linkViewPlaceholder.setWidget(vp);
}

From source file:burrito.client.crud.widgets.LinkedEntityWidgetPopup.java

License:Apache License

public LinkedEntityWidgetPopup(final SaveHandler saveHandler) {
    super(false, true);
    setText(labels.createNewLink());/*  w w  w.j  a v a 2s .  co m*/
    type.setLabelCreator(new SelectionListLabelCreator<String>() {

        @Override
        public String createLabel(String typeClassName) {
            return CrudLabelHelper.getString(typeClassName.replace('.', '_') + "_singular");
        }
    });
    type.setNullSelectLabel(labels.chooseLinkType());
    type.addChangeHandler(new ChangeHandler() {

        public void onChange(ChangeEvent event) {
            handleTypeChange();
        }
    });

    wrapper.add(new Label(labels.linkText()));
    wrapper.add(linkText);
    wrapper.add(new Label(labels.selectLinkTo()));
    wrapper.add(type);
    wrapper.add(valuesWrapper);

    urlWrapper.setVisible(false);
    urlWrapper.add(new Label(labels.writeOrPasteLink()));
    urlWrapper.add(url);
    wrapper.add(urlWrapper);

    HorizontalPanel hp = new HorizontalPanel();

    hp.add(new Button(labels.save(), new ClickHandler() {

        public void onClick(ClickEvent event) {
            doSave(saveHandler);
        }
    }));
    hp.add(new Button(labels.cancel(), new ClickHandler() {

        public void onClick(ClickEvent event) {
            removeFromParent();
        }
    }));
    wrapper.add(new VerticalSpacer(10));
    wrapper.add(hp);
    setWidget(wrapper);
    addStyleName("k5-LinkedEntityWidget");

    init();
}

From source file:burrito.client.crud.widgets.StringListWidget.java

License:Apache License

public StringListWidget(List<String> strings) {
    tagsPanel.setStyleName("k5-StringListWidget-TagPanel");
    wrapper.add(tagsPanel);//www . j a v a 2s.  co  m
    HorizontalPanel inputWrapper = new HorizontalPanel();
    inputWrapper.add(tagInput);
    inputWrapper.add(addButton);
    wrapper.add(inputWrapper);
    addButton.addStyleName("k5-StringListWidget-AddButton");
    addButton.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            addCurrentTag();
        }
    });

    load(strings);
    initWidget(wrapper);
    addStyleName("k5-StringListWidget");
}

From source file:burrito.client.sitelet.SiteletEditPanel.java

License:Apache License

private void addEntityOption(CrudEntityInfo crudEntityInfo) {
    HorizontalPanel fp = new HorizontalPanel();
    String underscore = crudEntityInfo.getEntityName().replace('.', '_');
    fp.add(createTypeLink(crudEntityInfo.getEntityName(), CrudLabelHelper.getString(underscore)));
    String desc = CrudLabelHelper.getNullableString(underscore + "_desc");
    if (desc != null) {
        fp.add(new HTML("&nbsp;-&nbsp;" + desc));
    }//  w  ww  . ja  v  a 2  s .co m
    types.add(fp);
    types.add(new VerticalSpacer(10));
}

From source file:burrito.client.widgets.blobstore.BlobStoreImageField.java

License:Apache License

public BlobStoreImageField(boolean required, Integer requiredWidth, Integer requiredHeight) {
    this.required = required;
    this.requiredWidth = requiredWidth;
    this.requiredHeight = requiredHeight;

    validationError.addStyleName("validationError");
    validationError.setVisible(false);//from  w  w w  . ja v a2  s  .  com
    wrapper.add(validationError);

    String descText;
    if (requiredWidth != null) {
        if (requiredHeight != null)
            descText = messages.blobImageRequiredSize(requiredWidth, requiredHeight);
        else
            descText = messages.blobImageRequiredWidth(requiredWidth);
    } else {
        if (requiredHeight != null)
            descText = messages.blobImageRequiredHeight(requiredHeight);
        else
            descText = messages.blobImageAnySize();
    }
    Label desc = new Label(descText);

    desc.addStyleName("k5-BlobStoreImageField-desc");
    wrapper.add(desc);
    wrapper.add(imageWrapper);
    HorizontalPanel buttons = new HorizontalPanel();
    changeImage.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            uploader.setVisible(true);
            changeImage.setVisible(false);
        }
    });
    buttons.add(changeImage);
    changeImage.setVisible(false);

    deleteImage.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            blobStoreKey = null;
            updateImage();
            fireChange();
            updateDeleteButton();
        }
    });
    buttons.add(deleteImage);
    wrapper.add(buttons);

    updateDeleteButton();
    createNewUploaderWidget();
    initWidget(wrapper);
    addStyleName("k5-BlobStoreImageField");
}

From source file:burrito.client.widgets.form.EditForm.java

License:Apache License

public EditForm() {
    save.addStyleName("k5-EditForm-button-save");
    cancel.addStyleName("k5-EditForm-button-cancel");
    SimplePanel mainWrapper = new SimplePanel();
    mainWrapper.add(main);//from   w w w  .  j  a  v  a 2s  . c om
    dock.add(mainWrapper, DockPanel.CENTER);
    buttonWrapper = new SimplePanel();
    SimplePanel buttonWrapperInner = new SimplePanel();
    buttonWrapper.add(buttonWrapperInner);
    HorizontalPanel hp = new HorizontalPanel();
    hp.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    buttonWrapperInner.addStyleName("k5-EditForm-buttons");

    // start with save button disabled
    save.setEnabled(false);
    save.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            save();
        }
    });

    cancel.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            saveCancelListener.onCancel();
        }
    });

    hp.add(save);
    hp.add(extraButtonsPanel);
    hp.add(cancel);
    hp.add(infoMessage);
    buttonWrapperInner.setWidget(hp);

    dock.add(buttonWrapper, DockPanel.SOUTH);
    wrapper.add(dock);
    wrapper.add(loading);
    wrapper.showWidget(0);
    initWidget(wrapper);
    addStyleName("k5-EditForm");
    mainWrapper.addStyleName("k5-EditForm-main");
}