diff options
author | Jani Laakso <jani.laakso@itmill.com> | 2007-10-09 06:12:02 +0000 |
---|---|---|
committer | Jani Laakso <jani.laakso@itmill.com> | 2007-10-09 06:12:02 +0000 |
commit | 5ba28731e951c06ddb3bb9eaa73bfbf207084958 (patch) | |
tree | 283027b45f0a1dc287c4e3e836ebb2bba00b227f /src/com/itmill/toolkit/ui/AbstractComponent.java | |
parent | d5e956890c9a08915ecd0e0ebf9f59c42f7edd7c (diff) | |
download | vaadin-framework-5ba28731e951c06ddb3bb9eaa73bfbf207084958.tar.gz vaadin-framework-5ba28731e951c06ddb3bb9eaa73bfbf207084958.zip |
Mass format based on eclipse build in formatting style.
svn changeset:2461/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui/AbstractComponent.java')
-rw-r--r-- | src/com/itmill/toolkit/ui/AbstractComponent.java | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/com/itmill/toolkit/ui/AbstractComponent.java b/src/com/itmill/toolkit/ui/AbstractComponent.java index 18ce5b59a5..13d40bc23d 100644 --- a/src/com/itmill/toolkit/ui/AbstractComponent.java +++ b/src/com/itmill/toolkit/ui/AbstractComponent.java @@ -57,7 +57,7 @@ import java.lang.reflect.Method; public abstract class AbstractComponent implements Component, MethodEventSource { /* Private members ************************************************* */ - + /** * Style names. */ @@ -162,10 +162,10 @@ public abstract class AbstractComponent implements Component, MethodEventSource */ public String getStyle() { String s = ""; - if(styles != null) { - for(Iterator it = styles.iterator();it.hasNext();) { + if (styles != null) { + for (Iterator it = styles.iterator(); it.hasNext();) { s += (String) it.next(); - if(it.hasNext()) + if (it.hasNext()) s += " "; } } @@ -177,36 +177,36 @@ public abstract class AbstractComponent implements Component, MethodEventSource * default documentation from implemented interface. */ public void setStyle(String style) { - if(style == null || "".equals(style)) { + if (style == null || "".equals(style)) { styles = null; requestRepaint(); return; } - if(this.styles == null) { + if (this.styles == null) { styles = new ArrayList(); } styles.clear(); styles.add(style); requestRepaint(); } - + public void addStyleName(String style) { - if(style == null || "".equals(style)) + if (style == null || "".equals(style)) return; - if(this.styles == null) { + if (this.styles == null) { styles = new ArrayList(); } - if(! styles.contains(style)) { + if (!styles.contains(style)) { this.styles.add(style); requestRepaint(); } } - + public void removeStyleName(String style) { styles.remove(style); requestRepaint(); } - + /* * Get's the component's caption. Don't add a JavaDoc comment here, we use * the default documentation from implemented interface. @@ -552,10 +552,11 @@ public abstract class AbstractComponent implements Component, MethodEventSource */ public final void paint(PaintTarget target) throws PaintException { - if (!target.startTag(this, this.getTag()) || repaintRequestListenersNotified) { - + if (!target.startTag(this, this.getTag()) + || repaintRequestListenersNotified) { + // Paint the contents of the component - + if (styles != null && styles.size() > 0) target.addAttribute("style", getStyle()); if (isReadOnly()) @@ -585,7 +586,7 @@ public abstract class AbstractComponent implements Component, MethodEventSource error.paint(target); } } else { - + // Contents have not changed, only cached presentation can be used target.addAttribute("cached", true); } |