Package com.ponysdk.ui.server.basic

Examples of com.ponysdk.ui.server.basic.PVerticalPanel


    @Override
    protected void onFirstShowPage() {
        super.onFirstShowPage();

        final PVerticalPanel verticalPanel = new PVerticalPanel();

        final PWidget box1 = buildBox("Box 1");
        final PWidget box2 = buildBox("Box 2");
        final PWidget box3 = buildBox("Box 3");
        final PWidget box4 = buildBox("Box 4");
        boxContainer.add(box1);
        boxContainer.add(box2);
        boxContainer.add(box3);
        boxContainer.add(box4);

        verticalPanel.add(boxContainer);

        examplePanel.setWidget(verticalPanel);
    }
View Full Code Here


    @Override
    protected void onFirstShowPage() {
        super.onFirstShowPage();

        final PVerticalPanel panel = new PVerticalPanel();

        panel.add(new PLabel("StackLayout: "));

        final PStackLayoutPanel stackLayoutPanel = new PStackLayoutPanel(PUnit.PX);

        stackLayoutPanel.setStyleProperty("border", "1px solid #CCC");

        stackLayoutPanel.setWidth("200px");
        stackLayoutPanel.setHeight("400px");
        stackLayoutPanel.add(getHeader1Child(), "Header 1", true, 30);
        stackLayoutPanel.add(getHeader2Child(), "Header 2", true, 30);

        stackLayoutPanel.addSelectionHandler(new PSelectionHandler<Integer>() {

            @Override
            public void onSelection(final PSelectionEvent<Integer> event) {
                final String msg = "On selection : " + event.getSelectedItem();
                UIContext.getRootEventBus().fireEvent(new DemoBusinessEvent(msg));
            }
        });

        panel.add(stackLayoutPanel);

        examplePanel.setWidget(panel);
    }
View Full Code Here

    @Override
    protected void onFirstShowPage() {
        super.onFirstShowPage();

        final PVerticalPanel panel = new PVerticalPanel();

        panel.add(new PLabel("Choose a word:"));

        final PSuggestBox suggestBox = new PSuggestBox();
        suggestBox.setLimit(10);

        final PMultiWordSuggestOracle suggestOracle = (PMultiWordSuggestOracle) suggestBox.getSuggestOracle();
        suggestBox.addSelectionHandler(new PSelectionHandler<PSuggestion>() {

            @Override
            public void onSelection(final PSelectionEvent<PSuggestion> event) {
                final String msg = "Selected item : " + event.getSelectedItem().getReplacementString();
                UIContext.getRootEventBus().fireEvent(new DemoBusinessEvent(msg));
            }
        });

        final Query query = new Query();
        final FindPonysCommand command = new FindPonysCommand(query);
        final Result<List<Pony>> ponys = command.execute();

        final List<String> datas = new ArrayList<String>();
        for (final Pony pony : ponys.getData()) {
            datas.add(pony.getName());
        }
        suggestOracle.addAll(datas);
        suggestOracle.setDefaultSuggestions(datas.subList(0, 5));

        panel.add(suggestBox);

        panel.add(new PHTML("<br><br>"));

        panel.add(new PLabel("Manipulate the suggest box:"));
        final PListBox operation = new PListBox(true);
        operation.addItem("Select \"Friesian horse\"", 0);
        operation.addItem("Get textbox value", 1);
        operation.addItem("Enable/Disable textbox", 2);
        operation.addItem("Clear", 3);
        operation.addItem("Add items", 4);
        operation.addChangeHandler(new PChangeHandler() {

            @Override
            public void onChange(final PChangeEvent event) {
                final Integer item = (Integer) operation.getSelectedValue();
                if (item == null) return;

                if (item.equals(0)) {
                    suggestBox.setText("Friesian horse");
                } else if (item.equals(1)) {
                    UIContext.getRootEventBus().fireEvent(new DemoBusinessEvent("Text content: " + suggestBox.getText()));
                } else if (item.equals(2)) {
                    suggestBox.getTextBox().setEnabled(!suggestBox.getTextBox().isEnabled());
                } else if (item.equals(3)) {
                    final PMultiWordSuggestOracle oracle = (PMultiWordSuggestOracle) suggestBox.getSuggestOracle();
                    oracle.clear();
                } else if (item.equals(4)) {
                    current++;
                    final Result<List<Pony>> ponys = command.execute();
                    for (final Pony pony : ponys.getData()) {
                        suggestOracle.add(pony.getName() + " " + current);
                    }
                }
            }
        });
        panel.add(operation);

        examplePanel.setWidget(panel);
    }
View Full Code Here

    @Override
    protected void onFirstShowPage() {
        super.onFirstShowPage();

        final PVerticalPanel panel = new PVerticalPanel();

        panel.add(buildButtonPanel());
        panel.add(buildThemeSelectorPanel());

        basicAddOn = new BasicAddOn();
        basicAddOn.send("initialization done");

        examplePanel.setWidget(panel);
View Full Code Here

    @Override
    protected void onFirstShowPage() {
        super.onFirstShowPage();

        final PVerticalPanel panel = new PVerticalPanel();

        final PMenuBar menuBar1 = createMenuBar(false);
        final PMenuBar menuBar2 = createMenuBar(true);
        final PMenuBar menuBar3 = createMenuBar(true);
        final PMenuBar menuBar4 = createMenuBar(true);

        panel.add(new PLabel("Horizontal Menu Bar [Default Style]"));
        panel.add(menuBar1);
        panel.add(new PLabel("Vertical Menu Bar [Default Style]"));
        panel.add(menuBar2);
        panel.add(new PLabel("Vertical Menu Bar [Light Style]"));
        panel.add(menuBar3);
        panel.add(new PLabel("Vertical Menu Bar [Toolbar Style]"));
        panel.add(menuBar4);

        menuBar2.setStylePrimaryName("samplePopup");
        menuBar3.addStyleName(PonySDKTheme.MENUBAR_LIGHT);
        menuBar4.setStyleName("pony-ActionToolbar");
View Full Code Here

    @Override
    protected void onFirstShowPage() {
        super.onFirstShowPage();

        final PVerticalPanel panelTop = new PVerticalPanel();
        panelTop.setSpacing(10);

        panelTop.add(new PLabel("Select your favorite color:"));

        panelTop.add(newPRadioButton("color", "blue"));
        panelTop.add(newPRadioButton("color", "red"));

        final PRadioButton yellow = newPRadioButton("color", "yellow");
        yellow.setEnabled(false);
        panelTop.add(yellow);

        panelTop.add(newPRadioButton("color", "green"));

        final PVerticalPanel panelBottom = new PVerticalPanel();
        panelBottom.setSpacing(10);

        panelBottom.add(new PLabel("Select your favorite sport:"));
        panelBottom.add(newPRadioButton("sport", "Polo"));
        panelBottom.add(newPRadioButton("sport", "Rodeo"));
        panelBottom.add(newPRadioButton("sport", "Horse racing"));
        panelBottom.add(newPRadioButton("sport", "Dressage"));
        panelBottom.add(newPRadioButton("sport", "Endurance riding"));
        panelBottom.add(newPRadioButton("sport", "Eventing"));
        panelBottom.add(newPRadioButton("sport", "Reining"));
        panelBottom.add(newPRadioButton("sport", "Show jumping"));
        panelBottom.add(newPRadioButton("sport", "Tent pegging"));
        panelBottom.add(newPRadioButton("sport", "Vaulting"));

        panelTop.add(panelBottom);

        final PVerticalPanel panel = new PVerticalPanel();
        panel.add(panelTop);
        panel.add(panelBottom);

        examplePanel.setWidget(panel);
    }
View Full Code Here

    @Override
    protected void onFirstShowPage() {
        super.onFirstShowPage();

        final PVerticalPanel panel = new PVerticalPanel();
        panel.setSpacing(10);

        final PFileUpload fileUpload = new PFileUpload();
        fileUpload.setName("my_file");
        fileUpload.addSubmitCompleteHandler(new PSubmitCompleteHandler() {

            @Override
            public void onSubmitComplete() {
                PNotificationManager.showTrayNotification("File uploaded, submit file '" + fileUpload.getFileName() + "'");
            }
        });

        fileUpload.addStreamHandler(new StreamHandler() {

            @Override
            public void onStream(final HttpServletRequest request, final HttpServletResponse response) {
                try {
                    response.setStatus(HttpServletResponse.SC_CREATED);
                    response.getWriter().print("The file was created successfully.");
                    response.flushBuffer();
                } catch (final IOException e) {
                    e.printStackTrace();
                }
            }
        });

        final PButton submitButton = new PButton("Upload File");
        submitButton.showLoadingOnRequest(true);
        submitButton.setEnabledOnRequest(false);

        submitButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                fileUpload.submit();
            }
        });

        panel.add(fileUpload);
        panel.add(submitButton);

        examplePanel.setWidget(panel);
    }
View Full Code Here

            public void onClick(final PClickEvent event) {
                keyUphandler.refresh(textbox.getText());
            }
        });

        final PVerticalPanel mainPanel = new PVerticalPanel();
        final PHorizontalPanel textBoxAndDeployButtonPanel = new PHorizontalPanel();
        textBoxAndDeployButtonPanel.add(textbox);
        textBoxAndDeployButtonPanel.add(deploy);
        textBoxAndDeployButtonPanel.setCellVerticalAlignment(textbox, PVerticalAlignment.ALIGN_MIDDLE);
        textBoxAndDeployButtonPanel.setCellVerticalAlignment(deploy, PVerticalAlignment.ALIGN_MIDDLE);
        mainPanel.add(captionLabel);
        mainPanel.add(textBoxAndDeployButtonPanel);

        return mainPanel;
    }
View Full Code Here

    @Override
    protected void onFirstShowPage() {
        super.onFirstShowPage();

        PVerticalPanel panel = new PVerticalPanel();

        final PDisclosurePanel disclosurePanel = new PDisclosurePanel("View details");
        disclosurePanel.setContent(getDisclosurePanelContent());
        disclosurePanel.setWidth("200px");

        panel.setSpacing(10);
        panel.add(disclosurePanel);

        examplePanel.setWidget(panel);
    }
View Full Code Here

            initDeploy();
            this.textBox = textBox;
            this.popup = popup;
            this.nextPaginationLabel = new PLabel();
            nextPaginationLabel.setStyleName(PonySDKTheme.ORACLE_PAGINATION);
            this.popupContent = new PVerticalPanel();
            popupContent.setSizeFull();
            setHorizontalAlignment(PHorizontalAlignment.ALIGN_LEFT);
            add(previousPaginationLabel);
            add(up);
            setCellHorizontalAlignment(up, PHorizontalAlignment.ALIGN_CENTER);
View Full Code Here

TOP

Related Classes of com.ponysdk.ui.server.basic.PVerticalPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.