Examples of DragAndDropWrapper


Examples of com.vaadin.ui.DragAndDropWrapper

            @Override
            public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
                Notification.show("Button clicked!");
            }
        });
        DragAndDropWrapper dragMe = new DragAndDropWrapper(offset);
        dragMe.setDragStartMode(DragStartMode.WRAPPER);
        layout.addComponent(dragMe);
        addComponent(layout);
    }
View Full Code Here

Examples of com.vaadin.ui.DragAndDropWrapper

    private void addDnDPanel(Component content) {
        Panel panel = new Panel();
        panel.setSizeUndefined();
        panel.setWidth("300px");
        panel.setHeight("150px");
        DragAndDropWrapper dndWrapper = new DragAndDropWrapper(content);
        dndWrapper.setSizeFull();
        panel.setContent(dndWrapper);
        addComponent(panel);
    }
View Full Code Here

Examples of com.vaadin.ui.DragAndDropWrapper

        label.setId("tooltipLabel");
        label.setDescription("Good! Tooltip works!");
        label.setSizeUndefined();
        wrapperLayout.addComponent(label);

        DragAndDropWrapper wrapper = new DragAndDropWrapper(wrapperLayout);
        wrapper.setWidth("100%");
        wrapper.setDragStartMode(DragStartMode.WRAPPER);

        addComponent(wrapper);

    }
View Full Code Here

Examples of com.vaadin.ui.DragAndDropWrapper

        VerticalLayout dndLayout = new VerticalLayout();
        TextArea area = new TextArea();
        area.setValue("text");
        dndLayout.addComponent(area);

        DragAndDropWrapper wrapper = new DragAndDropWrapper(dndLayout);
        wrapper.setDragStartMode(DragStartMode.COMPONENT);
        addComponent(wrapper);
    }
View Full Code Here

Examples of com.vaadin.ui.DragAndDropWrapper

        TextArea area = new TextArea();
        area.setValue("text");

        dndLayout.addComponent(area);
        DragAndDropWrapper wrapper = new DragAndDropWrapper(dndLayout);
        wrapper.setDragStartMode(DragStartMode.WRAPPER);
        addComponent(wrapper);
    }
View Full Code Here

Examples of com.vaadin.ui.DragAndDropWrapper

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

            final DragAndDropWrapper dnd = new DragAndDropWrapper(layout);
            dnd.setId("ddwrapper-1");
            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 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,
View Full Code Here

Examples of com.vaadin.ui.DragAndDropWrapper

        TestUtils.injectCSS(this, BASE + B4 + B2 + B3 + HIDEDRAGSOURCE);

        VerticalLayout l = new VerticalLayout();
        l.setWidth("400px");
        l.setHeight("100px");
        dragAndDropWrapper = new DragAndDropWrapper(cssLayout);
        dragAndDropWrapper
                .setDescription("Tooltip for the wrapper wrapping all the draggable layouts");
        dragAndDropWrapper.setSizeFull();
        l.addComponent(dragAndDropWrapper);
View Full Code Here

Examples of com.vaadin.ui.DragAndDropWrapper

public class DndEmptyTable extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        Label source = new Label("label");
        DragAndDropWrapper wrapper = new DragAndDropWrapper(source);
        wrapper.setDragStartMode(DragStartMode.WRAPPER);
        addComponent(wrapper);

        Table target = new Table();
        target.setWidth(100, Unit.PERCENTAGE);
        addComponent(target);
View Full Code Here

Examples of com.vaadin.ui.DragAndDropWrapper

        CssLayout header = new CssLayout();
        header.addComponent(new Label("Drag start mode : COMPONENT_OTHER"));
        header.setSizeUndefined();

        DragAndDropWrapper wrapper = new DragAndDropWrapper(header);
        wrapper.setDragStartMode(DragStartMode.COMPONENT_OTHER);
        wrapper.setDragImageComponent(parent);
        wrapper.setId("label" + "COMPONENT_OTHER");
        parent.addComponent(wrapper);

        Label extra = new Label(
                "Extra label that is not part of the wrapper. This should be dragged along with COMPONENT_OTHER.");
        extra.addStyleName("extra");
View Full Code Here

Examples of com.vaadin.ui.DragAndDropWrapper

    }

    private Component makeWrapper(DragStartMode mode) {
        Label label = new Label("Drag start mode: " + mode);
        label.setId("label" + mode);
        DragAndDropWrapper wrapper = new DragAndDropWrapper(label);
        wrapper.setHTML5DataFlavor("Text", "HTML5!");
        wrapper.setDragStartMode(mode);
        wrapper.setWidth("200px");
        return wrapper;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.