]> source.dussan.org Git - vaadin-framework.git/commitdiff
Reverted [18907] (fix for #6745 "Connectors for Tree"
authorJouni Koivuviita <jouni.koivuviita@itmill.com>
Mon, 23 May 2011 12:51:58 +0000 (12:51 +0000)
committerJouni Koivuviita <jouni.koivuviita@itmill.com>
Mon, 23 May 2011 12:51:58 +0000 (12:51 +0000)
 * Moving to 6.7 branch
 * Modifying the selector structure and images in the 6.7 branch, the last fix was not final

svn changeset:18999/svn branch:6.6

WebContent/VAADIN/themes/base/tree/img/connector-item.png [deleted file]
WebContent/VAADIN/themes/base/tree/img/connector.png [deleted file]
WebContent/VAADIN/themes/base/tree/tree.css
WebContent/VAADIN/themes/liferay/tree/tree.css
WebContent/VAADIN/themes/reindeer/tree/tree.css
WebContent/VAADIN/themes/runo/tree/tree.css
src/com/vaadin/ui/themes/BaseTheme.java
tests/src/com/vaadin/tests/components/tree/TreeWithConnectors.java [deleted file]

diff --git a/WebContent/VAADIN/themes/base/tree/img/connector-item.png b/WebContent/VAADIN/themes/base/tree/img/connector-item.png
deleted file mode 100644 (file)
index a64c209..0000000
Binary files a/WebContent/VAADIN/themes/base/tree/img/connector-item.png and /dev/null differ
diff --git a/WebContent/VAADIN/themes/base/tree/img/connector.png b/WebContent/VAADIN/themes/base/tree/img/connector.png
deleted file mode 100644 (file)
index c56b8f4..0000000
Binary files a/WebContent/VAADIN/themes/base/tree/img/connector.png and /dev/null differ
index 37af1d11a8af044a9c8c28987e6c61a3844ae472..9e056dc4d62e9f2483d5f0ba83ced180ddc0589b 100644 (file)
@@ -4,29 +4,17 @@
        padding: 1px 0;
        outline: none;
 }
-.v-tree .v-tree-node {
+.v-tree-node {
        background: transparent url(../common/img/sprites.png) no-repeat 5px -37px;
        padding: 1px 0;
 }
 .v-tree-node-caption:focus {
        outline: none;
 }
-.v-tree div.v-tree-node-leaf {
-       background: transparent;
-}
-.v-tree-connectors div.v-tree-node-leaf {
-       background: transparent url(img/connector-item.png) no-repeat 8px 0;
-}
-.v-tree-connectors div.v-tree-node-leaf-last {
-       background: transparent url(img/connector-item.png) no-repeat 8px bottom;
-}
-.v-tree .v-tree-node-expanded {
-       background: transparent url(../common/img/sprites.png) no-repeat -5px -10px;
-}
-.v-tree-connectors .v-tree-node-children {
-       background: transparent url(img/connector.png) repeat-y 8px bottom;
+.v-tree-node-expanded {
+       background-position: -5px -10px;
 }
-.v-tree-connectors .v-tree-node-children-last {
+div.v-tree-node-leaf {
        background: transparent;
 }
 .v-tree-node-caption {
index 3c3c6abdfe511e5570d317131f16a192ea2413d8..23fe10f52e40d7d3a0d6083de3e0c2128ce6b860 100644 (file)
@@ -1,4 +1,4 @@
-.v-tree .v-tree-node {
+.v-tree-node {
        background: transparent url(arrows_sprites.png) no-repeat -42px 1px;
        -background: transparent url(arrows_sprites-ie6.png) no-repeat -42px 1px;
 }
@@ -13,7 +13,7 @@
        background-position: -14px -30px;
 }
 
-.v-tree .v-tree-node-expanded {
+.v-tree-node-expanded {
        background-position: -28px -14px;
 }
 
index 4f31d439603ad541895ae5ba239f74ad155ee554..3f77bd991d658cf76fb68f830f6f6a0a3a581b66 100644 (file)
@@ -1,4 +1,4 @@
-.v-tree .v-tree-node {
+.v-tree-node {
        background: transparent url(img/arrows.png) no-repeat 6px -10px;
 }
 .v-ie6 .v-tree-node {
@@ -8,7 +8,7 @@
 .v-ie6 div.v-tree-node-leaf {
        background: transparent;
 }
-.v-tree .v-tree-node-expanded {
+.v-tree-node-expanded {
        background-position: -7px 5px;
 }
 .v-tree-node-caption {
index c2458bc0b8bfaf0c4980a32077f9ae00202cd1cd..bec3b318dd6269ddc79b3150e931fd2c3f1b4c61 100644 (file)
@@ -1,7 +1,7 @@
-.v-tree .v-tree-node {
+.v-tree-node {
        background: transparent url(img/collapsed.png) no-repeat 2px 1px;
 }
-.v-tree .v-tree-node-expanded {
+.v-tree-node-expanded {
        background: transparent url(img/expanded.png) no-repeat 2px 1px;
 }
 .v-tree-node-caption {
index babdb1f1d5a76dd186456a28b6fbce3b452d8efc..c8ba08d30dd4b16f216426b0f52caf1cec83d164 100644 (file)
@@ -44,12 +44,4 @@ public class BaseTheme {
     @Deprecated
     public static final String PANEL_LIGHT = "light";
 
-    /**
-     * Adds connector lines between the tree nodes to better visualize the
-     * hierarchy.
-     * 
-     * @since 6.6.1
-     */
-    public static final String TREE_CONNECTORS = "connectors";
-
 }
\ No newline at end of file
diff --git a/tests/src/com/vaadin/tests/components/tree/TreeWithConnectors.java b/tests/src/com/vaadin/tests/components/tree/TreeWithConnectors.java
deleted file mode 100644 (file)
index 996b5aa..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-package com.vaadin.tests.components.tree;
-
-import java.util.Collection;
-import java.util.Date;
-
-import com.vaadin.data.Item;
-import com.vaadin.data.util.HierarchicalContainer;
-import com.vaadin.event.DataBoundTransferable;
-import com.vaadin.event.Transferable;
-import com.vaadin.event.dd.DragAndDropEvent;
-import com.vaadin.event.dd.DropHandler;
-import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
-import com.vaadin.terminal.ThemeResource;
-import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation;
-import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.Tree;
-import com.vaadin.ui.AbstractSelect.AcceptItem;
-import com.vaadin.ui.Tree.TreeDragMode;
-import com.vaadin.ui.Tree.TreeTargetDetails;
-import com.vaadin.ui.themes.Reindeer;
-
-public class TreeWithConnectors extends TestBase {
-
-    @Override
-    protected void setup() {
-        ThemeResource notCachedFileIcon = new ThemeResource(
-                "../runo/icons/16/document.png?" + new Date().getTime());
-        ThemeResource notCachedFolderIconHuge = new ThemeResource(
-                "../runo/icons/64/folder.png?" + new Date().getTime());
-        ThemeResource notCachedFolderIconLarge = new ThemeResource(
-                "../runo/icons/32/folder.png?" + new Date().getTime());
-        ThemeResource notCachedFolderIconLargeOther = new ThemeResource(
-                "../runo/icons/32/ok.png?" + new Date().getTime());
-
-        Tree t = new Tree();
-        t.setImmediate(true);
-        t.addStyleName(Reindeer.TREE_CONNECTORS);
-
-        for (int i = 1; i <= 5; i++) {
-            String item = "Root " + i;
-            t.addItem(item);
-            if (i == 1) {
-                t.setItemIcon(item, notCachedFileIcon);
-                addChildren(t, item, true);
-            } else if (i == 2) {
-                t.setItemIcon(item, notCachedFolderIconHuge);
-                addChildren(t, item, false);
-            } else if (i == 3) {
-                t.setItemIcon(item, notCachedFolderIconLarge);
-                addChildren(t, item, true);
-            } else if (i == 4) {
-                t.setItemIcon(item, notCachedFolderIconLargeOther);
-                addChildren(t, item, false);
-            } else if (i == 5) {
-                addChildren(t, item, true);
-            }
-        }
-
-        Panel p = new Panel();
-        p.addComponent(t);
-        p.setSizeFull();
-        getLayout().setSizeFull();
-
-        addComponent(p);
-
-        addDnD(t);
-    }
-
-    private void addDnD(final Tree t) {
-        t.setDragMode(TreeDragMode.NODE);
-        DropHandler itemSorter = new DropHandler() {
-
-            @SuppressWarnings("unused")
-            private void populateSubTree(HierarchicalContainer idx,
-                    HierarchicalContainer subtree, Object itemId) {
-                Collection<?> children = subtree.getChildren(itemId);
-                if (children != null) {
-
-                    for (Object childId : children) {
-                        Item addItem = idx.addItem(childId);
-                        if (addItem != null) {
-                            // did not exist, populate properties
-                            Item item = subtree.getItem(itemId);
-                            Collection<?> itemPropertyIds = item
-                                    .getItemPropertyIds();
-                            for (Object propId : itemPropertyIds) {
-                                addItem.getItemProperty(propId)
-                                        .setValue(
-                                                item.getItemProperty(propId)
-                                                        .getValue());
-                            }
-                        }
-                        idx.setParent(childId, itemId);
-                        populateSubTree(idx, subtree, childId);
-                    }
-                }
-
-            }
-
-            @SuppressWarnings("unused")
-            private HierarchicalContainer getSubTree(HierarchicalContainer idx,
-                    Object itemId) {
-                HierarchicalContainer hierarchicalContainer = new HierarchicalContainer();
-                Collection<?> containerPropertyIds = idx
-                        .getContainerPropertyIds();
-                for (Object object : containerPropertyIds) {
-                    hierarchicalContainer.addContainerProperty(object, idx
-                            .getType(object), null);
-                }
-                hierarchicalContainer.addItem(itemId);
-                copyChildren(idx, hierarchicalContainer, itemId);
-                return hierarchicalContainer;
-            }
-
-            private void copyChildren(HierarchicalContainer source,
-                    HierarchicalContainer target, Object itemId) {
-                Collection<?> children = source.getChildren(itemId);
-                if (children != null) {
-                    for (Object childId : children) {
-                        Item item = source.getItem(childId);
-                        Item addedItem = target.addItem(childId);
-                        target.setParent(childId, itemId);
-                        Collection<?> itemPropertyIds = item
-                                .getItemPropertyIds();
-                        for (Object propertyId : itemPropertyIds) {
-                            addedItem.getItemProperty(propertyId)
-                                    .setValue(
-                                            item.getItemProperty(propertyId)
-                                                    .getValue());
-                        }
-                        copyChildren(source, target, childId);
-                    }
-                }
-
-            }
-
-            public void drop(DragAndDropEvent event) {
-                TreeTargetDetails details = (TreeTargetDetails) event
-                        .getTargetDetails();
-                // TODO set properties, so same sorter could be used in Table
-                Transferable transferable = event.getTransferable();
-                if (transferable instanceof DataBoundTransferable) {
-                    DataBoundTransferable transferrable2 = (DataBoundTransferable) transferable;
-
-                    Object itemId = transferrable2.getItemId();
-
-                    Object itemIdOver = details.getItemIdOver();
-
-                    // TODO could use the "folder" node id to make the drop
-                    // logic simpler
-                    Object itemIdInto = details.getItemIdInto();
-                    VerticalDropLocation dropLocation = details
-                            .getDropLocation();
-
-                    Object itemIdAfter = details.getItemIdAfter();
-
-                    if (itemIdOver.equals(itemIdInto)) { // directly on a node
-                        t.setParent(itemId, itemIdOver);
-                        return;
-                    }
-
-                    ((HierarchicalContainer) t.getContainerDataSource())
-                            .setParent(itemId, itemIdInto);
-
-                    if (dropLocation == null) {
-                        System.err.println("No detail of drop place available");
-                    }
-                    ((HierarchicalContainer) t.getContainerDataSource())
-                            .moveAfterSibling(itemId, itemIdAfter);
-                }
-
-                return;
-            }
-
-            public AcceptCriterion getAcceptCriterion() {
-                // TODO should actually check that source is same as target
-                return AcceptItem.ALL;
-            }
-
-        };
-
-        t.setDropHandler(itemSorter);
-    }
-
-    protected void addChildren(Tree t, String parent, boolean recurse) {
-        for (int i = 1; i <= Math.max(3, 3 + Math.random() * 2); i++) {
-            String item = parent + ", child " + i;
-            t.addItem(item);
-            t.setChildrenAllowed(parent, true);
-            t.setParent(item, parent);
-            if (recurse) {
-                if (i % 2 == 0) {
-                    addChildren(t, item, false);
-                    t.expandItem(parent);
-                } else {
-                    t.setChildrenAllowed(item, false);
-                }
-            } else {
-                t.setChildrenAllowed(item, false);
-            }
-        }
-    }
-
-    @Override
-    protected String getDescription() {
-        return "A tree using the 'connectors' stylename should have Windows-like dotted connector lines joining the different hierarchy levels.";
-    }
-
-    @Override
-    protected Integer getTicketNumber() {
-        return 6745;
-    }
-
-}
\ No newline at end of file