Package com.ponysdk.ui.server.basic

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


        examplePanel.setWidget(panel);
    }

    private PWidget getHeader1Child() {
        header1Child.setWidth("100%");
        header1Child.add(new PAnchor("Element 1.1"));
        header1Child.add(new PAnchor("Element 1.2"));
        header1Child.add(new PAnchor("Element 1.3"));
        header1Child.add(new PAnchor("Element 1.4"));
        final PSimplePanel container = new PSimplePanel();
        container.setWidget(header1Child);
        return container;
    }
View Full Code Here


            }
        });

        final PTreeItem firstItem = new PTreeItem("First item");

        final PAnchor anchor = new PAnchor("Second item");
        final PTreeItem secondItem = new PTreeItem(anchor);
        anchor.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                secondItem.setState(secondItem.getState() ? false : true);
            }
View Full Code Here

        headInline.addStyleName("head_inline");
        final PFlowPanel icon = new PFlowPanel();
        icon.addStyleName("icon");
        final PLabel header = new PLabel(currency);
        header.addStyleName("header");
        final PAnchor close = new PAnchor();
        close.addStyleName("close");
        final PHTML buy = new PHTML("<div></div>");
        buy.addStyleName("buy");
        buy.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                PNotificationManager.showHumanizedNotification("Buy clicked!");
            }
        });

        final PLabel buyPipHead = new PLabel("buy");
        buyPipHead.addStyleName("buy_pip_head");
        final PLabel buyNum = new PLabel("1.22");
        buyNum.addStyleName("buy_num");
        final PFlowPanel buyPipNum = new PFlowPanel();
        buyPipNum.addStyleName("buy_pip_num");
        final PElement buyPipNumStrong = new PElement("strong");
        final PFlowPanel buyDirection = new PFlowPanel();
        buyDirection.addStyleName("buy_direction");
        final PHTML sell = new PHTML("<div></div>");
        sell.addStyleName("sell");
        sell.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                PNotificationManager.showHumanizedNotification("Sell clicked!");
            }
        });
        final PLabel sellPipHead = new PLabel("offer");
        sellPipHead.addStyleName("sell_pip_head");
        final PLabel sellNum = new PLabel("1.45");
        sellNum.addStyleName("sell_num");
        final PElement sellPipNumStrong = new PElement("strong");
        final PFlowPanel sellPipNum = new PFlowPanel();
        sellPipNum.addStyleName("sell_pip_num");
        final PLabel amtLabel = new PLabel("EUR");
        amtLabel.addStyleName("amtlabel");
        final PFlowPanel sellDirection = new PFlowPanel();
        sellDirection.addStyleName("sell_direction");
        final PLabel spread = new PLabel();
        spread.addStyleName("spread");
        final PTextBox textBox = new PTextBox();
        textBox.setStyleName("input");
        final PAnchor selector = new PAnchor();
        selector.addStyleName("selector");

        box.add(background);
        box.add(headInline);
        headInline.add(icon);
        headInline.add(header);
View Full Code Here

            // Sub category
            final Node parentCategory = categoryNode.parent;
            final PComplexPanel categoryPanel = categoriesByNode.get(parentCategory);
            if (categoryPanel == null) throw new IllegalArgumentException("Category '" + categoryNode.name + "' not assigned to a parent category");

            final PAnchor category = new PAnchor(categoryNode.name);
            applyPadding(categoryNode, category);
            applyExpandableStyle(categoryNode, category);
            category.addClickHandler(new PClickHandler() {

                @Override
                public void onClick(final PClickEvent clickEvent) {
                    if (categoryNode.open) {
                        collapseNode(categoryNode);
                        applyExpandableStyle(categoryNode, category);
                    } else {
                        expandNode(categoryNode);
                        applyExpandableStyle(categoryNode, category);
                    }
                }
            });

            if (!parentCategory.open) category.setVisible(false);

            categoryPanel.add(category);

            categoryNode.ui = category;
            categoriesByNode.put(categoryNode, categoryPanel);
View Full Code Here

    private void addItem(final Node categoryNode, final MenuItem menuItem) {
        final Node itemNode = new Node(categoryNode, menuItem.getName());

        final PComplexPanel categoryPanel = categoriesByNode.get(categoryNode);
        final PAnchor item = new PAnchor(menuItem.getName());
        item.ensureDebugId("page_" + menuItem.getName());
        applyPadding(itemNode, item);
        item.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                final PSelectionEvent<MenuItem> event = new PSelectionEvent<MenuItem>(this, menuItem);
                for (final PSelectionHandler<MenuItem> handler : selectionHandlers) {
                    handler.onSelection(event);
                }
            }
        });
        if (!categoryNode.open) item.setVisible(false);

        itemNode.ui = item;

        categoryPanel.add(item);
        anchorByName.put(menuItem, item);
View Full Code Here

    @Override
    public void selectItem(final MenuItem menuItem) {

        if (selectedItem != null) selectedItem.removeStyleName("selectedItem");

        final PAnchor item = anchorByName.get(menuItem);
        item.addStyleName("selectedItem");
        selectedItem = item;

        int i = 1;
        Node current = null;
        for (final String category : menuItem.getCategories()) {
View Full Code Here

    private void initActionPanel() {
        actionPanel = new PHorizontalPanel();
        actionPanel.addStyleName(PonySDKTheme.LOG_CONSOLE_ACTIONS);

        final PAnchor clearLogs = new PAnchor("Clear logs");

        clearLogs.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                logsPanel.clear();
            }
View Full Code Here

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

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

        final PAnchor checkBoxAnchor = new PAnchor("CheckBox");
        checkBoxAnchor.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                goTo(new PagePlace("CheckBox"));
            }
        });
        panel.add(checkBoxAnchor);

        final PAnchor radioButtonAnchor = new PAnchor("RadioButton");
        radioButtonAnchor.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                goTo(new PagePlace("Radio Button"));
            }
        });
        panel.add(radioButtonAnchor);

        final PAnchor basicButtonAnchor = new PAnchor("BasicButton");
        basicButtonAnchor.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                goTo(new PagePlace("Basic Button"));
            }
        });
        panel.add(basicButtonAnchor);

        final PAnchor customButtonAnchor = new PAnchor("CustomButton");
        customButtonAnchor.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                goTo(new PagePlace("Custom Button"));
            }
        });
        panel.add(customButtonAnchor);

        final PAnchor fileUpload = new PAnchor("FileUpload");
        fileUpload.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                goTo(new PagePlace("File Upload"));
            }
View Full Code Here

        }

        void unselect() {
            setInnerText(null);

            anchor = new PAnchor(item);
            anchor.addClickHandler(this);

            add(anchor);
        }
View Full Code Here

        this.place = place;
    }

    @Override
    public IsPWidget render0(final int row, final String value) {
        final PAnchor anchor = new PAnchor(value);
        anchor.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                UIContext.fireEvent(new PlaceChangeRequestEvent(PlaceChangeCellRenderer.this, place));
            }
View Full Code Here

TOP

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

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.