Class SWTValidationHelper
- java.lang.Object
-
- org.eclipse.emfforms.spi.swt.core.ui.SWTValidationHelper
-
public class SWTValidationHelper extends java.lang.Object
Helper class for accessing icons and colours for validations.- Since:
- 1.23
- Author:
- jfaltermeier
-
-
Field Summary
Fields Modifier and Type Field Description static SWTValidationHelper
INSTANCE
The instance of the SWTValidationHelper.
-
Constructor Summary
Constructors Constructor Description SWTValidationHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.swt.graphics.Color
getValidationBackgroundColor(int severity)
Returns the background color for a control with the given validation severity.org.eclipse.swt.graphics.Color
getValidationBackgroundColor(int severity, VElement vElement, ViewModelContext viewModelContext)
Returns the background color for a control with the given validation severity, VElement and view model context, if applicable.java.lang.String
getValidationColorHEX(int severity, VElement vElement, ViewModelContext viewModelContext)
Returns the hex color for a control with the given validation severity, VElement and view model context, if applicable.org.eclipse.swt.graphics.Color
getValidationForegroundColor(int severity)
Returns the foreground color for a control with the given validation severity.org.eclipse.swt.graphics.Color
getValidationForegroundColor(int severity, VElement vElement, ViewModelContext viewModelContext)
Returns the foreground color for a control with the given validation severity, VElement and view model context, if applicable.org.eclipse.swt.graphics.Image
getValidationIcon(int severity)
Returns the validation icon matching the given severity.org.eclipse.swt.graphics.Image
getValidationIcon(int severity, VElement vElement, ViewModelContext viewModelContext)
Returns the validation icon matching the given severity, VElement and view model context, if applicable.org.eclipse.jface.resource.ImageDescriptor
getValidationOverlayDescriptor(int severity)
Returns an image descriptor which can be used as an overlay for validation icons.org.eclipse.jface.resource.ImageDescriptor
getValidationOverlayDescriptor(int severity, VElement vElement, ViewModelContext viewModelContext)
Returns the validation overlay icon matching the given severity, VElement and view model context, if applicable.
-
-
-
Field Detail
-
INSTANCE
public static final SWTValidationHelper INSTANCE
The instance of the SWTValidationHelper.
-
-
Method Detail
-
getValidationBackgroundColor
public org.eclipse.swt.graphics.Color getValidationBackgroundColor(int severity, VElement vElement, ViewModelContext viewModelContext)
Returns the background color for a control with the given validation severity, VElement and view model context, if applicable.- Parameters:
severity
- severity the severity of theDiagnostic
vElement
- TheVElement
that is being renderedviewModelContext
- The correspondingViewModelContext
- Returns:
- the color to be used as a background color
-
getValidationForegroundColor
public org.eclipse.swt.graphics.Color getValidationForegroundColor(int severity, VElement vElement, ViewModelContext viewModelContext)
Returns the foreground color for a control with the given validation severity, VElement and view model context, if applicable.- Parameters:
severity
- severity the severity of theDiagnostic
vElement
- TheVElement
that is being renderedviewModelContext
- The correspondingViewModelContext
- Returns:
- the color to be used as a foreground color
- Since:
- 1.10
-
getValidationBackgroundColor
public org.eclipse.swt.graphics.Color getValidationBackgroundColor(int severity)
Returns the background color for a control with the given validation severity.- Parameters:
severity
- severity the severity of theDiagnostic
- Returns:
- the color to be used as a background color
-
getValidationForegroundColor
public org.eclipse.swt.graphics.Color getValidationForegroundColor(int severity)
Returns the foreground color for a control with the given validation severity.- Parameters:
severity
- severity the severity of theDiagnostic
- Returns:
- the color to be used as a foreground color
- Since:
- 1.10
-
getValidationColorHEX
public java.lang.String getValidationColorHEX(int severity, VElement vElement, ViewModelContext viewModelContext)
Returns the hex color for a control with the given validation severity, VElement and view model context, if applicable.- Parameters:
severity
- severity the severity of theDiagnostic
vElement
- TheVElement
that is being renderedviewModelContext
- The correspondingViewModelContext
- Returns:
- the hex value to be used
- Since:
- 1.9
-
getValidationIcon
public org.eclipse.swt.graphics.Image getValidationIcon(int severity, VElement vElement, ViewModelContext viewModelContext)
Returns the validation icon matching the given severity, VElement and view model context, if applicable.- Parameters:
severity
- the severity of theDiagnostic
vElement
- TheVElement
that is being renderedviewModelContext
- The correspondingViewModelContext
- Returns:
- the icon to be displayed, or
null
when no icon is to be displayed
-
getValidationIcon
public org.eclipse.swt.graphics.Image getValidationIcon(int severity)
Returns the validation icon matching the given severity.- Parameters:
severity
- the severity of theDiagnostic
- Returns:
- the icon to be displayed, or
null
when no icon is to be displayed
-
getValidationOverlayDescriptor
public org.eclipse.jface.resource.ImageDescriptor getValidationOverlayDescriptor(int severity, VElement vElement, ViewModelContext viewModelContext)
Returns the validation overlay icon matching the given severity, VElement and view model context, if applicable.- Parameters:
severity
- the severity of theDiagnostic
vElement
- TheVElement
that is being renderedviewModelContext
- The correspondingViewModelContext
- Returns:
- the icon to be displayed, or
null
when no icon is to be displayed
-
getValidationOverlayDescriptor
public org.eclipse.jface.resource.ImageDescriptor getValidationOverlayDescriptor(int severity)
Returns an image descriptor which can be used as an overlay for validation icons.- Parameters:
severity
- the severity of the validation- Returns:
- the descriptor
-
-