]> source.dussan.org Git - vaadin-framework.git/commitdiff
Removed depdencies from server to client (#9279)
authorArtur Signell <artur@vaadin.com>
Tue, 14 Aug 2012 12:06:05 +0000 (15:06 +0300)
committerArtur Signell <artur@vaadin.com>
Tue, 14 Aug 2012 12:07:17 +0000 (15:07 +0300)
client/src/com/vaadin/terminal/gwt/client/ui/dd/VDragAndDropManager.java
server/src/com/vaadin/terminal/AbstractJavaScriptExtension.java
server/src/com/vaadin/terminal/JavaScriptCallbackHelper.java
server/src/com/vaadin/terminal/PaintTarget.java
server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java
shared/src/com/vaadin/shared/ApplicationConstants.java

index bc98860716c90c8d17232c4fbf122cdaff564b23..225dd8ccda1ab2fb9bdc2d9135d9fe711e8feefb 100644 (file)
@@ -22,6 +22,7 @@ import com.google.gwt.user.client.Event.NativePreviewHandler;
 import com.google.gwt.user.client.Timer;
 import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.shared.ApplicationConstants;
 import com.vaadin.shared.MouseEventDetails;
 import com.vaadin.shared.ui.dd.DragEventType;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
@@ -225,8 +226,6 @@ public class VDragAndDropManager {
 
     }
 
-    public static final String DD_SERVICE = "DD";
-
     private static VDragAndDropManager instance;
     private HandlerRegistration handlerRegistration;
     private VDragEvent currentDrag;
@@ -598,17 +597,20 @@ public class VDragAndDropManager {
          * Transferable is sent on each request)
          */
         visitId++;
-        client.updateVariable(DD_SERVICE, "visitId", visitId, false);
-        client.updateVariable(DD_SERVICE, "eventId", currentDrag.getEventId(),
-                false);
-        client.updateVariable(DD_SERVICE, "dhowner", paintable, false);
+        client.updateVariable(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID,
+                "visitId", visitId, false);
+        client.updateVariable(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID,
+                "eventId", currentDrag.getEventId(), false);
+        client.updateVariable(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID,
+                "dhowner", paintable, false);
 
         VTransferable transferable = currentDrag.getTransferable();
 
-        client.updateVariable(DD_SERVICE, "component",
-                transferable.getDragSource(), false);
+        client.updateVariable(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID,
+                "component", transferable.getDragSource(), false);
 
-        client.updateVariable(DD_SERVICE, "type", drop.ordinal(), false);
+        client.updateVariable(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID,
+                "type", drop.ordinal(), false);
 
         if (currentDrag.getCurrentGwtEvent() != null) {
             try {
@@ -624,11 +626,11 @@ public class VDragAndDropManager {
         } else {
             currentDrag.getDropDetails().put("mouseEvent", null);
         }
-        client.updateVariable(DD_SERVICE, "evt", currentDrag.getDropDetails(),
-                false);
+        client.updateVariable(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID,
+                "evt", currentDrag.getDropDetails(), false);
 
-        client.updateVariable(DD_SERVICE, "tra", transferable.getVariableMap(),
-                true);
+        client.updateVariable(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID,
+                "tra", transferable.getVariableMap(), true);
 
     }
 
index 7bafb6d2b35b135e5833c3458da8325638ee382e..69c70435f04d16a577f2345ab74551277d18a981 100644 (file)
@@ -5,7 +5,6 @@
 package com.vaadin.terminal;
 
 import com.vaadin.shared.JavaScriptExtensionState;
-import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.ui.JavaScriptFunction;
 
 /**
@@ -66,7 +65,8 @@ import com.vaadin.ui.JavaScriptFunction;
  * functions is described bellow.</li>
  * <li><code>translateVaadinUri(uri)</code> - Translates a Vaadin URI to a URL
  * that can be used in the browser. This is just way of accessing
- * {@link ApplicationConnection#translateVaadinUri(String)}</li>
+ * {@link com.vaadin.terminal.gwt.client.ApplicationConnection#translateVaadinUri(String)}
+ * </li>
  * </ul>
  * The connector wrapper also supports these special functions:
  * <ul>
@@ -77,9 +77,8 @@ import com.vaadin.ui.JavaScriptFunction;
  * {@link #addFunction(String, JavaScriptFunction)} on the server will
  * automatically be present as a function that triggers the registered function
  * on the server.</li>
- * <li>Any field name referred to using
- * {@link #callFunction(String, Object...)} on the server will be called if a
- * function has been assigned to the field.</li>
+ * <li>Any field name referred to using {@link #callFunction(String, Object...)}
+ * on the server will be called if a function has been assigned to the field.</li>
  * </ul>
  * <p>
  * 
index 265e578c6dd956ddf63cddf2462a05d5fafa6e8b..e3669b84ab0f4145c3706185586dceb6699014f1 100644 (file)
@@ -15,7 +15,6 @@ import java.util.Set;
 import com.vaadin.external.json.JSONArray;
 import com.vaadin.external.json.JSONException;
 import com.vaadin.shared.JavaScriptConnectorState;
-import com.vaadin.terminal.gwt.client.JavaScriptConnectorHelper;
 import com.vaadin.tools.ReflectTools;
 import com.vaadin.ui.AbstractJavaScriptComponent;
 import com.vaadin.ui.JavaScript.JavaScriptCallbackRpc;
@@ -25,7 +24,7 @@ import com.vaadin.ui.JavaScriptFunction;
  * Internal helper class used to implement functionality common to
  * {@link AbstractJavaScriptComponent} and {@link AbstractJavaScriptExtension}.
  * Corresponding support in client-side code is in
- * {@link JavaScriptConnectorHelper}.
+ * {@link com.vaadin.terminal.gwt.client.JavaScriptConnectorHelper}.
  * <p>
  * You should most likely no use this class directly.
  * 
index b658c9f4a30dfec3cf150e7c76a1d5a9c5768c35..9fa8f67bac3fe4c9e87de13de6856c16e6755562 100644 (file)
@@ -8,8 +8,6 @@ import java.io.Serializable;
 import java.util.Map;
 
 import com.vaadin.terminal.StreamVariable.StreamingStartEvent;
-import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.Paintable;
 import com.vaadin.terminal.gwt.server.ClientConnector;
 import com.vaadin.ui.Component;
 
@@ -40,7 +38,7 @@ public interface PaintTarget extends Serializable {
             throws PaintException;
 
     /**
-     * Result of starting to paint a Paintable (
+     * Result of starting to paint a Component (
      * {@link PaintTarget#startPaintable(Component, String)}).
      * 
      * @since 7.0
@@ -52,7 +50,7 @@ public interface PaintTarget extends Serializable {
          */
         PAINTING,
         /**
-         * A previously unpainted or painted {@link Paintable} has been queued
+         * A previously unpainted or painted {@link Component} has been queued
          * be created/update later in a separate change in the same set of
          * changes.
          */
@@ -65,9 +63,9 @@ public interface PaintTarget extends Serializable {
      * scheme, that checks the paintable has actually changed or can a cached
      * version be used instead. This method should call the startTag method.
      * <p>
-     * If the Paintable is found in cache and this function returns true it may
-     * omit the content and close the tag, in which case cached content should
-     * be used.
+     * If the {@link Component} is found in cache and this function returns true
+     * it may omit the content and close the tag, in which case cached content
+     * should be used.
      * </p>
      * <p>
      * This method may also add only a reference to the paintable and queue the
@@ -186,7 +184,7 @@ public interface PaintTarget extends Serializable {
      * <p>
      * The urls in UIDL message may use Vaadin specific protocol. Before
      * actually using the urls on the client side, they should be passed via
-     * {@link ApplicationConnection#translateVaadinUri(String)}.
+     * {@link com.vaadin.terminal.gwt.client.ApplicationConnection#translateVaadinUri(String)}.
      * <p>
      * Note that in current terminal implementation StreamVariables are cleaned
      * from the terminal only when:
@@ -281,14 +279,14 @@ public interface PaintTarget extends Serializable {
             throws PaintException;
 
     /**
-     * Adds a Paintable type attribute. On client side the value will be a
+     * Adds a Component type attribute. On client side the value will be a
      * terminal specific reference to corresponding component on client side
      * implementation.
      * 
      * @param name
      *            the name of the attribute
      * @param value
-     *            the Paintable to be referenced on client side
+     *            the Component to be referenced on client side
      * @throws PaintException
      */
     public void addAttribute(String name, Component value)
@@ -407,7 +405,7 @@ public interface PaintTarget extends Serializable {
             throws PaintException;
 
     /**
-     * Adds a Paintable type variable. On client side the variable value will be
+     * Adds a Component type variable. On client side the variable value will be
      * a terminal specific reference to corresponding component on client side
      * implementation. When updated from client side, terminal will map the
      * client side component reference back to a corresponding server side
index efb5666efa074423a4ed605aedb098e685e70b92..a3a6970092cb009fee6b58da6f5e2d4fe5f5af68 100644 (file)
@@ -19,12 +19,12 @@ import com.vaadin.event.dd.DropTarget;
 import com.vaadin.event.dd.TargetDetails;
 import com.vaadin.event.dd.TargetDetailsImpl;
 import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
+import com.vaadin.shared.ApplicationConstants;
 import com.vaadin.shared.communication.SharedState;
 import com.vaadin.shared.ui.dd.DragEventType;
 import com.vaadin.terminal.Extension;
 import com.vaadin.terminal.PaintException;
 import com.vaadin.terminal.VariableOwner;
-import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager;
 import com.vaadin.ui.Component;
 import com.vaadin.ui.Root;
 
@@ -230,7 +230,7 @@ public class DragAndDropService implements VariableOwner, ClientConnector {
 
     @Override
     public String getConnectorId() {
-        return VDragAndDropManager.DD_SERVICE;
+        return ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID;
     }
 
     @Override
index ff87e6c4b624e826d54a4727795b96db861c6e50..e3c147d39629bd3e3581f0db80c5d88ffb0581d7 100644 (file)
@@ -33,4 +33,6 @@ public class ApplicationConstants {
 
     public static final String V_RESOURCE_PATH = "v-resourcePath";
 
+    @Deprecated
+    public static final String DRAG_AND_DROP_CONNECTOR_ID = "DD";
 }