]> source.dussan.org Git - vaadin-framework.git/commitdiff
Moved server side ResourceReference to gwt.server package
authorArtur Signell <artur@vaadin.com>
Fri, 16 Mar 2012 09:39:21 +0000 (11:39 +0200)
committerArtur Signell <artur@vaadin.com>
Fri, 16 Mar 2012 09:39:21 +0000 (11:39 +0200)
src/com/vaadin/terminal/gwt/client/communication/ResourceReference.java [deleted file]
src/com/vaadin/terminal/gwt/server/ResourceReference.java [new file with mode: 0644]
src/com/vaadin/ui/AbstractComponent.java

diff --git a/src/com/vaadin/terminal/gwt/client/communication/ResourceReference.java b/src/com/vaadin/terminal/gwt/client/communication/ResourceReference.java
deleted file mode 100644 (file)
index 090dfbc..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/* 
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.communication;
-
-import com.vaadin.Application;
-import com.vaadin.terminal.ApplicationResource;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.ThemeResource;
-
-public class ResourceReference extends URLReference {
-
-    private Resource resource;
-
-    public ResourceReference(Resource resource) {
-        this.resource = resource;
-    }
-
-    public Resource getResource() {
-        return resource;
-    }
-
-    @Override
-    public String getURL() {
-        if (resource instanceof ExternalResource) {
-            return ((ExternalResource) resource).getURL();
-        } else if (resource instanceof ApplicationResource) {
-            final ApplicationResource r = (ApplicationResource) resource;
-            final Application a = r.getApplication();
-            if (a == null) {
-                throw new RuntimeException(
-                        "An ApplicationResource ("
-                                + r.getClass().getName()
-                                + " must be attached to an application when it is sent to the client.");
-            }
-            final String uri = a.getRelativeLocation(r);
-            return uri;
-        } else if (resource instanceof ThemeResource) {
-            final String uri = "theme://"
-                    + ((ThemeResource) resource).getResourceId();
-            return uri;
-        } else {
-            throw new RuntimeException(getClass().getSimpleName()
-                    + " does not support resources of type: "
-                    + resource.getClass().getName());
-        }
-
-    }
-}
diff --git a/src/com/vaadin/terminal/gwt/server/ResourceReference.java b/src/com/vaadin/terminal/gwt/server/ResourceReference.java
new file mode 100644 (file)
index 0000000..56f2bed
--- /dev/null
@@ -0,0 +1,51 @@
+/* 
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.server;
+
+import com.vaadin.Application;
+import com.vaadin.terminal.ApplicationResource;
+import com.vaadin.terminal.ExternalResource;
+import com.vaadin.terminal.Resource;
+import com.vaadin.terminal.ThemeResource;
+import com.vaadin.terminal.gwt.client.communication.URLReference;
+
+public class ResourceReference extends URLReference {
+
+    private Resource resource;
+
+    public ResourceReference(Resource resource) {
+        this.resource = resource;
+    }
+
+    public Resource getResource() {
+        return resource;
+    }
+
+    @Override
+    public String getURL() {
+        if (resource instanceof ExternalResource) {
+            return ((ExternalResource) resource).getURL();
+        } else if (resource instanceof ApplicationResource) {
+            final ApplicationResource r = (ApplicationResource) resource;
+            final Application a = r.getApplication();
+            if (a == null) {
+                throw new RuntimeException(
+                        "An ApplicationResource ("
+                                + r.getClass().getName()
+                                + " must be attached to an application when it is sent to the client.");
+            }
+            final String uri = a.getRelativeLocation(r);
+            return uri;
+        } else if (resource instanceof ThemeResource) {
+            final String uri = "theme://"
+                    + ((ThemeResource) resource).getResourceId();
+            return uri;
+        } else {
+            throw new RuntimeException(getClass().getSimpleName()
+                    + " does not support resources of type: "
+                    + resource.getClass().getName());
+        }
+
+    }
+}
index 9665cf011affeb1f5739f90c07b69db5090480a1..4c49dc34d3e08af7496dd33c3da22dba928ba4fc 100644 (file)
@@ -35,9 +35,9 @@ import com.vaadin.terminal.Resource;
 import com.vaadin.terminal.Terminal;
 import com.vaadin.terminal.gwt.client.ComponentState;
 import com.vaadin.terminal.gwt.client.communication.ClientRpc;
-import com.vaadin.terminal.gwt.client.communication.ResourceReference;
 import com.vaadin.terminal.gwt.server.ClientMethodInvocation;
 import com.vaadin.terminal.gwt.server.ComponentSizeValidator;
+import com.vaadin.terminal.gwt.server.ResourceReference;
 import com.vaadin.terminal.gwt.server.RpcManager;
 import com.vaadin.terminal.gwt.server.RpcTarget;
 import com.vaadin.terminal.gwt.server.ServerRpcManager;