Package com.vaadin.event.dd

Examples of com.vaadin.event.dd.DropHandler


        table.setColumnCollapsingAllowed(true);
        table.setColumnReorderingAllowed(true);
        table.setPageLength(6);
        table.addActionHandler(ValoThemeUI.getActionHandler());
        table.setDragMode(TableDragMode.MULTIROW);
        table.setDropHandler(new DropHandler() {
            @Override
            public AcceptCriterion getAcceptCriterion() {
                return AcceptAll.get();
            }
View Full Code Here


                public void valueChange(ValueChangeEvent event) {
                    dnd.setEnabled(enabled.booleanValue());
                }
            });

            dnd.setDropHandler(new DropHandler() {

                @Override
                public AcceptCriterion getAcceptCriterion() {
                    return AcceptAll.get();
                }

                @Override
                public void drop(DragAndDropEvent event) {
                    layout.addComponent(new Label("You dropped something!"));
                }
            });

            dnd.setDragStartMode(DragStartMode.COMPONENT);
        }

        {
            final Panel p = new Panel("Drag here");
            addComponent(p);

            final CssLayout layout = new CssLayout();
            layout.setId("csslayout-2");
            layout.setHeight("100px");

            final DragAndDropWrapper dnd = new DragAndDropWrapper(layout);
            dnd.setId("ddwrapper-2");
            p.setContent(dnd);

            final CheckBox enabled = new CheckBox("Enabled", true);
            addComponent(enabled);
            enabled.setImmediate(true);
            enabled.addListener(new ValueChangeListener() {

                @Override
                public void valueChange(ValueChangeEvent event) {
                    dnd.setEnabled(enabled.booleanValue());
                }
            });

            dnd.setDropHandler(new DropHandler() {

                @Override
                public AcceptCriterion getAcceptCriterion() {
                    return AcceptAll.get();
                }

                @Override
                public void drop(DragAndDropEvent event) {
                    layout.addComponent(new Label("You dropped something!"));
                }
            });

            dnd.setDragStartMode(DragStartMode.COMPONENT);
        }

        {
            final Table tbl = new Table();
            tbl.addContainerProperty("column", String.class,
                    "drag/drop to/from here");
            for (int i = 0; i < 5; i++) {
                tbl.addItem();
            }
            addComponent(tbl);
            tbl.setDragMode(TableDragMode.ROW);
            tbl.setDropHandler(new DropHandler() {

                @Override
                public AcceptCriterion getAcceptCriterion() {
                    return AcceptAll.get();
                }
View Full Code Here

        addComponent(wrapper);

        Table target = new Table();
        target.setWidth(100, Unit.PERCENTAGE);
        addComponent(target);
        target.setDropHandler(new DropHandler() {

            @Override
            public AcceptCriterion getAcceptCriterion() {
                return AcceptAll.get();
            }
View Full Code Here

    @Override
    protected void setup(VaadinRequest request) {
        final DragAndDropWrapper dndWrapper = new DragAndDropWrapper(
                new Button("Upload here by drag and dropping"));
        dndWrapper.setDropHandler(new DropHandler() {

            @Override
            public AcceptCriterion getAcceptCriterion() {
                return AcceptAll.get();
            }
View Full Code Here

    public AcceptAnythingWindow() {
        setCaption("Drop anything here");

        final DragAndDropWrapper wrapper = new DragAndDropWrapper(layout);
        wrapper.setDropHandler(new DropHandler() {

            @Override
            public AcceptCriterion getAcceptCriterion() {
                return AcceptAll.get();
            }
View Full Code Here

        dragStart.setHTML5DataFlavor("Text", "HTML5!");
        addComponent(dragStart);

        DragAndDropWrapper dropTarget = new DragAndDropWrapper(new Label(
                "over here"));
        dropTarget.setDropHandler(new DropHandler() {

            @Override
            public AcceptCriterion getAcceptCriterion() {
                return AcceptAll.get();
            }
View Full Code Here

        dragAndDropWrapper2 = new DragAndDropWrapper(cssLayout);
        dragAndDropWrapper2
                .setCaption("Drop here or sort with dd (wrapper(csslayout(n*wrapper(label))))");

        dh = new DropHandler() {

            @Override
            public AcceptCriterion getAcceptCriterion() {
                return AcceptAll.get();
            }
View Full Code Here

         * Moves items in tree (and could work in Table too). Also supports
         * "building" tree.
         *
         * TODO fix algorithm, broken in some cases.
         */
        DropHandler itemSorter = new DropHandler() {

            @SuppressWarnings("unused")
            private void populateSubTree(HierarchicalContainer idx,
                    HierarchicalContainer subtree, Object itemId) {
                Collection<?> children = subtree.getChildren(itemId);
View Full Code Here

        l.setSizeUndefined();
        cssLayout.addComponent(l);
        DragAndDropWrapper dragAndDropWrapper = new DragAndDropWrapper(
                cssLayout);
        dragAndDropWrapper.setSizeUndefined();
        dragAndDropWrapper.setDropHandler(new DropHandler() {

            @Override
            public AcceptCriterion getAcceptCriterion() {
                return AcceptAll.get();
            }
View Full Code Here

        final Table target = createTable("Target");

        source1.setDragMode(TableDragMode.ROW);
        source2.setDragMode(TableDragMode.ROW);

        target.setDropHandler(new DropHandler() {
            @Override
            public AcceptCriterion getAcceptCriterion() {
                return new SourceIs(source1, source2);
            }
View Full Code Here

TOP

Related Classes of com.vaadin.event.dd.DropHandler

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.