ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1548157 - in /ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin: UploadHelper.java VaadinClient.java
Date Thu, 05 Dec 2013 14:48:26 GMT
Author: jawi
Date: Thu Dec  5 14:48:26 2013
New Revision: 1548157

URL: http://svn.apache.org/r1548157
Log:
ACE-438 - Ghosting when scrolling

- fixed incorrect drag mode, which caused this behaviour to occur;
- also fixed a bug (ClassCastException) when trying to drop a table-row 
  in the same way as new artifacts.


Modified:
    ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/UploadHelper.java
    ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinClient.java

Modified: ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/UploadHelper.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/UploadHelper.java?rev=1548157&r1=1548156&r2=1548157&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/UploadHelper.java
(original)
+++ ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/UploadHelper.java
Thu Dec  5 14:48:26 2013
@@ -33,6 +33,7 @@ import java.util.concurrent.CopyOnWriteA
 import org.apache.ace.client.repository.object.ArtifactObject;
 import org.apache.ace.client.repository.repository.ArtifactRepository;
 
+import com.vaadin.event.Transferable;
 import com.vaadin.event.dd.DragAndDropEvent;
 import com.vaadin.event.dd.DropHandler;
 import com.vaadin.event.dd.acceptcriteria.AcceptAll;
@@ -51,11 +52,11 @@ import com.vaadin.ui.Upload.SucceededEve
 public class UploadHelper {
     public static interface UploadHandle {
         void cleanup();
-        
+
         Exception getFailureReason();
 
         File getFile();
-        
+
         String getFilename();
 
         boolean isSuccessful();
@@ -73,8 +74,13 @@ public class UploadHelper {
 
         @Override
         public void drop(DragAndDropEvent dropEvent) {
+            Transferable transferable = dropEvent.getTransferable();
+            if (!(transferable instanceof WrapperTransferable)) {
+                return;
+            }
+
             // expecting this to be an html5 drag
-            WrapperTransferable tr = (WrapperTransferable) dropEvent.getTransferable();
+            WrapperTransferable tr = (WrapperTransferable) transferable;
             Html5File[] files = tr.getFiles();
             if (files != null) {
                 for (Html5File html5File : files) {
@@ -239,12 +245,12 @@ public class UploadHelper {
                 m_fos.close();
             }
         }
-        
+
         @Override
         public Exception getFailureReason() {
             return m_failureReason;
         }
-        
+
         @Override
         public File getFile() {
             return m_file;

Modified: ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinClient.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinClient.java?rev=1548157&r1=1548156&r2=1548157&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinClient.java
(original)
+++ ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinClient.java
Thu Dec  5 14:48:26 2013
@@ -1118,7 +1118,7 @@ public class VaadinClient extends com.va
         m_artifactToolbar = createArtifactToolbar();
 
         final DragAndDropWrapper artifactsPanelWrapper = new DragAndDropWrapper(m_artifactsPanel);
-        artifactsPanelWrapper.setDragStartMode(DragStartMode.COMPONENT);
+        artifactsPanelWrapper.setDragStartMode(DragStartMode.HTML5);
         artifactsPanelWrapper.setDropHandler(new ArtifactDropHandler(uploadHandler));
         artifactsPanelWrapper.setCaption(m_artifactsPanel.getCaption());
         artifactsPanelWrapper.setSizeFull();



Mime
View raw message