Package com.ponysdk.ui.server.basic

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


        examplePanel.setWidget(panel);
    }

    private PHorizontalPanel buildPushButtonPanel() {
        final PHorizontalPanel panel = new PHorizontalPanel();
        panel.setSpacing(10);

        enabledPushButton = new PPushButton(new PImage("images/pony.png"));
        panel.add(enabledPushButton);

        disabledPushButton = new PPushButton(new PImage("images/pony.png"));
        disabledPushButton.setEnabled(false);
        panel.add(disabledPushButton);

        return panel;
    }
View Full Code Here


            public void onClick(final PClickEvent event) {
                UIContext.get().getCookies().removeCookie(name2.getValue());
            }
        });

        final PHorizontalPanel addPanel = new PHorizontalPanel();
        addPanel.add(name);
        addPanel.add(value);
        addPanel.add(add);

        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:"));
View Full Code Here

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

        PHorizontalPanel panel = new PHorizontalPanel();
        panel.setSpacing(10);

        panel.add(new PButton("Button 1"));
        panel.add(new PButton("Button 2"));
        panel.add(new PButton("Button 3"));
        panel.add(new PButton("Button 4"));

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

            if (label.viewable) {
                labelPanel.setWidget(i, 0, new PLabel(nextViewableIndex + ""));
                nextViewableIndex++;
            }

            final PHorizontalPanel panel = new PHorizontalPanel();
            panel.setSizeFull();
            panel.add(label);
            final PHorizontalPanel simplePanel = new PHorizontalPanel();
            final PHorizontalPanel buttonPanel = new PHorizontalPanel();
            panel.add(simplePanel);
            panel.setCellHorizontalAlignment(simplePanel, PHorizontalAlignment.ALIGN_RIGHT);
            labelPanel.setWidget(i, 1, panel);

            // hide button panel : shoul only be visible when mouse hover panel
            buttonPanel.setSizeFull();
            buttonPanel.setVisible(false);
            panel.addDomHandler(new PMouseOverHandler() {

                @Override
                public void onMouseOver(final PMouseOverEvent mouseOverEvent) {
                    buttonPanel.setVisible(true);
                }
            }, PMouseOverEvent.TYPE);
            panel.addDomHandler(new PMouseOutHandler() {

                @Override
                public void onMouseOut(final PMouseOutEvent event) {
                    buttonPanel.setVisible(false);
                }
            }, PMouseOutEvent.TYPE);

            simplePanel.setWidth("30px");
            simplePanel.add(buttonPanel);
            if (i != 1) {

                // up image
                final PImage upImage = new PImage(ARROW_UP_IMAGE_URL);
                upImage.setTitle("Move column up");
                buttonPanel.add(upImage);
                buttonPanel.setCellHorizontalAlignment(upImage, PHorizontalAlignment.ALIGN_LEFT);
                upImage.addClickHandler(new PClickHandler() {

                    @Override
                    public void onClick(final PClickEvent event) {
                        final int index = labels.indexOf(label) - 1;
                        labels.remove(label);
                        labels.add(index, label);
                        fireColumnMoved();
                        for (int row = 1; row <= labels.size(); row++) {
                            labelPanel.getRowFormatter().removeStyleName(row, PonySDKTheme.SIMPLELIST_SELECTEDROW);
                        }
                        labelPanel.getRowFormatter().addStyleName(index + 1, PonySDKTheme.SIMPLELIST_SELECTEDROW);
                    }
                });
            }
            if (i != labels.size()) {
                // down image
                final PImage downImage = new PImage(ARROW_DOWN_IMAGE_URL);
                downImage.setTitle("Move column down");
                buttonPanel.add(downImage);
                buttonPanel.setCellHorizontalAlignment(downImage, PHorizontalAlignment.ALIGN_RIGHT);
                downImage.addClickHandler(new PClickHandler() {

                    @Override
                    public void onClick(final PClickEvent event) {
                        final int index = labels.indexOf(label) + 1;
                        labels.remove(label);
                        labels.add(index, label);
                        fireColumnMoved();
                        for (int row = 1; row <= labels.size(); row++) {
                            labelPanel.getRowFormatter().removeStyleName(row, PonySDKTheme.SIMPLELIST_SELECTEDROW);
                        }
                        labelPanel.getRowFormatter().addStyleName(index + 1, PonySDKTheme.SIMPLELIST_SELECTEDROW);
                    }
                });
            }
            // add erase button for custom column
            if (label.custom) {
                final PButton eraseButton = new PButton("Erase");
                eraseButton.addClickHandler(new PClickHandler() {

                    @Override
                    public void onClick(final PClickEvent event) {
                        eventBus.fireEvent(new RemoveColumnDescriptorEvent(PreferenceForm.this, label.getText(), tableName));
                        labels.remove(label);
                        refreshLabels();
                    }
                });
                buttonPanel.add(eraseButton);
            }

            labelPanel.setWidget(i, 2, label.checkBox);
            labelPanel.getRowFormatter().addStyleName(i, PonySDKTheme.SIMPLELIST_ROW);
            i++;
View Full Code Here

    protected final PLabel searchResultTimeLabel = new PLabel();

    public DefaultComplexListView() {
        setSizeFull();

        final PHorizontalPanel toolbarGroupPanel = new PHorizontalPanel();
        toolbarGroupPanel.setVerticalAlignment(PVerticalAlignment.ALIGN_MIDDLE);
        toolbarGroupPanel.setWidth("100%");
        toolbarGroupPanel.add(toolbarLayout.asWidget());
        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();
View Full Code Here

        mainCheckBox.setValue(value);
        // rowSelectorAction = false;
    }

    protected void showSelectAllOption() {
        final PHorizontalPanel panel = new PHorizontalPanel();
        panel.setHorizontalAlignment(PHorizontalAlignment.ALIGN_CENTER);
        panel.setStyleName("pony-ComplexList-OptionSelectionPanel");
        final PLabel label = new PLabel("All " + rowSelectors.size() + " items on this page are selected.");
        final int fullSize = findResult.getFullSize();
        panel.add(label);
        if (fullSize > complexListConfiguration.getPageSize()) {
            final PAnchor anchor = new PAnchor("Select all " + fullSize + " final items in Inbox");
            anchor.addClickHandler(new PClickHandler() {

                @Override
                public void onClick(final PClickEvent event) {
                    selectionMode = SelectionMode.FULL;
                    showClearSelectAllOption();
                }
            });
            panel.add(anchor);
            panel.setCellHorizontalAlignment(label, PHorizontalAlignment.ALIGN_RIGHT);
            panel.setCellHorizontalAlignment(anchor, PHorizontalAlignment.ALIGN_LEFT);
        }
        complexListView.getTopListLayout().setWidget(panel);
    }
View Full Code Here

        }
        complexListView.getTopListLayout().setWidget(panel);
    }

    protected void showClearSelectAllOption() {
        final PHorizontalPanel panel = new PHorizontalPanel();
        panel.setHorizontalAlignment(PHorizontalAlignment.ALIGN_CENTER);
        panel.setStyleName("pony-ComplexList-OptionSelectionPanel");
        final PLabel label = new PLabel("All " + findResult.getFullSize() + " items are selected.");
        final PAnchor anchor = new PAnchor("Clear selection");
        anchor.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                mainCheckboxChanged(false);
            }
        });
        panel.add(label);
        panel.add(anchor);
        panel.setCellHorizontalAlignment(label, PHorizontalAlignment.ALIGN_RIGHT);
        panel.setCellHorizontalAlignment(anchor, PHorizontalAlignment.ALIGN_LEFT);
        complexListView.getTopListLayout().setWidget(panel);
    }
View Full Code Here

        // creation
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                final PHorizontalPanel horizontal1 = new PHorizontalPanel();
                horizontal1.ensureDebugId("horizontal1");
                horizontal1.add(new PLabel("cell1"));
                horizontal1.add(new PLabel("cell2"));
                horizontal1.add(new PLabel("cell3"));
                horizontal1.add(new PLabel("cell4"));
                horizontal1.setBorderWidth(2);
                horizontal1.setSpacing(3);
                PRootPanel.get().add(horizontal1);
                register(horizontal1);
            }
        });

        WebElement grid1 = findElementById("horizontal1");
        List<WebElement> rows = grid1.findElements(By.tagName("tr"));
        Assert.assertEquals(1, rows.size());
        List<WebElement> cells = grid1.findElements(By.tagName("td"));
        Assert.assertEquals(4, cells.size());

        Assert.assertEquals(grid1.getAttribute("border"), "2");
        Assert.assertEquals(grid1.getAttribute("cellSpacing"), "3");

        // update cell size/alignement
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                final PHorizontalPanel horizontal1 = get("horizontal1");
                final PWidget cell1 = horizontal1.getWidget(1);
                horizontal1.setCellHeight(cell1, "30px");
                horizontal1.setCellWidth(cell1, "100px");
                horizontal1.setCellHorizontalAlignment(cell1, PHorizontalAlignment.ALIGN_RIGHT);
                horizontal1.setCellVerticalAlignment(cell1, PVerticalAlignment.ALIGN_BOTTOM);
            }
        });

        grid1 = findElementById("horizontal1");
        rows = grid1.findElements(By.tagName("tr"));
View Full Code Here

TOP

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

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.