From cc3013a1e6e94872fb6ec07e756201495ec03ab6 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Mon, 24 Sep 2012 14:44:19 +0300 Subject: Added primary stylename handling on server side #9724 --- server/src/com/vaadin/ui/AbstractComponent.java | 10 ++++++++++ server/src/com/vaadin/ui/Component.java | 13 +++++++++++++ 2 files changed, 23 insertions(+) (limited to 'server/src/com/vaadin') diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index c49d6237b8..51510ce00a 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -196,6 +196,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)) { diff --git a/server/src/com/vaadin/ui/Component.java b/server/src/com/vaadin/ui/Component.java index 320a9dc97c..dd7ea6278b 100644 --- a/server/src/com/vaadin/ui/Component.java +++ b/server/src/com/vaadin/ui/Component.java @@ -197,6 +197,19 @@ public interface Component extends ClientConnector, Sizeable, Serializable { */ public void removeStyleName(String style); + /** + * FIXME Javadoc + */ + public String getPrimaryStyleName(); + + /** + * FIXME Javadoc + * + * @param style + * The stylename to set + */ + 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 -- cgit v1.2.3 From 5efcd34424299e40dfef960c61f52ee61b104929 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Mon, 1 Oct 2012 15:07:44 +0300 Subject: Javadoc + fixed a typo in method name #9724 --- server/src/com/vaadin/ui/AbstractComponent.java | 2 +- server/src/com/vaadin/ui/Component.java | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'server/src/com/vaadin') diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 5e4938dcf5..4a3aba3cf4 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -197,7 +197,7 @@ public abstract class AbstractComponent extends AbstractClientConnector } @Override - public void setPrimaryStylename(String style) { + public void setPrimaryStyleName(String style) { getState().primaryStyleName = style; } diff --git a/server/src/com/vaadin/ui/Component.java b/server/src/com/vaadin/ui/Component.java index dd7ea6278b..186aaa0219 100644 --- a/server/src/com/vaadin/ui/Component.java +++ b/server/src/com/vaadin/ui/Component.java @@ -198,17 +198,33 @@ public interface Component extends ClientConnector, Sizeable, Serializable { public void removeStyleName(String style); /** - * FIXME Javadoc + * Gets the primary style name of the component. See + * {@link Component#setPrimaryStyleName(String)} for a better description of + * the primary stylename. */ public String getPrimaryStyleName(); /** - * FIXME Javadoc + * Changes the primary style name of the component. + * + *

+ * 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. + *

+ * + *

+ * 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. + *

* * @param style - * The stylename to set + * The new primary style name */ - public void setPrimaryStylename(String style); + public void setPrimaryStyleName(String style); /** * Tests whether the component is enabled or not. A user can not interact -- cgit v1.2.3