# Class CSSPropertyMarginSWTHandler

java.lang.Object
org.eclipse.e4.ui.css.core.dom.properties.css2.AbstractCSSPropertyMarginHandler
org.eclipse.e4.ui.css.swt.properties.css2.CSSPropertyMarginSWTHandler

All Implemented Interfaces:
  `ICSSPropertyMarginHandler, ICSSPropertyHandler`

public class CSSPropertyMarginSWTHandler extends AbstractCSSPropertyMarginHandler

## Field Summary

Fields
Modifier and Type
Field
Description
`static final ICSSPropertyMarginHandler`
`INSTANCE`

## Constructor Summary

Constructors
Constructor
Description
`CSSPropertyMarginSWTHandler()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`applyCSSProperty(Object element, String property, CSSValue value, String pseudo, CSSEngine engine)`
Apply CSS Property `property` (ex : background-color) with CSSValue `value` (ex : red) into the `element` (ex : Swing Component, SWT Widget).
`void`
`applyCSSPropertyMargin(Object element, CSSValue value, String pseudo, CSSEngine engine)`
A shorthand property for setting all four margins in one declaration.
`void`
`applyCSSPropertyMarginBottom(Object element, CSSValue value, String pseudo, CSSEngine engine)`
Sets the bottom margin.
`void`
`applyCSSPropertyMarginLeft(Object element, CSSValue value, String pseudo, CSSEngine engine)`
Sets the left margin.
`void`
`applyCSSPropertyMarginRight(Object element, CSSValue value, String pseudo, CSSEngine engine)`
Sets the right margin.
`void`
`applyCSSPropertyMarginTop(Object element, CSSValue value, String pseudo, CSSEngine engine)`
Sets the top margin.
`String`
`retrieveCSSPropertyMargin(Object element, String pseudo, CSSEngine engine)`
`String`
`retrieveCSSPropertyMarginBottom(Object element, String pseudo, CSSEngine engine)`
`String`
`retrieveCSSPropertyMarginLeft(Object element, String pseudo, CSSEngine engine)`
`String`
`retrieveCSSPropertyMarginRight(Object element, String pseudo, CSSEngine engine)`
`String`
`retrieveCSSPropertyMarginTop(Object element, String pseudo, CSSEngine engine)`

### Methods inherited from class AbstractCSSPropertyMarginHandler

`retrieveCSSProperty`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface ICSSPropertyHandler

`onAllCSSPropertiesApplied, onAllCSSPropertiesApplied`

## Field Details

### INSTANCE

public static final ICSSPropertyMarginHandler INSTANCE

## Constructor Details

### CSSPropertyMarginSWTHandler

public CSSPropertyMarginSWTHandler()

## Method Details

### applyCSSProperty

public boolean applyCSSProperty(Object element, String property, CSSValue value, String pseudo, CSSEngine engine) throws Exception
Description copied from interface: `ICSSPropertyHandler`
Apply CSS Property `property` (ex : background-color) with CSSValue `value` (ex : red) into the `element` (ex : Swing Component, SWT Widget).

Specified by:
  `applyCSSProperty` in interface `ICSSPropertyHandler`
Overrides:
  `applyCSSProperty` in class `AbstractCSSPropertyMarginHandler`
Parameters:
  `element` - Swing Component, SWT Widget...
  `property` - CSS Property
  `value` - CSS value
  `pseudo` - the pseudo class to use, or `null` if none is required
  `engine` - CSS Engine
Returns:
  weather CSS property was applied or not
Throws:
  `Exception` - if applying CSS failed

### applyCSSPropertyMargin

public void applyCSSPropertyMargin(Object element, CSSValue value, String pseudo, CSSEngine engine) throws Exception
Description copied from interface: `ICSSPropertyMarginHandler`
A shorthand property for setting all four margins in one declaration. Available values are {margin-top, margin-right, margin-bottom, margin-left}

Throws:
  `Exception`

### applyCSSPropertyMarginTop

public void applyCSSPropertyMarginTop(Object element, CSSValue value, String pseudo, CSSEngine engine) throws Exception
Description copied from interface: `ICSSPropertyMarginHandler`
Sets the top margin. Available values are {length}

Throws:
  `Exception`

### applyCSSPropertyMarginRight

public void applyCSSPropertyMarginRight(Object element, CSSValue value, String pseudo, CSSEngine engine) throws Exception
Description copied from interface: `ICSSPropertyMarginHandler`
Sets the right margin. Available values are {length}

Throws:
  `Exception`

### applyCSSPropertyMarginBottom

public void applyCSSPropertyMarginBottom(Object element, CSSValue value, String pseudo, CSSEngine engine) throws Exception
Description copied from interface: `ICSSPropertyMarginHandler`
Sets the bottom margin. Available values are {length}

Throws:
  `Exception`

### applyCSSPropertyMarginLeft

public void applyCSSPropertyMarginLeft(Object element, CSSValue value, String pseudo, CSSEngine engine) throws Exception
Description copied from interface: `ICSSPropertyMarginHandler`
Sets the left margin. Available values are {length}

Throws:
  `Exception`

### retrieveCSSPropertyMargin

public String retrieveCSSPropertyMargin(Object element, String pseudo, CSSEngine engine) throws Exception

Throws:
  `Exception`

### retrieveCSSPropertyMarginTop

public String retrieveCSSPropertyMarginTop(Object element, String pseudo, CSSEngine engine) throws Exception

Throws:
  `Exception`

### retrieveCSSPropertyMarginRight

public String retrieveCSSPropertyMarginRight(Object element, String pseudo, CSSEngine engine) throws Exception

Throws:
  `Exception`

### retrieveCSSPropertyMarginBottom

public String retrieveCSSPropertyMarginBottom(Object element, String pseudo, CSSEngine engine) throws Exception

Throws:
  `Exception`

### retrieveCSSPropertyMarginLeft

public String retrieveCSSPropertyMarginLeft(Object element, String pseudo, CSSEngine engine) throws Exception

Throws:
  `Exception`