diff options
author | John Ahlroos <john@vaadin.com> | 2012-10-08 16:05:20 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2012-10-08 16:05:20 +0300 |
commit | d43d15454d7cbc70f0a03d4e6666c747d7a4f657 (patch) | |
tree | f7165ebd646165e9602a2eb8c0dcc07f37ccb8cb /server/src/com/vaadin | |
parent | f296b46c8de6705baaa137fd5854cd55aefe5bc6 (diff) | |
parent | 107f77ecda9d510fabf976d7a81d350b933c9765 (diff) | |
download | vaadin-framework-d43d15454d7cbc70f0a03d4e6666c747d7a4f657.tar.gz vaadin-framework-d43d15454d7cbc70f0a03d4e6666c747d7a4f657.zip |
Merge branch 'sass'
Diffstat (limited to 'server/src/com/vaadin')
-rw-r--r-- | server/src/com/vaadin/ui/AbstractComponent.java | 10 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/Component.java | 29 |
2 files changed, 39 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 57416e3a06..4a3aba3cf4 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -197,6 +197,16 @@ public abstract class AbstractComponent extends AbstractClientConnector } @Override + public void setPrimaryStyleName(String style) { + getState().primaryStyleName = style; + } + + @Override + public String getPrimaryStyleName() { + return getState().primaryStyleName; + } + + @Override public void addStyleName(String style) { if (style == null || "".equals(style)) { return; diff --git a/server/src/com/vaadin/ui/Component.java b/server/src/com/vaadin/ui/Component.java index 320a9dc97c..186aaa0219 100644 --- a/server/src/com/vaadin/ui/Component.java +++ b/server/src/com/vaadin/ui/Component.java @@ -198,6 +198,35 @@ public interface Component extends ClientConnector, Sizeable, Serializable { public void removeStyleName(String style); /** + * Gets the primary style name of the component. See + * {@link Component#setPrimaryStyleName(String)} for a better description of + * the primary stylename. + */ + public String getPrimaryStyleName(); + + /** + * Changes the primary style name of the component. + * + * <p> + * The primary style name identifies the component when applying the CSS + * theme to the Component. By changing the style name all CSS rules targeted + * for that style name will no longer apply, and might result in the + * component not working as intended. + * </p> + * + * <p> + * To preserve the original style of the component when changing to a new + * primary style you should make your new primary style inherit the old + * primary style using the SASS @include directive. See more in the SASS + * tutorials. + * </p> + * + * @param style + * The new primary style name + */ + public void setPrimaryStyleName(String style); + + /** * Tests whether the component is enabled or not. A user can not interact * with disabled components. Disabled components are rendered in a style * that indicates the status, usually in gray color. Children of a disabled |