eu.webtoolkit.jwt
Class WCssDecorationStyle

java.lang.Object
  extended by eu.webtoolkit.jwt.WObject
      extended by eu.webtoolkit.jwt.WCssDecorationStyle

public class WCssDecorationStyle
extends WObject

A style class for a single widget or style sheet rule.

You can manipulate the decoration style of a single widget using WWidget#getDecorationStyle() or you can use a WCssDecorationStyle to add a rule to the inline style sheet using WCssStyleSheet#addRule().


Nested Class Summary
static class WCssDecorationStyle.Repeat
          How a background image must be repeated.
static class WCssDecorationStyle.TextDecoration
          Text decoration options.
 
Constructor Summary
WCssDecorationStyle()
          Creates a default style.
 
Method Summary
 WColor getBackgroundColor()
          Returns the background color.
 java.lang.String getBackgroundImage()
          Returns the background image URL.
 WCssDecorationStyle.Repeat getBackgroundImageRepeat()
          Returns the background image repeat.
 WBorder getBorder()
          Returns the border style.
 WBorder getBorder(Side side)
          Returns the border style.
 Cursor getCursor()
          Returns the cursor style.
 java.lang.String getCursorImage()
          Returns the cursor image.
 WFont getFont()
          Returns the font.
 WColor getForegroundColor()
          Returns the text color.
 java.util.EnumSet<WCssDecorationStyle.TextDecoration> getTextDecoration()
          Returns the text decoration options.
 void setBackgroundColor(WColor color)
          Sets the background color.
 void setBackgroundImage(java.lang.String url)
          Sets a background image.
 void setBackgroundImage(java.lang.String url, WCssDecorationStyle.Repeat repeat)
          Sets a background image.
 void setBackgroundImage(java.lang.String url, WCssDecorationStyle.Repeat repeat, java.util.EnumSet<Side> sides)
          Sets a background image.
 void setBackgroundImage(java.lang.String url, WCssDecorationStyle.Repeat repeat, Side side, Side... sides)
          Sets a background image.
 void setBackgroundImage(WLink image)
          Sets a background image.
 void setBackgroundImage(WLink image, WCssDecorationStyle.Repeat repeat)
          Sets a background image.
 void setBackgroundImage(WLink image, WCssDecorationStyle.Repeat repeat, java.util.EnumSet<Side> sides)
          Sets a background image.
 void setBackgroundImage(WLink image, WCssDecorationStyle.Repeat repeat, Side side, Side... sides)
          Sets a background image.
 void setBorder(WBorder border)
          Sets the border style.
 void setBorder(WBorder border, java.util.EnumSet<Side> sides)
          Sets the border style.
 void setBorder(WBorder border, Side side, Side... sides)
          Sets the border style.
 void setCursor(Cursor c)
          Sets the cursor style.
 void setCursor(java.lang.String cursorImage)
          Sets a custom cursor image Url.
 void setCursor(java.lang.String cursorImage, Cursor fallback)
          Sets a custom cursor image Url.
 void setFont(WFont font)
          Sets the text font.
 void setForegroundColor(WColor color)
          Sets the text color.
 void setTextDecoration(java.util.EnumSet<WCssDecorationStyle.TextDecoration> options)
          Sets text decoration options.
 void setTextDecoration(WCssDecorationStyle.TextDecoration option, WCssDecorationStyle.TextDecoration... options)
          Sets text decoration options.
 
Methods inherited from class eu.webtoolkit.jwt.WObject
getId, getObjectName, remove, setObjectName, tr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WCssDecorationStyle

public WCssDecorationStyle()
Creates a default style.

Method Detail

setCursor

public void setCursor(Cursor c)
Sets the cursor style.


getCursor

public Cursor getCursor()
Returns the cursor style.

See Also:
setCursor(Cursor c)

setCursor

public void setCursor(java.lang.String cursorImage,
                      Cursor fallback)
Sets a custom cursor image Url.

The Url should point to a .cur file (this shoul be a real .cur file, renaming an .ico is not enough for Internet Explorer).


setCursor

public final void setCursor(java.lang.String cursorImage)
Sets a custom cursor image Url.

Calls setCursor(cursorImage, Cursor.ArrowCursor)


getCursorImage

public java.lang.String getCursorImage()
Returns the cursor image.

See Also:
setCursor(Cursor c)

setBackgroundColor

public void setBackgroundColor(WColor color)
Sets the background color.


getBackgroundColor

public WColor getBackgroundColor()
Returns the background color.

See Also:
setBackgroundColor(WColor color)

setBackgroundImage

public void setBackgroundImage(WLink image,
                               WCssDecorationStyle.Repeat repeat,
                               java.util.EnumSet<Side> sides)
Sets a background image.

The link may be a URL or a resource.

The image may be placed in a particular location by specifying sides by OR'ing Side values together, e.g. (Right | Top).


setBackgroundImage

public final void setBackgroundImage(WLink image,
                                     WCssDecorationStyle.Repeat repeat,
                                     Side side,
                                     Side... sides)
Sets a background image.

Calls setBackgroundImage(image, repeat, EnumSet.of(side, sides))


setBackgroundImage

public final void setBackgroundImage(WLink image)
Sets a background image.

Calls setBackgroundImage(image, WCssDecorationStyle.Repeat.RepeatXY, EnumSet.noneOf(Side.class))


setBackgroundImage

public final void setBackgroundImage(WLink image,
                                     WCssDecorationStyle.Repeat repeat)
Sets a background image.

Calls setBackgroundImage(image, repeat, EnumSet.noneOf(Side.class))


setBackgroundImage

public void setBackgroundImage(java.lang.String url,
                               WCssDecorationStyle.Repeat repeat,
                               java.util.EnumSet<Side> sides)
Sets a background image.

The image may be placed in a particular location by specifying sides by OR'ing Side values together, e.g. (Right | Top).


setBackgroundImage

public final void setBackgroundImage(java.lang.String url,
                                     WCssDecorationStyle.Repeat repeat,
                                     Side side,
                                     Side... sides)
Sets a background image.

Calls setBackgroundImage(url, repeat, EnumSet.of(side, sides))


setBackgroundImage

public final void setBackgroundImage(java.lang.String url)
Sets a background image.

Calls setBackgroundImage(url, WCssDecorationStyle.Repeat.RepeatXY, EnumSet.noneOf(Side.class))


setBackgroundImage

public final void setBackgroundImage(java.lang.String url,
                                     WCssDecorationStyle.Repeat repeat)
Sets a background image.

Calls setBackgroundImage(url, repeat, EnumSet.noneOf(Side.class))


getBackgroundImage

public java.lang.String getBackgroundImage()
Returns the background image URL.

See Also:
setBackgroundImage(WLink image, WCssDecorationStyle.Repeat repeat, EnumSet sides)

getBackgroundImageRepeat

public WCssDecorationStyle.Repeat getBackgroundImageRepeat()
Returns the background image repeat.

See Also:
setBackgroundImage(WLink image, WCssDecorationStyle.Repeat repeat, EnumSet sides)

setForegroundColor

public void setForegroundColor(WColor color)
Sets the text color.


getForegroundColor

public WColor getForegroundColor()
Returns the text color.

See Also:
setForegroundColor(WColor color)

setBorder

public void setBorder(WBorder border,
                      java.util.EnumSet<Side> sides)
Sets the border style.

The given border will be set for the specified sides.

A different border style may be specified for each of the four sides.


setBorder

public final void setBorder(WBorder border,
                            Side side,
                            Side... sides)
Sets the border style.

Calls setBorder(border, EnumSet.of(side, sides))


setBorder

public final void setBorder(WBorder border)
Sets the border style.

Calls setBorder(border, Side.All)


getBorder

public WBorder getBorder(Side side)
Returns the border style.

Returns the border style set using setBorder() for the given side.

See Also:

Note: Prior to version 3.1.9 it was not possible to pass a side and only one border could be configured.


getBorder

public final WBorder getBorder()
Returns the border style.

Returns getBorder(Side.Top)


setFont

public void setFont(WFont font)
Sets the text font.


getFont

public WFont getFont()
Returns the font.

See Also:
setFont(WFont font)

setTextDecoration

public void setTextDecoration(java.util.EnumSet<WCssDecorationStyle.TextDecoration> options)
Sets text decoration options.

You may logically or together any of the options of the TextDecoration enumeration.

The default is 0.


setTextDecoration

public final void setTextDecoration(WCssDecorationStyle.TextDecoration option,
                                    WCssDecorationStyle.TextDecoration... options)
Sets text decoration options.

Calls setTextDecoration(EnumSet.of(option, options))


getTextDecoration

public java.util.EnumSet<WCssDecorationStyle.TextDecoration> getTextDecoration()
Returns the text decoration options.

See Also:
setTextDecoration(EnumSet options)