diff options
Diffstat (limited to 'server')
-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 |