From 339499164cfddaa9bd45b588c451f18374ad3ceb Mon Sep 17 00:00:00 2001 From: Martin Vysny Date: Thu, 28 Mar 2019 16:23:24 +0200 Subject: Documents the possibility to use vaadin:// and theme:// in JavaScript… (#11512) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Documents the possibility to use vaadin:// and theme:// in JavaScript and StyleSheet annotations. Fixes #8675 --- .../main/java/com/vaadin/annotations/JavaScript.java | 13 ++++++++++--- .../main/java/com/vaadin/annotations/StyleSheet.java | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 11 deletions(-) (limited to 'server') diff --git a/server/src/main/java/com/vaadin/annotations/JavaScript.java b/server/src/main/java/com/vaadin/annotations/JavaScript.java index 0e49904fee..d7b312b40f 100644 --- a/server/src/main/java/com/vaadin/annotations/JavaScript.java +++ b/server/src/main/java/com/vaadin/annotations/JavaScript.java @@ -46,10 +46,17 @@ import com.vaadin.server.ClientConnector; * file was loaded from a different folder. * *

- * Example: @JavaScript({"http://host.com/file1.js", "file2.js"}) + * Special Vaadin urls are also supported. The most useful is vaadin:// which + * maps to the location of the automatically published VAADIN folder located on + * your classpath in your resources. Using the VAADIN folder and vaadin:// you + * can publish JavaScript files which use images or other files with relative + * paths. Another example is the theme:// url which maps to the location of your + * current theme. + *

+ * Example: @JavaScript({"https://host.com/file1.js", "file2.js"}) * on the class com.example.MyConnector would load the file - * http://host.com/file1.js as is and file2.js from /com/example/file2.js on the - * server's classpath using the ClassLoader that was used to load + * https://host.com/file1.js as is and file2.js from /com/example/file2.js on + * the server's classpath using the ClassLoader that was used to load * com.example.MyConnector. *

* For adding multiple JavaScript files for a single component, you can use this diff --git a/server/src/main/java/com/vaadin/annotations/StyleSheet.java b/server/src/main/java/com/vaadin/annotations/StyleSheet.java index 528b6458b5..03783187b2 100644 --- a/server/src/main/java/com/vaadin/annotations/StyleSheet.java +++ b/server/src/main/java/com/vaadin/annotations/StyleSheet.java @@ -47,15 +47,17 @@ import com.vaadin.server.ClientConnector; * *

* Special Vaadin urls are also supported. The most useful is vaadin:// which - * maps to the location of the automatically published VAADIN folder. Using the - * VAADIN folder and vaadin:// you can publish stylesheets which use images or - * other files with relative paths. + * maps to the location of the automatically published VAADIN folder located on + * your classpath in your resources. Using the VAADIN folder and vaadin:// you + * can publish stylesheets which use images or other files with relative paths. + * Another example is the theme:// url which maps to the location of your + * current theme. *

- * Example: @StyleSheet({"http://host.com/file1.css", "file2.css"}) - * on the class com.example.MyConnector would load the file - * http://host.com/file1.css as is and file2.css from /com/example/file2.css on - * the server's classpath using the ClassLoader that was used to load - * com.example.MyConnector. + * Example: + * @StyleSheet({"https://host.com/file1.css", "file2.css"}) on the + * class com.example.MyConnector would load the file https://host.com/file1.css + * as is and file2.css from /com/example/file2.css on the server's classpath + * using the ClassLoader that was used to load com.example.MyConnector. *

* For adding multiple style sheets for a single component, you can use this * annotation multiple times. -- cgit v1.2.3