diff options
Diffstat (limited to 'server/src/com/vaadin/ui/Tree.java')
-rw-r--r-- | server/src/com/vaadin/ui/Tree.java | 76 |
1 files changed, 65 insertions, 11 deletions
diff --git a/server/src/com/vaadin/ui/Tree.java b/server/src/com/vaadin/ui/Tree.java index 2d6673a67d..9cf1aa3511 100644 --- a/server/src/com/vaadin/ui/Tree.java +++ b/server/src/com/vaadin/ui/Tree.java @@ -49,13 +49,13 @@ import com.vaadin.event.dd.TargetDetails; import com.vaadin.event.dd.acceptcriteria.ClientSideCriterion; import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion; import com.vaadin.event.dd.acceptcriteria.TargetDetailIs; +import com.vaadin.server.KeyMapper; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Resource; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.dd.VerticalDropLocation; import com.vaadin.shared.ui.tree.TreeConstants; -import com.vaadin.terminal.KeyMapper; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Resource; import com.vaadin.tools.ReflectTools; /** @@ -906,22 +906,40 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * @param listener * the Listener to be added. */ - public void addListener(ExpandListener listener) { + public void addExpandListener(ExpandListener listener) { addListener(ExpandEvent.class, listener, ExpandListener.EXPAND_METHOD); } /** + * @deprecated Since 7.0, replaced by + * {@link #addExpandListener(ExpandListener)} + **/ + @Deprecated + public void addListener(ExpandListener listener) { + addExpandListener(listener); + } + + /** * Removes the expand listener. * * @param listener * the Listener to be removed. */ - public void removeListener(ExpandListener listener) { + public void removeExpandListener(ExpandListener listener) { removeListener(ExpandEvent.class, listener, ExpandListener.EXPAND_METHOD); } /** + * @deprecated Since 7.0, replaced by + * {@link #removeExpandListener(ExpandListener)} + **/ + @Deprecated + public void removeListener(ExpandListener listener) { + removeExpandListener(listener); + } + + /** * Emits the expand event. * * @param itemId @@ -991,23 +1009,41 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * @param listener * the Listener to be added. */ - public void addListener(CollapseListener listener) { + public void addCollapseListener(CollapseListener listener) { addListener(CollapseEvent.class, listener, CollapseListener.COLLAPSE_METHOD); } /** + * @deprecated Since 7.0, replaced by + * {@link #addCollapseListener(CollapseListener)} + **/ + @Deprecated + public void addListener(CollapseListener listener) { + addCollapseListener(listener); + } + + /** * Removes the collapse listener. * * @param listener * the Listener to be removed. */ - public void removeListener(CollapseListener listener) { + public void removeCollapseListener(CollapseListener listener) { removeListener(CollapseEvent.class, listener, CollapseListener.COLLAPSE_METHOD); } /** + * @deprecated Since 7.0, replaced by + * {@link #removeCollapseListener(CollapseListener)} + **/ + @Deprecated + public void removeListener(CollapseListener listener) { + removeCollapseListener(listener); + } + + /** * Emits collapse event. * * @param itemId @@ -1162,18 +1198,36 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, private DropHandler dropHandler; @Override - public void addListener(ItemClickListener listener) { + public void addItemClickListener(ItemClickListener listener) { addListener(TreeConstants.ITEM_CLICK_EVENT_ID, ItemClickEvent.class, listener, ItemClickEvent.ITEM_CLICK_METHOD); } + /** + * @deprecated Since 7.0, replaced by + * {@link #addItemClickListener(ItemClickListener)} + **/ + @Deprecated + public void addListener(ItemClickListener listener) { + addItemClickListener(listener); + } + @Override - public void removeListener(ItemClickListener listener) { + public void removeItemClickListener(ItemClickListener listener) { removeListener(TreeConstants.ITEM_CLICK_EVENT_ID, ItemClickEvent.class, listener); } /** + * @deprecated Since 7.0, replaced by + * {@link #removeItemClickListener(ItemClickListener)} + **/ + @Deprecated + public void removeListener(ItemClickListener listener) { + removeItemClickListener(listener); + } + + /** * Sets the {@link ItemStyleGenerator} to be used with this tree. * * @param itemStyleGenerator @@ -1449,7 +1503,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * * @see * com.vaadin.event.dd.acceptCriteria.AcceptCriterion#paintResponse( - * com.vaadin.terminal.PaintTarget) + * com.vaadin.server.PaintTarget) */ @Override public void paintResponse(PaintTarget target) throws PaintException { |