diff options
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.java | 31 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java | 1 |
2 files changed, 30 insertions, 2 deletions
diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.java b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.java index b143ddf2dc..8539f70b17 100644 --- a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.java +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.java @@ -3,26 +3,53 @@ package com.vaadin.tests.components.draganddropwrapper; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.TestUtils; import com.vaadin.ui.Component; +import com.vaadin.ui.CssLayout; import com.vaadin.ui.DragAndDropWrapper; import com.vaadin.ui.DragAndDropWrapper.DragStartMode; import com.vaadin.ui.Label; +import com.vaadin.ui.VerticalLayout; public class DragStartModes extends TestBase { @Override protected void setup() { - TestUtils.injectCSS(getMainWindow(), - ".v-ddwrapper { background: #ACF; }"); + TestUtils + .injectCSS(getMainWindow(), + ".v-ddwrapper { background: #ACF; } .extra{ background: #FFA500; }"); addComponent(makeWrapper(DragStartMode.NONE)); addComponent(makeWrapper(DragStartMode.COMPONENT)); addComponent(makeWrapper(DragStartMode.WRAPPER)); addComponent(makeWrapper(DragStartMode.HTML5)); + addComponent(makeOtherComponentWrapper(DragStartMode.COMPONENT_OTHER)); addComponent(new Label("Drop here")); } + private Component makeOtherComponentWrapper(DragStartMode componentOther) { + VerticalLayout parent = new VerticalLayout(); + parent.setWidth("200px"); + parent.setSpacing(true); + + 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"); + parent.addComponent(extra); + + return parent; + } + private Component makeWrapper(DragStartMode mode) { Label label = new Label("Drag start mode: " + mode); label.setId("label" + mode); diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java index 25aef1b815..ba27ee293e 100644 --- a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java @@ -31,6 +31,7 @@ public class DragStartModesTest extends MultiBrowserTest { WebElement dropTarget = vaadinElement("/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]"); dragToTarget("COMPONENT", dropTarget); dragToTarget("WRAPPER", dropTarget); + dragToTarget("COMPONENT_OTHER", dropTarget); } private void dragToTarget(String dragMode, WebElement dropTarget) |