From 08ba394b1199797e3f0be7efead66e0b5393b5c3 Mon Sep 17 00:00:00 2001 From: Marc Englund Date: Fri, 24 May 2013 17:19:51 +0300 Subject: Disable drag&drop when source or target component is disabled, re-implementation of 6.8 fix for #11801 Change-Id: Iacd167ad7075620dae59ff2c7789efaf32521c59 --- server/src/com/vaadin/server/DragAndDropService.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'server') diff --git a/server/src/com/vaadin/server/DragAndDropService.java b/server/src/com/vaadin/server/DragAndDropService.java index 5a54b5ae3a..38c055eb1a 100644 --- a/server/src/com/vaadin/server/DragAndDropService.java +++ b/server/src/com/vaadin/server/DragAndDropService.java @@ -64,6 +64,16 @@ public class DragAndDropService implements VariableOwner, ClientConnector { public void changeVariables(Object source, Map variables) { Object owner = variables.get("dhowner"); + final Component sourceComponent = (Component) variables + .get("component"); + if (sourceComponent != null && !sourceComponent.isEnabled()) { + // source component not supposed to be enabled + getLogger().warning( + "Client dropped from " + sourceComponent + + " even though it's disabled"); + return; + } + // Validate drop handler owner if (!(owner instanceof DropTarget)) { getLogger() @@ -74,6 +84,15 @@ public class DragAndDropService implements VariableOwner, ClientConnector { // owner cannot be null here DropTarget dropTarget = (DropTarget) owner; + + if (!dropTarget.isEnabled()) { + getLogger() + .warning( + "Client dropped on " + owner + + " even though it's disabled"); + return; + } + lastVisitId = (Integer) variables.get("visitId"); // request may be dropRequest or request during drag operation (commonly -- cgit v1.2.3 From b01427a456323317b7062b83dd38cc31c103b7ad Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Thu, 16 May 2013 09:36:37 +0000 Subject: Change field types from LinkedHashSet back to HashSet to retain binary compatibility (#11432) svn changeset:25964/svn branch:6.8 Change-Id: Iddf0fa7de10a788e1a51e006e92ed3976a39a30b --- server/src/com/vaadin/event/ActionManager.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'server') diff --git a/server/src/com/vaadin/event/ActionManager.java b/server/src/com/vaadin/event/ActionManager.java index ce3e27d539..8d7a64b364 100644 --- a/server/src/com/vaadin/event/ActionManager.java +++ b/server/src/com/vaadin/event/ActionManager.java @@ -15,6 +15,7 @@ */ package com.vaadin.event; +import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Map; @@ -43,11 +44,15 @@ public class ActionManager implements Action.Container, Action.Handler, private static final long serialVersionUID = 1641868163608066491L; - /** List of action handlers */ - protected LinkedHashSet ownActions = null; + /** + * List of action handlers. Guaranteed to keep the original insertion order. + */ + protected HashSet ownActions = null; - /** List of action handlers */ - protected LinkedHashSet actionHandlers = null; + /** + * List of action handlers. Guaranteed to keep the original insertion order. + */ + protected HashSet actionHandlers = null; /** Action mapper */ protected KeyMapper actionMapper = null; -- cgit v1.2.3