ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1540697 - /ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinClient.java
Date Mon, 11 Nov 2013 13:05:01 GMT
Author: jawi
Date: Mon Nov 11 13:05:01 2013
New Revision: 1540697

URL: http://svn.apache.org/r1540697
Log:
ACE-427 - fixed possible NPE when using Web UI without authentication.


Modified:
    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/VaadinClient.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.webui.vaadin/src/org/apache/ace/webui/vaadin/VaadinClient.java?rev=1540697&r1=1540696&r2=1540697&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
Mon Nov 11 13:05:01 2013
@@ -91,10 +91,11 @@ import com.vaadin.data.Property.ValueCha
 import com.vaadin.event.ShortcutAction.KeyCode;
 import com.vaadin.event.ShortcutAction.ModifierKey;
 import com.vaadin.service.ApplicationContext;
-import com.vaadin.terminal.gwt.server.WebBrowser;
+import com.vaadin.terminal.gwt.server.WebApplicationContext;
 import com.vaadin.ui.Button;
 import com.vaadin.ui.Button.ClickEvent;
 import com.vaadin.ui.DragAndDropWrapper;
+import com.vaadin.ui.DragAndDropWrapper.DragStartMode;
 import com.vaadin.ui.GridLayout;
 import com.vaadin.ui.HorizontalLayout;
 import com.vaadin.ui.Label;
@@ -481,7 +482,9 @@ public class VaadinClient extends com.va
     }
 
     private void addCrossPlatformAddShortcut(Button button, int keycode, String description)
{
-        ShortcutHelper.addCrossPlatformShortcut((WebBrowser) getMainWindow().getTerminal(),
button, description, keycode, ModifierKey.SHIFT);
+        // ACE-427 - NPE when using getMainWindow() if no authentication is used...
+        WebApplicationContext context = (WebApplicationContext) getContext();
+        ShortcutHelper.addCrossPlatformShortcut(context.getBrowser(), button, description,
keycode, ModifierKey.SHIFT);
     }
 
     private void addDependency(Component component, Class service) {
@@ -1115,6 +1118,7 @@ public class VaadinClient extends com.va
         m_artifactToolbar = createArtifactToolbar();
 
         final DragAndDropWrapper artifactsPanelWrapper = new DragAndDropWrapper(m_artifactsPanel);
+        artifactsPanelWrapper.setDragStartMode(DragStartMode.COMPONENT);
         artifactsPanelWrapper.setDropHandler(new ArtifactDropHandler(uploadHandler));
         artifactsPanelWrapper.setCaption(m_artifactsPanel.getCaption());
         artifactsPanelWrapper.setSizeFull();



Mime
View raw message