summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/annotations
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-12-14 20:01:52 +0200
committerMatti Hosio <mhosio@vaadin.com>2014-12-15 13:20:12 +0200
commit898e28d6aebc2b484f59f528a609bd59e5dfa4f5 (patch)
treecdb0bc9b76af30fb21b631c11e65093c0b5ceeb5 /server/src/com/vaadin/annotations
parenta27ea03db9f6ba5f4358c359645cd62617d2d205 (diff)
downloadvaadin-framework-898e28d6aebc2b484f59f528a609bd59e5dfa4f5.tar.gz
vaadin-framework-898e28d6aebc2b484f59f528a609bd59e5dfa4f5.zip
Add public API for loading design based on @DesignRoot (#7749)
Change-Id: Ic6f201a45d66aefe9ec93ba3be5a75b6532bf014
Diffstat (limited to 'server/src/com/vaadin/annotations')
-rw-r--r--server/src/com/vaadin/annotations/DesignRoot.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/server/src/com/vaadin/annotations/DesignRoot.java b/server/src/com/vaadin/annotations/DesignRoot.java
new file mode 100644
index 0000000000..a00a00dc0b
--- /dev/null
+++ b/server/src/com/vaadin/annotations/DesignRoot.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2014 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.declarative.Design;
+
+/**
+ * Marks the component as the root of a design (html) file.
+ * <p>
+ * Used together with {@link Design#read(com.vaadin.ui.Component)} to be able
+ * the load the design without further configuration. The design is loaded from
+ * the same package as the annotated class and by default the design filename is
+ * derived from the class name. Using the {@link #value()} parameter you can
+ * specify another design file name.
+ *
+ * @since 7.4
+ * @author Vaadin Ltd
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface DesignRoot {
+ String value() default "";
+}