Package com.ponysdk.ui.server.basic

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


        optionsAnchor.addStyleName(PonySDKTheme.HEADER_ACCOUNT_MENU);

        popup = new PPopupPanel();
        popup.addStyleName(PonySDKTheme.HEADER_ACCOUNT_MENU_POPUP);

        final PVerticalPanel panel = new PVerticalPanel();
        final PLabel userName = new PLabel(userLogged.getName());
        userName.addStyleName(PonySDKTheme.HEADER_ACCOUNT_MENU_POPUP_USER_NAME);
        panel.add(userName);

        final PLabel userLogin = new PLabel(userLogged.getLogin());
        userLogin.addStyleName(PonySDKTheme.HEADER_ACCOUNT_MENU_POPUP_USER_LOGIN);
        panel.add(userLogin);

        final PAnchor signOutAnchor = new PAnchor("Sign out");

        panel.add(signOutAnchor);
        popup.setWidget(panel);

        signOutAnchor.ensureDebugId("sign_out_anchor");
        signOutAnchor.addClickHandler(new PClickHandler() {
View Full Code Here


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

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

        final PHTML htmlBold = new PHTML("<b>Pony Bold</b> and <font color='red'>Pony Red</font> using HTML");
        final PHTML htmlClickable = new PHTML("<span style='cursor: pointer;border: 1px solid black;color:white;background-color:gray;margin:5px;padding:10px'>click me!</span> using HTML and CSS");
        htmlClickable.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                logEvent("HTML clicked", clickEvent);
            }

        });

        final PHTML htmlDoubleClickable = new PHTML("<span style='cursor: pointer;border: 1px solid black;color:white;background-color:gray;margin:5px;padding:10px'>double click me!</span> using HTML and CSS");
        htmlDoubleClickable.addDoubleClickHandler(new PDoubleClickHandler() {

            @Override
            public void onDoubleClick(final PDoubleClickEvent clickEvent) {
                logEvent("HTML double clicked", clickEvent);
            }

        });

        final PHTML htmlWithContextMenu = new PHTML("<span style='cursor: pointer;border: 1px solid black;color:white;background-color:gray;margin:5px;padding:10px'>context menu on me!</span> using HTML and CSS");
        htmlWithContextMenu.preventEvent(PEvent.ONCONTEXTMENU);
        htmlWithContextMenu.addDomHandler(new PContextMenuHandler() {

            @Override
            public void onContextMenu(final PContextMenuEvent event) {
                PNotificationManager.showHumanizedNotification("Context menu triggered");
            }
        }, PContextMenuEvent.TYPE);

        final PCheckBox checkBox = new PCheckBox();
        checkBox.setHTML("<font color='blue'>Pony-SDK</font>");

        verticalPanel.add(htmlBold);
        verticalPanel.setCellWidth(htmlBold, "400px");
        verticalPanel.setCellHeight(htmlBold, "50px");

        verticalPanel.add(htmlClickable);
        verticalPanel.setCellWidth(htmlClickable, "400px");
        verticalPanel.setCellHeight(htmlClickable, "50px");

        verticalPanel.add(htmlDoubleClickable);
        verticalPanel.setCellWidth(htmlDoubleClickable, "400px");
        verticalPanel.setCellHeight(htmlDoubleClickable, "50px");

        verticalPanel.add(htmlWithContextMenu);
        verticalPanel.setCellWidth(htmlWithContextMenu, "400px");
        verticalPanel.setCellHeight(htmlWithContextMenu, "50px");

        verticalPanel.add(checkBox);
        verticalPanel.setCellWidth(checkBox, "400px");
        verticalPanel.setCellHeight(checkBox, "50px");

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

        final PHorizontalPanel removePanel = new PHorizontalPanel();
        removePanel.add(name2);
        removePanel.add(remove);

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

        panel.add(new PLabel("Add a cookie:"));
        panel.add(addPanel);
        panel.add(new PLabel("Remove a cookie:"));
        panel.add(removePanel);

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

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

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

        datePicker = new PDatePicker();
        datePicker.addStyleToDates("off", dates("12/25/2013", "01/01/2014", "04/26/2014"));
        datePicker.addValueChangeHandler(new PValueChangeHandler<Date>() {

            @Override
            public void onValueChange(final PValueChangeEvent<Date> event) {
                notifyDateChange("picker", event.getValue());
                dateBox.setDefaultMonth(datePicker.getValue());
            }
        });

        final Date middecember = dates("12/15/2013").get(0);
        datePicker.addShowRangeHandler(new PShowRangeHandler<Date>() {

            @Override
            public void onShowRange(final PShowRangeEvent<Date> event) {
                PNotificationManager.showTrayNotification("Range <" + event.getStart() + "," + event.getEnd() + ">");
                if (middecember.after(event.getStart()) && middecember.before(event.getEnd())) {
                    datePicker.setTransientEnabledOnDates(false, dates("12/21/2013", "12/22/2013", "12/23/2013", "12/24/2013"));
                }
            }
        });

        dateBox = new PDateBox();
        dateBox.addValueChangeHandler(new PValueChangeHandler<Date>() {

            @Override
            public void onValueChange(final PValueChangeEvent<Date> event) {
                notifyDateChange("datebox", event.getValue());
            }
        });

        panel.add(new PLabel("Permanent DatePicker:"));
        panel.add(datePicker);
        panel.add(new PLabel("DateBox with popup DatePicker:"));
        panel.add(dateBox);

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

        // creation
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                final PComplexPanel complexPanel1 = new PVerticalPanel();
                complexPanel1.ensureDebugId("complexPanel1");
                PRootPanel.get().add(complexPanel1);
                register(complexPanel1);
            }
        });

        WebElement element = findElementById("complexPanel1");
        final PComplexPanel complexPanel1 = get("complexPanel1");

        // add child
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                final PComplexPanel complexPanel1 = get("complexPanel1");
                complexPanel1.add(new PAnchor("child1"));
                complexPanel1.add(new PAnchor("child3"));
            }
        });

        element = findElementById("complexPanel1");
        List<WebElement> anchors = element.findElements(By.tagName("a"));
        Assert.assertEquals(2, anchors.size());
        Assert.assertEquals(2, complexPanel1.getWidgetCount());

        // insert child
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                final PVerticalPanel complexPanel1 = get("complexPanel1");
                final PAnchor child2 = new PAnchor("child2");
                child2.ensureDebugId("child2");
                complexPanel1.insert(child2, 1);
                register(child2);
            }
        });

        element = findElementById("complexPanel1");
        anchors = element.findElements(By.tagName("a"));
        Assert.assertEquals(3, anchors.size());
        Assert.assertEquals("child1", anchors.get(0).getText());
        Assert.assertEquals("child2", anchors.get(1).getText());
        Assert.assertEquals("child3", anchors.get(2).getText());

        Assert.assertEquals(3, complexPanel1.getWidgetCount());
        Assert.assertEquals("child1", ((PAnchor) complexPanel1.getWidget(0)).getText());
        Assert.assertEquals("child2", ((PAnchor) complexPanel1.getWidget(1)).getText());
        Assert.assertEquals("child3", ((PAnchor) complexPanel1.getWidget(2)).getText());

        // remove child
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                final PComplexPanel complexPanel1 = get("complexPanel1");
                final PAnchor child2 = get("child2");
                complexPanel1.remove(child2);
            }
        });

        element = findElementById("complexPanel1");
        anchors = element.findElements(By.tagName("a"));
        Assert.assertEquals(2, anchors.size());
        Assert.assertEquals("child1", anchors.get(0).getText());
        Assert.assertEquals("child3", anchors.get(1).getText());

        Assert.assertEquals(2, complexPanel1.getWidgetCount());
        Assert.assertEquals("child1", ((PAnchor) complexPanel1.getWidget(0)).getText());
        Assert.assertEquals("child3", ((PAnchor) complexPanel1.getWidget(1)).getText());
    }
View Full Code Here

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

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

        final PAnchor anchor = new PAnchor("And a link");
        anchor.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                PNotificationManager.showTrayNotification("Link clicked");
            }
        });

        final PElement ul = new PElement("ul");
        final PElement li1 = new PElement("li");
        final PElement li2 = new PElement("li");
        final PElement li3 = new PElement("li");
        final PElement li4 = new PElement("li");
        li1.setInnerText("Item 1");
        li2.setInnerText("Item 2");
        li3.setInnerText("Item 3");
        li3.setInnerText("Item 3");
        li4.add(anchor);
        ul.add(li1);
        ul.add(li2);
        ul.add(li3);
        ul.add(li4);
        ul.addStyleName("customList");

        verticalPanel.add(new PLabel("Example of the use of PElement to create an unordered list"));
        verticalPanel.add(ul);

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

        mainformFieldRenderer.setEnabled(false);

        this.from = from;
        this.to = to;

        popupContent = new PVerticalPanel();
        popupContent.add(new PLabel("from"));
        popupContent.add(from.render().asWidget());
        popupContent.add(new PLabel("to"));
        popupContent.add(to.render().asWidget());
        final PKeyUpFilterHandler handler = new PKeyUpFilterHandler(PKeyCodes.ENTER) {
View Full Code Here

        toolbarGroupPanel.add(pagingLayout);
        toolbarGroupPanel.add(preferencesLayout);
        toolbarGroupPanel.setCellHorizontalAlignment(pagingLayout.asWidget(), PHorizontalAlignment.ALIGN_RIGHT);
        topListLayout.setSizeFull();

        final PVerticalPanel headerPanel = new PVerticalPanel();
        headerPanel.setVerticalAlignment(PVerticalAlignment.ALIGN_MIDDLE);
        headerPanel.setSizeFull();
        headerPanel.setStyleProperty("paddingLeft", "1em");
        headerPanel.setStyleProperty("paddingRight", "1.3em");
        headerPanel.add(inputLayout);
        headerPanel.add(toolbarGroupPanel);
        headerPanel.add(topListLayout);
        headerPanel.setWidth("100%");

        positionPanel.setWidget(headerPanel);

        bottomListLayout.setWidget(searchResultTimeLabel);
View Full Code Here

    protected void buildSearchForm() {
        if (complexListConfiguration.isEnableForm()) {
            PPanel formLayout = complexListConfiguration.getFormLayout();
            if (formLayout == null) {
                formLayout = new PVerticalPanel();
            }

            final FormView formView = new DefaultFormView("SearchForm", formLayout);
            final FormConfiguration formConfiguration = new FormConfiguration();
            formConfiguration.setName(complexListConfiguration.getTableName() + "filterForm");
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.