diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-08-17 13:32:54 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2012-08-17 13:32:54 +0300 |
commit | 47a0326c2fb2d6d8621e7a6fbfa2f011a48e15a4 (patch) | |
tree | 416685c3912f716eb09497cc7cce071786fe2d12 /server/src/com/vaadin/annotations | |
parent | 8e3aa0a9823556896f1af00599c3e79ca2ce2e01 (diff) | |
parent | 9bdbd7efbb7fa599910dc85182968334e4dced78 (diff) | |
download | vaadin-framework-47a0326c2fb2d6d8621e7a6fbfa2f011a48e15a4.tar.gz vaadin-framework-47a0326c2fb2d6d8621e7a6fbfa2f011a48e15a4.zip |
Merge branch 'master' into root-cleanup
Conflicts:
server/src/com/vaadin/terminal/DeploymentConfiguration.java
server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
server/src/com/vaadin/terminal/gwt/server/AbstractDeploymentConfiguration.java
Diffstat (limited to 'server/src/com/vaadin/annotations')
-rw-r--r-- | server/src/com/vaadin/annotations/AutoGenerated.java | 28 | ||||
-rw-r--r-- | server/src/com/vaadin/annotations/EagerInit.java | 42 | ||||
-rw-r--r-- | server/src/com/vaadin/annotations/JavaScript.java | 52 | ||||
-rw-r--r-- | server/src/com/vaadin/annotations/StyleSheet.java | 49 | ||||
-rw-r--r-- | server/src/com/vaadin/annotations/Theme.java | 36 | ||||
-rw-r--r-- | server/src/com/vaadin/annotations/Widgetset.java | 37 | ||||
-rw-r--r-- | server/src/com/vaadin/annotations/package.html | 12 |
7 files changed, 256 insertions, 0 deletions
diff --git a/server/src/com/vaadin/annotations/AutoGenerated.java b/server/src/com/vaadin/annotations/AutoGenerated.java new file mode 100644 index 0000000000..cee0e3fcf6 --- /dev/null +++ b/server/src/com/vaadin/annotations/AutoGenerated.java @@ -0,0 +1,28 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.annotations; + +/** + * Marker annotation for automatically generated code elements. + * + * These elements may be modified or removed by code generation. + * + * @author Vaadin Ltd. + * @since 6.0 + */ +public @interface AutoGenerated { + +} diff --git a/server/src/com/vaadin/annotations/EagerInit.java b/server/src/com/vaadin/annotations/EagerInit.java new file mode 100644 index 0000000000..5131a79576 --- /dev/null +++ b/server/src/com/vaadin/annotations/EagerInit.java @@ -0,0 +1,42 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import com.vaadin.terminal.WrappedRequest; +import com.vaadin.ui.Root; + +/** + * Indicates that the init method in a Root class can be called before full + * browser details ({@link WrappedRequest#getBrowserDetails()}) are available. + * This will make the UI appear more quickly, as ensuring the availability of + * this information typically requires an additional round trip to the client. + * + * @see Root#init(com.vaadin.terminal.WrappedRequest) + * @see WrappedRequest#getBrowserDetails() + * + * @since 7.0 + * + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface EagerInit { + // No values +} diff --git a/server/src/com/vaadin/annotations/JavaScript.java b/server/src/com/vaadin/annotations/JavaScript.java new file mode 100644 index 0000000000..7943fe1055 --- /dev/null +++ b/server/src/com/vaadin/annotations/JavaScript.java @@ -0,0 +1,52 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import com.vaadin.terminal.gwt.server.ClientConnector; + +/** + * If this annotation is present on a {@link ClientConnector} class, the + * framework ensures the referenced JavaScript files are loaded before the init + * method for the corresponding client-side connector is invoked. + * <p> + * Absolute URLs including protocol and host are used as is on the client-side. + * Relative urls are mapped to APP/CONNECTOR/[url] which are by default served + * from the classpath relative to the class where the annotation is defined. + * <p> + * Example: {@code @JavaScript( "http://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 com.example.MyConnector. + * + * @author Vaadin Ltd + * @since 7.0.0 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface JavaScript { + /** + * JavaScript files to load before initializing the client-side connector. + * + * @return an array of JavaScript file urls + */ + public String[] value(); +} diff --git a/server/src/com/vaadin/annotations/StyleSheet.java b/server/src/com/vaadin/annotations/StyleSheet.java new file mode 100644 index 0000000000..7833544ab5 --- /dev/null +++ b/server/src/com/vaadin/annotations/StyleSheet.java @@ -0,0 +1,49 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import com.vaadin.terminal.gwt.server.ClientConnector; + +/** + * If this annotation is present on a {@link ClientConnector} class, the + * framework ensures the referenced style sheets are loaded before the init + * method for the corresponding client-side connector is invoked. + * <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 + * the server's classpath using the ClassLoader that was used to load + * com.example.MyConnector. + * + * @author Vaadin Ltd + * @since 7.0.0 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface StyleSheet { + /** + * Style sheets to load before initializing the client-side connector. + * + * @return an array of style sheet urls + */ + public String[] value(); +} diff --git a/server/src/com/vaadin/annotations/Theme.java b/server/src/com/vaadin/annotations/Theme.java new file mode 100644 index 0000000000..e2610d2b3f --- /dev/null +++ b/server/src/com/vaadin/annotations/Theme.java @@ -0,0 +1,36 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import com.vaadin.ui.Root; + +/** + * Defines a specific theme for a {@link Root}. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface Theme { + /** + * @return simple name of the theme + */ + public String value(); +} diff --git a/server/src/com/vaadin/annotations/Widgetset.java b/server/src/com/vaadin/annotations/Widgetset.java new file mode 100644 index 0000000000..e80f887691 --- /dev/null +++ b/server/src/com/vaadin/annotations/Widgetset.java @@ -0,0 +1,37 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import com.vaadin.ui.Root; + +/** + * Defines a specific theme for a {@link Root}. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface Widgetset { + /** + * @return name of the widgetset + */ + public String value(); + +} diff --git a/server/src/com/vaadin/annotations/package.html b/server/src/com/vaadin/annotations/package.html new file mode 100644 index 0000000000..d789e9b5df --- /dev/null +++ b/server/src/com/vaadin/annotations/package.html @@ -0,0 +1,12 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> + +<body bgcolor="white"> + +<p>Contains annotations used in Vaadin. Note that some annotations +are also found in other packages e.g., {@link com.vaadin.ui.ClientWidget}.</p> + +</body> +</html> |