Class WCssDecorationStyle
public class WCssDecorationStyle extends WObject
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
Nested Classes Modifier and Type Class Description static class
WCssDecorationStyle.Repeat
How a background image must be repeated.static class
WCssDecorationStyle.TextDecoration
Text decoration options.Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
Constructors Constructor Description WCssDecorationStyle()
Creates a default style.WCssDecorationStyle(WCssDecorationStyle other)
Copy constructor. -
Method Summary
Modifier and Type Method Description 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(WLink image)
Sets a background image.void
setBackgroundImage(WLink image, WCssDecorationStyle.Repeat repeat)
Sets a background image.void
setBackgroundImage(WLink image, WCssDecorationStyle.Repeat repeat, Side side, Side... sides)
Sets a background image.void
setBackgroundImage(WLink image, WCssDecorationStyle.Repeat repeat, java.util.EnumSet<Side> sides)
Sets a background image.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, Side side, Side... sides)
Sets a background image.void
setBackgroundImage(java.lang.String url, WCssDecorationStyle.Repeat repeat, java.util.EnumSet<Side> sides)
Sets a background image.void
setBorder(WBorder border)
Sets the border style.void
setBorder(WBorder border, Side side, Side... sides)
Sets the border style.void
setBorder(WBorder border, java.util.EnumSet<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(WCssDecorationStyle.TextDecoration option, WCssDecorationStyle.TextDecoration... options)
Sets text decoration options.void
setTextDecoration(java.util.EnumSet<WCssDecorationStyle.TextDecoration> options)
Sets text decoration options.Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getId, getObjectName, remove, setFormData, setObjectName, tr
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
WCssDecorationStyle
public WCssDecorationStyle()Creates a default style. -
WCssDecorationStyle
Copy constructor.
-
-
Method Details
-
setCursor
Sets the cursor style. -
getCursor
Returns the cursor style.- See Also:
setCursor(Cursor c)
-
setCursor
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. -
getCursorImage
public java.lang.String getCursorImage()Returns the cursor image.- See Also:
setCursor(Cursor c)
-
setBackgroundColor
Sets the background color. -
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
Sets a background image.Calls
setBackgroundImage(image, WCssDecorationStyle.Repeat.RepeatXY, EnumSet.noneOf(Side.class))
-
setBackgroundImage
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
Sets a background image.Calls
setBackgroundImage(url, repeat, EnumSet.noneOf(Side.class))
-
getBackgroundImage
public java.lang.String getBackgroundImage()Returns the background image URL. -
getBackgroundImageRepeat
Returns the background image repeat. -
setForegroundColor
Sets the text color. -
getForegroundColor
Returns the text color.- See Also:
setForegroundColor(WColor color)
-
setBorder
Sets the border style.The given
border
will be set for the specifiedsides
.A different border style may be specified for each of the four sides.
-
setBorder
Sets the border style. -
setBorder
Sets the border style. -
getBorder
Returns the border style.Returns the border style set using
setBorder()
for the givenside
. -
getBorder
Returns the border style.Returns
getBorder(Side.Top)
-
setFont
Sets the text font. -
getFont
Returns the font.- See Also:
setFont(WFont font)
-
setTextDecoration
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. -
getTextDecoration
Returns the text decoration options.- See Also:
setTextDecoration(EnumSet options)
-