summaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2016-08-25 19:37:57 +0300
committerArtur Signell <artur@vaadin.com>2016-08-26 19:49:06 +0300
commitd13ca5506a2f7eb3dce75b98238bdb280ec7fa20 (patch)
tree02575981ecfeecd07561337e8f5e04ce8eca8236 /shared
parent818f7d1cb8a92473f685144fed55facdc960697d (diff)
downloadvaadin-framework-d13ca5506a2f7eb3dce75b98238bdb280ec7fa20.tar.gz
vaadin-framework-d13ca5506a2f7eb3dce75b98238bdb280ec7fa20.zip
Implement new Label
Label does intentionally not implement HasValue as it cannot provide a value to a model Change-Id: I36b8e1794d64caf566fa802177051ae2eb637bf9
Diffstat (limited to 'shared')
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/label/ContentMode.java21
-rw-r--r--shared/src/main/java/com/vaadin/v7/shared/ui/label/ContentMode.java57
-rw-r--r--shared/src/main/java/com/vaadin/v7/shared/ui/label/LabelState.java26
3 files changed, 85 insertions, 19 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/label/ContentMode.java b/shared/src/main/java/com/vaadin/shared/ui/label/ContentMode.java
index 56a6ced226..f5d31fe46f 100644
--- a/shared/src/main/java/com/vaadin/shared/ui/label/ContentMode.java
+++ b/shared/src/main/java/com/vaadin/shared/ui/label/ContentMode.java
@@ -18,7 +18,7 @@ package com.vaadin.shared.ui.label;
/**
* Content modes defining how the client should interpret a Label's value.
*
- * @since 7.0.0
+ * @since 7.0
*/
public enum ContentMode {
/**
@@ -35,23 +35,6 @@ public enum ContentMode {
/**
* Content mode, where the label contains HTML.
*/
- HTML,
+ HTML
- /**
- * Content mode, where the label contains well-formed or well-balanced XML.
- * This is handled in the same way as {@link #HTML}.
- *
- * @deprecated Use {@link #HTML} instead
- */
- @Deprecated
- XML,
-
- /**
- * Legacy content mode, where the label contains RAW output. This is handled
- * in exactly the same way as {@link #HTML}.
- *
- * @deprecated Use {@link #HTML} instead
- */
- @Deprecated
- RAW;
}
diff --git a/shared/src/main/java/com/vaadin/v7/shared/ui/label/ContentMode.java b/shared/src/main/java/com/vaadin/v7/shared/ui/label/ContentMode.java
new file mode 100644
index 0000000000..e6292b47c5
--- /dev/null
+++ b/shared/src/main/java/com/vaadin/v7/shared/ui/label/ContentMode.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2000-2016 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.v7.shared.ui.label;
+
+/**
+ * Content modes defining how the client should interpret a Label's value.
+ *
+ * @since 7.0.0
+ */
+public enum ContentMode {
+ /**
+ * Content mode, where the label contains only plain text.
+ */
+ TEXT,
+
+ /**
+ * Content mode, where the label contains preformatted text. In this mode
+ * newlines are preserved when rendered on the screen.
+ */
+ PREFORMATTED,
+
+ /**
+ * Content mode, where the label contains HTML.
+ */
+ HTML,
+
+ /**
+ * Content mode, where the label contains well-formed or well-balanced XML.
+ * This is handled in the same way as {@link #HTML}.
+ *
+ * @deprecated Use {@link #HTML} instead
+ */
+ @Deprecated
+ XML,
+
+ /**
+ * Legacy content mode, where the label contains RAW output. This is handled
+ * in exactly the same way as {@link #HTML}.
+ *
+ * @deprecated Use {@link #HTML} instead
+ */
+ @Deprecated
+ RAW;
+}
diff --git a/shared/src/main/java/com/vaadin/v7/shared/ui/label/LabelState.java b/shared/src/main/java/com/vaadin/v7/shared/ui/label/LabelState.java
new file mode 100644
index 0000000000..64cc3b5ee5
--- /dev/null
+++ b/shared/src/main/java/com/vaadin/v7/shared/ui/label/LabelState.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2000-2016 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.v7.shared.ui.label;
+
+import com.vaadin.shared.AbstractComponentState;
+
+public class LabelState extends AbstractComponentState {
+ {
+ primaryStyleName = "v-label";
+ }
+ public ContentMode contentMode = ContentMode.TEXT;
+ public String text = "";
+}