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

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

Introduction

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

Prototype

public VerticalPanel() 

Source Link

Document

Creates an empty vertical panel.

Usage

From source file:$.HelloPlugins.java

License:Apache License

@Override
    public void onModuleLoad() {
        Image img = new Image("http://code.google.com/webtoolkit/logo-185x175.png");
        Button button = new Button("Click me");

        VerticalPanel vPanel = new VerticalPanel();
        vPanel.setWidth("100%");
        vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
        vPanel.add(img);// w  ww  .j  av a  2 s  .  c om
        vPanel.add(button);

        RootPanel.get().add(vPanel);

        // Create the dialog box
        final DialogBox dialogBox = new DialogBox();

        // The content of the dialog comes from a User specified Preference
        dialogBox.setText("Hello from GWT Gerrit UI plugin");
        dialogBox.setAnimationEnabled(true);
        Button closeButton = new Button("Close");
        VerticalPanel dialogVPanel = new VerticalPanel();
        dialogVPanel.setWidth("100%");
        dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
        dialogVPanel.add(closeButton);

        closeButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                dialogBox.hide();
            }
        });

        // Set the contents of the Widget
        dialogBox.setWidget(dialogVPanel);

        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                dialogBox.center();
                dialogBox.show();
            }
        });
    }

From source file:ar.com.kyol.jet.client.JetPaginatedTable.java

License:Open Source License

public JetPaginatedTable(boolean useHyperlinks, boolean lazyInit) {
    this.useHyperlinks = useHyperlinks;
    this.lazyInit = lazyInit;
    Panel totalPanel = new VerticalPanel();
    navigationPanel = new HorizontalPanel();
    mainPanel = new AbsolutePanel();
    totalPanel.add(mainPanel);/*w  w w  .  j  a  v  a 2 s  . c om*/
    this.jetTable = createJetTable();
    mainPanel.add(jetTable);
    this.qty = getPageSize();
    refresh();
    this.initWidget(totalPanel);
}

From source file:ar.com.kyol.jet.client.JetPaginatedTable.java

License:Open Source License

private void callbackRefresh(List<E> values) {

    int retSize;//from   w  w w . j a  v a2  s  .com
    if (values != null)
        retSize = values.size();
    else
        retSize = 0;

    this.qtyRetrieved = retSize;

    this.jetTable.setValues(values);

    this.navigationPanel.clear();
    addNavigationLinks();

    Panel verticalPanel = new VerticalPanel();
    verticalPanel.add(navigationPanel);
    verticalPanel.add(jetTable);

    mainPanel.clear();
    mainPanel.add(verticalPanel);

    tableRefreshed();
}

From source file:asquare.gwt.debug.client.DebugConsole.java

License:Apache License

/**
 * Creates the console, installs the enabler key listener. 
 * The console is not yet attached to the DOM. 
 *//* w  w w .  j  ava2 s . co  m*/
protected DebugConsole() {
    super(false, false);
    setStyleName("tk-DebugConsole");
    DOM.setStyleAttribute(getElement(), "border", "solid black 1px");
    DOM.setStyleAttribute(getElement(), "background", "white");

    setHTML("<div style='margin: 2px; padding: 3px; background-color: rgb(195, 217, 255); font-weight: bold; font-size: smaller; cursor: default;'>Debug Console</div>");

    m_content.setWordWrap(false);
    DOM.setStyleAttribute(m_content.getElement(), "margin", "2px");
    DOM.setStyleAttribute(m_content.getElement(), "padding", "3px");

    VerticalPanel outer = new VerticalPanel();

    ScrollPanel scrollPanel = new ScrollPanel(m_content);
    scrollPanel.setAlwaysShowScrollBars(true);
    scrollPanel.setSize("40em", "20em");
    outer.add(scrollPanel);

    HorizontalPanel controls = new HorizontalPanel();
    DOM.setStyleAttribute(controls.getElement(), "margin", "2px");
    controls.setWidth("100%");
    outer.add(controls);

    HorizontalPanel controlsLeft = new HorizontalPanel();
    controls.add(controlsLeft);
    controls.setCellHorizontalAlignment(controlsLeft, HorizontalPanel.ALIGN_LEFT);

    HorizontalPanel controlsRight = new HorizontalPanel();
    controls.add(controlsRight);
    controls.setCellHorizontalAlignment(controlsRight, HorizontalPanel.ALIGN_RIGHT);

    final Button toggleDebugButton = new Button("Toggle&nbsp;Debug");
    DOM.setElementProperty(toggleDebugButton.getElement(), "title", "Toggles output of debug statements");
    controlsLeft.add(toggleDebugButton);

    updateDisableButtonText();
    DOM.setElementProperty(m_disableButton.getElement(), "title",
            "Prevents this console from appearing when debug statements are printed");
    controlsLeft.add(m_disableButton);

    final Button clearButton = new Button("Clear");
    DOM.setElementProperty(clearButton.getElement(), "title", "Clears all messages in the console");
    controlsRight.add(clearButton);

    final Button hideButton = new Button("Hide");
    DOM.setStyleAttribute(hideButton.getElement(), "textAlign", "right");
    controlsRight.add(hideButton);

    setWidget(outer);
    m_left = Window.getClientWidth() / 2 - 640 / 2;
    m_top = Window.getClientHeight() / 2;

    m_enabler.install();

    ClickHandler handler = new ClickHandler() {
        public void onClick(ClickEvent event) {
            Widget sender = (Widget) event.getSource();
            if (sender == clearButton) {
                clearMessages();
            } else if (sender == hideButton) {
                hide();
            } else if (sender == m_disableButton) {
                disable();
            } else if (sender == toggleDebugButton) {
                if (Debug.isEnabled()) {
                    Debug.disable();
                } else {
                    Debug.enable();
                }
            } else {
                assert false;
            }
        }
    };
    toggleDebugButton.addClickHandler(handler);
    m_disableButton.addClickHandler(handler);
    clearButton.addClickHandler(handler);
    hideButton.addClickHandler(handler);

    sinkEvents(Event.ONMOUSEDOWN);
    preventSelectionInIE(getElement());
}

From source file:asquare.gwt.tests.circularbinding.client.Demo.java

License:Apache License

private Widget createDemoPanel() {
    VerticalPanel outer = new VerticalPanel();

    final TextArea output = new TextArea();
    outer.add(output);//from   w w  w .ja v a 2 s.  c om

    Label label = new Label("Click me");
    label.addMouseDownHandler(new MouseDownHandler() {
        public void onMouseDown(MouseDownEvent event) {
            // this works
            output.setText("x=" + DOM2.eventGetClientX());

            // this results in an infinite loop
            output.setText(output.getText() + "\r\ny=" + DOM2.eventGetClientY());
        }
    });
    DOM.setStyleAttribute(label.getElement(), "border", "solid black 1px");
    outer.insert(label, 0);

    return outer;
}

From source file:asquare.gwt.tests.mousebutton.client.Demo.java

License:Apache License

private Widget createDemoPanel() {
    VerticalPanel outer = new VerticalPanel();
    TextBox input = new TextBox();
    input.setText("Click Here");
    TextArea output = new TextArea();
    outer.add(input);//w  w  w .  ja  v a2s.  c om
    outer.add(output);

    MouseHandler handler = new MouseHandler(output);
    HandlesAllMouseEvents.handle(input, handler);
    return outer;
}

From source file:asquare.gwt.tests.popuphidden.client.Demo.java

License:Apache License

public void onModuleLoad() {
    RootPanel body = RootPanel.get();/*from   www .  j  av  a  2 s  .  com*/
    DOM.setStyleAttribute(body.getElement(), "background", "blue");
    final Button showPopupButton = new Button("Show popup");
    showPopupButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            final PopupPanel popup = new PopupPanel(true);
            VerticalPanel outer = new VerticalPanel();
            outer.add(new HTML("Click outside the popup to dismiss it"));
            outer.add(new Button("DOM.setStyleAttribute(popup.getElement(), \"visibility\", \"hidden\")",
                    new ClickHandler() {
                        public void onClick(ClickEvent event) {
                            DOM.setStyleAttribute(popup.getElement(), "visibility", "hidden");
                        }
                    }));
            popup.setWidget(outer);
            DOM.setStyleAttribute(popup.getElement(), "border", "double black 4px");
            DOM.setStyleAttribute(popup.getElement(), "background", "red");
            popup.setSize("20em", "20em");
            int x = showPopupButton.getAbsoluteLeft();
            int y = showPopupButton.getAbsoluteTop() + showPopupButton.getOffsetHeight();
            popup.setPopupPosition(x, y);
            popup.show();
        }
    });
    body.add(showPopupButton);
}

From source file:asquare.gwt.tkdemo.client.demos.FocusCycleDemo.java

License:Apache License

private Widget createFocusCycle2() {
    BasicPanel cycle2 = new BasicPanel("div", "block");
    FocusModel focusModel = new FocusModel();
    TabFocusController focusController = (TabFocusController) GWT.create(TabFocusController.class);
    focusController.setModel(focusModel);

    cycle2.add(new Label("Cycle 2"));
    Label label = new Label("A custom focus cycle across containers");
    DomUtil.setStyleAttribute(label, "fontSize", "smaller");
    cycle2.add(label);/*from   w ww  .ja v a2 s .  c o m*/
    HorizontalPanel containers = new HorizontalPanel();

    FocusStyleDecorator[] buttons = new FocusStyleDecorator[6];
    for (int i = 0; i < buttons.length; i++) {
        buttons[i] = new FocusStyleDecorator(new Button("index&nbsp;" + i));
    }
    VerticalPanel container1 = new VerticalPanel();
    container1.addStyleName("focus-container");
    VerticalPanel container2 = new VerticalPanel();
    container2.addStyleName("focus-container");

    for (int i = 0; i < buttons.length; i += 2) {
        container1.add(buttons[i]);
        focusModel.add(buttons[i]);
        container2.add(buttons[i + 1]);
        focusModel.add(buttons[i + 1]);
    }

    containers.add(new CWrapper(container1).addController(focusController));
    containers.add(new CWrapper(container2).addController(focusController));
    cycle2.add(containers);

    new WidgetFocusStyleController(focusModel);

    return cycle2;
}

From source file:at.ac.fhcampuswien.atom.client.gui.attributes.components.RichTextToolbar.java

License:Open Source License

/** Constructor of the Toolbar **/
public RichTextToolbar() {
    //Initialize the main-panel
    outer = new VerticalPanel();

    //Initialize the two inner panels
    topPanel = new HorizontalPanel();
    bottomPanel = new HorizontalPanel();
    topPanel.setStyleName(CSS_ROOT_NAME);
    bottomPanel.setStyleName(CSS_ROOT_NAME);

    //Set some graphical options, so this toolbar looks how we like it.
    topPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
    bottomPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);

    //Add the two inner panels to the main panel
    outer.add(topPanel);// w w  w  .  j  ava  2s  .co m
    outer.add(bottomPanel);

    //Some graphical stuff to the main panel and the initialisation of the new widget
    outer.setWidth("100%");
    outer.setStyleName(CSS_ROOT_NAME);
    initWidget(outer);

    //
    evHandler = new EventHandler();

    //Now lets fill the new toolbar with life
    buildTools();
}

From source file:at.ait.dme.yuma.client.image.annotation.StandardImageAnnotationForm.java

License:EUPL

protected Panel createLinksPanel(boolean update, ImageAnnotationTreeNode annotationTreeNode) {

    HorizontalPanel linksPanel = new HorizontalPanel();
    Label linksLabel = new Label(Application.getConstants().annotationLinks());
    linksLabel.setStyleName("imageAnnotation-form-label");
    linksPanel.add(linksLabel);/*from  w w w.  java  2s  .c  o m*/

    linksStack = new VerticalPanel();
    linksStack.setStyleName("imageAnnotation-form-links");
    linksPanel.add(linksStack);

    if (update && annotationTreeNode.getAnnotation().hasSemanticTags()) {
        for (SemanticTag t : annotationTreeNode.getAnnotation().getSemanticTags()) {
            addLink(t, linksStack, true);
            if (!this.tags.contains(t)) {
                this.tags.add(t);
            }
        }
    }

    return linksPanel;
}