Package com.ponysdk.ui.server.basic

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


        final PVerticalPanel panel = new PVerticalPanel();

        panel.add(new PLabel("Static Tree:"));

        final PTree tree = new PTree();
        tree.setAnimationEnabled(false);
        tree.setWidth("300px");

        tree.addSelectionHandler(new PSelectionHandler<PTreeItem>() {

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

        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);
            }
        });

        final PTreeItem thirdItem = new PTreeItem(new PImage("images/pony.png"));

        tree.addItem(firstItem);
        tree.addItem(secondItem);
        tree.addItem(thirdItem);

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


    protected final PTree tree;

    private final List<PSelectionHandler<MenuItem>> selectionHandlers = new ArrayList<PSelectionHandler<MenuItem>>();

    public DefaultMenuView() {
        tree = new PTree();
        setWidget(tree);
        setSizeFull();
        tree.setSizeFull();
        tree.addSelectionHandler(new PSelectionHandler<PTreeItem>() {
View Full Code Here

TOP

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

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.