Browse Source

Enable using @Stylesheet with vaadin:// (#9934)

Change-Id: I895fad31ef5b31a395cea95e64d6b183d718056f
tags/7.1.1
Artur Signell 11 years ago
parent
commit
3affc37a8e

+ 8
- 0
client/src/com/vaadin/client/ApplicationConnection.java View File

@@ -2940,6 +2940,14 @@ public class ApplicationConnection {
uidlUri = serviceUrl + relativeUrl;
}
}
if (uidlUri.startsWith(ApplicationConstants.VAADIN_PROTOCOL_PREFIX)) {
final String vaadinUri = configuration.getVaadinDirUrl();
String relativeUrl = uidlUri
.substring(ApplicationConstants.VAADIN_PROTOCOL_PREFIX
.length());
uidlUri = vaadinUri + relativeUrl;
}

return uidlUri;
}


+ 5
- 0
server/src/com/vaadin/annotations/StyleSheet.java View File

@@ -32,6 +32,11 @@ import com.vaadin.server.ClientConnector;
* Relative urls are mapped to APP/PUBLISHED/[url] which are by default served
* from the classpath relative to the class where the annotation is defined.
* <p>
* 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.
* <p>
* Example: {@code @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

+ 1
- 0
shared/src/com/vaadin/shared/ApplicationConstants.java View File

@@ -34,6 +34,7 @@ public class ApplicationConstants implements Serializable {
+ "PUBLISHED";

public static final String APP_PROTOCOL_PREFIX = "app://";
public static final String VAADIN_PROTOCOL_PREFIX = "vaadin://";
public static final String PUBLISHED_PROTOCOL_NAME = "published";
public static final String PUBLISHED_PROTOCOL_PREFIX = PUBLISHED_PROTOCOL_NAME
+ "://";

Loading…
Cancel
Save