OBEROn SDK

com.oberon.client
Class CSSStyle

java.lang.Object
  extended by com.oberon.client.CSSStyle

public class CSSStyle
extends java.lang.Object

CSS Style for SWT widgets

Version:
5.0

Constructor Summary
CSSStyle(java.lang.String name)
          Defines new CSS style with a specific class name
 
Method Summary
 org.eclipse.swt.graphics.Color getBackGroundColor()
          Returns the widget background color (null if not set)
 org.eclipse.swt.graphics.Image getBackGroundImage()
          Returns the widget background image
 org.eclipse.swt.graphics.Color getColor()
          Returns the widget text foreground color (null if not set)
 org.eclipse.swt.graphics.Font getFont()
          Returns the widget text font style (null if not set)
 org.eclipse.swt.graphics.Image getImage()
          Returns the widget image
 int[] getMargin()
          Returns the margins outside the widget (null if not set)
 java.lang.String getName()
          Returns the CSS style (class) name
 int[] getPadding()
          Returns the margins inside the control or composite (null if not set)
 int getSettingCount()
          Returns the number of settings for this style
 java.util.Enumeration<java.lang.String> getSettings()
          Returns an Enumeration containing the names settings for this style
 int[] getSpacing()
          Returns the grid spacing (null if not set)
 java.lang.String getTextAlignment()
          Returns the widget horizontal alignment inside the grid span (null if not set)
 java.lang.String getVerticalAlignment()
          Returns the widget vertical alignment inside the grid span (null if not set)
 void setBackGroundColor(int red, int green, int blue)
          Sets the widget background color
 void setBackGroundColor(java.lang.String color)
          Sets the widget background color
 void setBackGroundImage(java.lang.String url)
          Sets the widget background image
 void setColor(int red, int green, int blue)
          Sets the widget text foreground color
 void setColor(java.lang.String color)
          Sets the widget text foreground color
 void setFont(java.lang.String family, int size, int modifier)
          Sets the widget text font style
 void setImage(java.lang.String url)
          Sets the widget image
 void setMargin(int top, int right, int bottom, int left)
          Sets the margins outside the widget (inside the grid span)
 void setMargin(java.lang.String margin)
          Sets the margins outside the widget (inside the grid span)
 void setPadding(int top, int right, int bottom, int left)
          Sets the margins inside the control or composite
 void setPadding(java.lang.String padding)
          Sets the margins inside the control or composite
 void setSpacing(int horizontal, int vertical)
          Sets the grid spacing
 void setTextAlignment(java.lang.String align)
          Sets the widget horizontal alignment inside the grid span
 void setVerticalAlignment(java.lang.String align)
          Sets the widget vertical alignment inside the grid span
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSSStyle

public CSSStyle(java.lang.String name)
Defines new CSS style with a specific class name

Method Detail

setFont

public void setFont(java.lang.String family,
                    int size,
                    int modifier)
Sets the widget text font style

Parameters:
family - the name of the font (must not be null)
size - the font height in points
modifier - a bit or combination of NORMAL, BOLD, ITALIC

setColor

public void setColor(java.lang.String color)
Sets the widget text foreground color

Parameters:
color - CSS color [ Color RGB: rgb(r,g,b) / Color HexValue: #RRGGBB / ColorName: red,yellow... ]

setColor

public void setColor(int red,
                     int green,
                     int blue)
Sets the widget text foreground color

Parameters:
red - the amount of red in the color
green - the amount of green in the color
blue - the amount of blue in the color

setBackGroundColor

public void setBackGroundColor(java.lang.String color)
Sets the widget background color

Parameters:
color - CSS color [ Color RGB: rgb(r,g,b) / Color HexValue: #RRGGBB / ColorName: red,yellow... ]

setBackGroundColor

public void setBackGroundColor(int red,
                               int green,
                               int blue)
Sets the widget background color

Parameters:
red - the amount of red in the color
green - the amount of green in the color
blue - the amount of blue in the color

setBackGroundImage

public void setBackGroundImage(java.lang.String url)
Sets the widget background image

Parameters:
url - the background image url

setImage

public void setImage(java.lang.String url)
Sets the widget image

Parameters:
url - the image url
Since:
4.1

setTextAlignment

public void setTextAlignment(java.lang.String align)
Sets the widget horizontal alignment inside the grid span

Parameters:
align - the CSS alignment value ("left" , "center" , "right")

setVerticalAlignment

public void setVerticalAlignment(java.lang.String align)
Sets the widget vertical alignment inside the grid span

Parameters:
align - the CSS alignment value ("top" , "middle" , "bottom")

setSpacing

public void setSpacing(int horizontal,
                       int vertical)
Sets the grid spacing

Parameters:
horizontal - the horizontal spacing
vertical - the vertical spacing

setPadding

public void setPadding(int top,
                       int right,
                       int bottom,
                       int left)
Sets the margins inside the control or composite

Parameters:
top - the top margin
right - the right margin
bottom - the bottom margin
left - the left margin

setPadding

public void setPadding(java.lang.String padding)
Sets the margins inside the control or composite

Parameters:
padding - the CSS padding values ( "top[px/pt] right[px/pt] bottom[px/pt] left[px/pt]" )

setMargin

public void setMargin(int top,
                      int right,
                      int bottom,
                      int left)
Sets the margins outside the widget (inside the grid span)

Parameters:
top - the top margin
right - the right margin
bottom - the bottom margin
left - the left margin

setMargin

public void setMargin(java.lang.String margin)
Sets the margins outside the widget (inside the grid span)

Parameters:
margin - the CSS margin values ( "top[px/pt] right[px/pt] bottom[px/pt] left[px/pt]" )

getName

public java.lang.String getName()
Returns the CSS style (class) name


getSettingCount

public int getSettingCount()
Returns the number of settings for this style


getSettings

public java.util.Enumeration<java.lang.String> getSettings()
Returns an Enumeration containing the names settings for this style


getFont

public org.eclipse.swt.graphics.Font getFont()
Returns the widget text font style (null if not set)


getColor

public org.eclipse.swt.graphics.Color getColor()
Returns the widget text foreground color (null if not set)


getBackGroundColor

public org.eclipse.swt.graphics.Color getBackGroundColor()
Returns the widget background color (null if not set)


getBackGroundImage

public org.eclipse.swt.graphics.Image getBackGroundImage()
Returns the widget background image


getImage

public org.eclipse.swt.graphics.Image getImage()
Returns the widget image

Since:
4.1

getTextAlignment

public java.lang.String getTextAlignment()
Returns the widget horizontal alignment inside the grid span (null if not set)


getVerticalAlignment

public java.lang.String getVerticalAlignment()
Returns the widget vertical alignment inside the grid span (null if not set)


getPadding

public int[] getPadding()
Returns the margins inside the control or composite (null if not set)

Returns:
array of "top,right,bottom,left" padding values

getMargin

public int[] getMargin()
Returns the margins outside the widget (null if not set)

Returns:
array of "top,right,bottom,left" margin values

getSpacing

public int[] getSpacing()
Returns the grid spacing (null if not set)

Returns:
array of "horizontal,vertical" spacing values

OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.