]> source.dussan.org Git - vaadin-framework.git/commitdiff
#2904 renamed ApplicationConnection.translateToolkitUri to translateVaadinUri, deprec...
authorHenri Sara <henri.sara@itmill.com>
Mon, 18 May 2009 10:48:21 +0000 (10:48 +0000)
committerHenri Sara <henri.sara@itmill.com>
Mon, 18 May 2009 10:48:21 +0000 (10:48 +0000)
svn changeset:7851/svn branch:6.0

src/com/vaadin/demo/coverflow/gwt/client/ui/VCoverflow.java
src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
src/com/vaadin/terminal/gwt/client/ui/Icon.java
src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java
src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java
src/com/vaadin/terminal/gwt/client/ui/VLink.java
src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java
src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
src/com/vaadin/terminal/gwt/client/ui/VTree.java
src/com/vaadin/terminal/gwt/client/ui/VView.java
src/com/vaadin/terminal/gwt/client/ui/VWindow.java

index ad92de3d83929a473ea634113ac9842266d97dd7..35a7118fb0f2f33b2a6a79e18053f8e7ee5f4772 100644 (file)
@@ -113,7 +113,7 @@ public class VCoverflow extends Composite implements Paintable {
 
                 // Get information
 
-                set.put("icon", client.translateToolkitUri(imgUidl
+                set.put("icon", client.translateVaadinUri(imgUidl
                         .getStringAttribute("icon")));
                 set.put("caption", imgUidl.getStringAttribute("caption"));
 
@@ -201,23 +201,23 @@ public class VCoverflow extends Composite implements Paintable {
      *            id
      */
     public native void initializeMethods(String id) /*-{
-             var app = this;
-             
-             if($wnd.vaadin.coverflow == null)
-               var coverflow = [];
-             else
-               var coverflow = $wnd.vaadin.coverflow;
-               
-             coverflow['getCovers_' + id] = function() {                
-                       app.@com.vaadin.demo.coverflow.gwt.client.ui.VCoverflow::getCovers()();
-             };   
-             
-               coverflow['setCurrent_' + id] = function(selected) {
-                       app.@com.vaadin.demo.coverflow.gwt.client.ui.VCoverflow::setCover(Ljava/lang/String;)(selected);
-             };
-             
-             $wnd.vaadin.coverflow = coverflow;
-         }-*/;
+                var app = this;
+                
+                if($wnd.vaadin.coverflow == null)
+                       var coverflow = [];
+                else
+                       var coverflow = $wnd.vaadin.coverflow;
+                       
+                coverflow['getCovers_' + id] = function() {                
+                       app.@com.vaadin.demo.coverflow.gwt.client.ui.VCoverflow::getCovers()();
+                };   
+                
+                       coverflow['setCurrent_' + id] = function(selected) {
+                       app.@com.vaadin.demo.coverflow.gwt.client.ui.VCoverflow::setCover(Ljava/lang/String;)(selected);
+                };
+                
+                $wnd.vaadin.coverflow = coverflow;
+            }-*/;
 
     /**
      * This function sends all covers to the flash. We cannot do this directly
@@ -259,14 +259,14 @@ public class VCoverflow extends Composite implements Paintable {
      * @param icon
      */
     public native void addCover(String id, String caption, String icon) /*-{   
-             try {
-                   $doc['fxcoverflow' + id].addCover(caption.toString(), icon.toString());
-                 }
-                 catch(e) {
-                     $wnd.alert(e.message);
-                 }   
-                       
-             }-*/;
+                try {
+                           $doc['fxcoverflow' + id].addCover(caption.toString(), icon.toString());
+                    }
+                    catch(e) {
+                        $wnd.alert(e.message);
+                    }   
+                       
+                }-*/;
 
     /**
      * This function tells the flash which cover should be selected.
@@ -275,21 +275,21 @@ public class VCoverflow extends Composite implements Paintable {
      * @param key
      */
     public native void selectCover(String id, String key) /*-{    
-               $doc["fxcoverflow" + id].selectCover(key.toString());
-          }-*/;
+               $doc["fxcoverflow" + id].selectCover(key.toString());
+             }-*/;
 
     public native void setBackgroundColor(String id, String startGradient,
             String endGradient) /*-{           
-               $doc["fxcoverflow" + id].setBackgroundColor("0x" + startGradient.toString(), "0x" + endGradient.toString());
-         }-*/;
+                       $doc["fxcoverflow" + id].setBackgroundColor("0x" + startGradient.toString(), "0x" + endGradient.toString());
+            }-*/;
 
     public native void toggleScrollbarVisibility(String id, boolean visibility) /*-{           
-               $doc["fxcoverflow" + id].toggleScrollbarVisibility(visibility);
-          }-*/;
+               $doc["fxcoverflow" + id].toggleScrollbarVisibility(visibility);
+             }-*/;
 
     public native void removeCover(String id, String key) /*-{         
-               $doc["fxcoverflow" + id].removeCover(key);
-          }-*/;
+               $doc["fxcoverflow" + id].removeCover(key);
+             }-*/;
 
     /**
      * Set the HTML coding of the flash movie. This isn't done until the
index 1d6fe6d0ebe2552f829109d2d41fb62817f6eac1..f878e732b2cc5788b78103240ad1e2ce467e6465 100755 (executable)
@@ -1473,28 +1473,36 @@ public class ApplicationConnection {
     }
 
     /**
-     * Translates custom protocols in UIRL URI's to be recognizable by browser.
+     * @deprecated Use {@link #translateVaadinUri(String)} instead.
+     */
+    @Deprecated
+    public String translateToolkitUri(String vaadinUri) {
+        return translateVaadinUri(vaadinUri);
+    }
+
+    /**
+     * Translates custom protocols in UIDL URI's to be recognizable by browser.
      * All uri's from UIDL should be routed via this method before giving them
      * to browser due URI's in UIDL may contain custom protocols like theme://.
      * 
-     * @param toolkitUri
-     *            toolkit URI from uidl
+     * @param uidlUri
+     *            Vaadin URI from uidl
      * @return translated URI ready for browser
      */
-    public String translateToolkitUri(String toolkitUri) {
-        if (toolkitUri == null) {
+    public String translateVaadinUri(String uidlUri) {
+        if (uidlUri == null) {
             return null;
         }
-        if (toolkitUri.startsWith("theme://")) {
+        if (uidlUri.startsWith("theme://")) {
             final String themeUri = configuration.getThemeUri();
             if (themeUri == null) {
                 console
                         .error("Theme not set: ThemeResource will not be found. ("
-                                + toolkitUri + ")");
+                                + uidlUri + ")");
             }
-            toolkitUri = themeUri + toolkitUri.substring(7);
+            uidlUri = themeUri + uidlUri.substring(7);
         }
-        return toolkitUri;
+        return uidlUri;
     }
 
     public String getThemeUri() {
index 854d95b1eda811f8ba4d536e3b82c13170872da5..1ee19c1d177b5a51b0caaf15459e9286b00c2af6 100644 (file)
@@ -35,7 +35,7 @@ public class Icon extends UIObject {
              */
             sinkEvents(Event.ONLOAD);
 
-            String uri = client.translateToolkitUri(uidlUri);
+            String uri = client.translateVaadinUri(uidlUri);
             DOM.setElementProperty(getElement(), "src", uri);
             myUri = uidlUri;
         }
index 64052ca5fe92b9953a7bc2f11126e9b6da268d4d..b946896ed34a9b40ec5a34a340d53675cfcbb757 100644 (file)
@@ -168,7 +168,7 @@ public class VEmbedded extends HTML implements Paintable {
      * @return
      */
     private String getSrc(UIDL uidl, ApplicationConnection client) {
-        String url = client.translateToolkitUri(uidl.getStringAttribute("src"));
+        String url = client.translateVaadinUri(uidl.getStringAttribute("src"));
         if (url == null) {
             return "";
         }
index ee1d657f2961c520975aaebb350974d675b24b20..d333f6537a3b8f36aafe89b68f4e349ca062fe21 100644 (file)
@@ -54,7 +54,7 @@ public class VFilterSelect extends Composite implements Paintable, Field,
             key = uidl.getStringAttribute("key");
             caption = uidl.getStringAttribute("caption");
             if (uidl.hasAttribute("icon")) {
-                iconUri = client.translateToolkitUri(uidl
+                iconUri = client.translateVaadinUri(uidl
                         .getStringAttribute("icon"));
             }
         }
index 714e4000fba4f142b83d75ff64155e26fffc8742..790f8cbf5ef84a19d8b6a7ebd28387316e61ba86 100644 (file)
@@ -76,7 +76,7 @@ public class VLink extends HTML implements Paintable, ClickListener {
             anchor.setAttribute("target", target);
         }
         if (uidl.hasAttribute("src")) {
-            src = client.translateToolkitUri(uidl.getStringAttribute("src"));
+            src = client.translateVaadinUri(uidl.getStringAttribute("src"));
             anchor.setAttribute("href", src);
         }
 
index caced98ac4d3233634505d2b0dc8c226c0f0952d..ce3f34313c5094fa7cbacb68ce9237e7f158d61a 100644 (file)
@@ -104,7 +104,7 @@ public class VMenuBar extends Widget implements Paintable, PopupListener {
         UIDL options = uidl.getChildUIDL(0);
 
         if (options.hasAttribute("submenuIcon")) {
-            submenuIcon = client.translateToolkitUri(uidl.getChildUIDL(0)
+            submenuIcon = client.translateVaadinUri(uidl.getChildUIDL(0)
                     .getStringAttribute("submenuIcon"));
         } else {
             submenuIcon = null;
index 9f840fadd92720124eab5ebdfba429be3ccaa7fb..2bc747fbc8715902430ba15bc81ee4d2ffa76c3e 100644 (file)
@@ -308,7 +308,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollListener {
             actionMap.put(key + "_c", caption);
             if (action.hasAttribute("icon")) {
                 // TODO need some uri handling ??
-                actionMap.put(key + "_i", client.translateToolkitUri(action
+                actionMap.put(key + "_i", client.translateVaadinUri(action
                         .getStringAttribute("icon")));
             }
         }
@@ -2832,8 +2832,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollListener {
         String s = uidl.getStringAttribute("caption");
         if (uidl.hasAttribute("icon")) {
             s = "<img src=\""
-                    + client.translateToolkitUri(uidl
-                            .getStringAttribute("icon"))
+                    + client
+                            .translateVaadinUri(uidl.getStringAttribute("icon"))
                     + "\" alt=\"icon\" class=\"v-icon\">" + s;
         }
         return s;
index d037232d182e9974398df88fb81ca2f6ca7e8757..6f676441e72787277bd8bac7c49ec7fcea630daf 100644 (file)
@@ -69,7 +69,7 @@ public class VTree extends FlowPanel implements Paintable {
             actionMap.put(key + "_c", caption);
             if (action.hasAttribute("icon")) {
                 // TODO need some uri handling ??
-                actionMap.put(key + "_i", client.translateToolkitUri(action
+                actionMap.put(key + "_i", client.translateVaadinUri(action
                         .getStringAttribute("icon")));
             }
         }
index 08e9e3cf56adec41f0947ee9e82260df69ac9dc5..d23dbb39deb9feec2e05bd4e44b73c1c67eaed61 100644 (file)
@@ -258,7 +258,7 @@ public class VView extends SimplePanel implements Container,
                     String html = "";
                     if (notification.hasAttribute("icon")) {
                         final String parsedUri = client
-                                .translateToolkitUri(notification
+                                .translateVaadinUri(notification
                                         .getStringAttribute("icon"));
                         html += "<IMG src=\"" + parsedUri + "\" />";
                     }
index 5556d7970fdb407454e21a55353888ab726031ee..87bd272af3d938a49ba54e8108f05cbdc10dc11d 100644 (file)
@@ -284,7 +284,7 @@ public class VWindow extends VToolkitOverlay implements Container,
         while ("open".equals(childUidl.getTag())) {
             // TODO multiple opens with the same target will in practice just
             // open the last one - should we fix that somehow?
-            final String parsedUri = client.translateToolkitUri(childUidl
+            final String parsedUri = client.translateVaadinUri(childUidl
                     .getStringAttribute("src"));
             if (!childUidl.hasAttribute("name")) {
                 final Frame frame = new Frame();
@@ -639,7 +639,7 @@ public class VWindow extends VToolkitOverlay implements Container,
     public void setCaption(String c, String icon) {
         String html = Util.escapeHTML(c);
         if (icon != null) {
-            icon = client.translateToolkitUri(icon);
+            icon = client.translateVaadinUri(icon);
             html = "<img src=\"" + icon + "\" class=\"v-icon\" />" + html;
         }
         DOM.setInnerHTML(headerText, html);