Class SWTValidationUiServiceImpl
- java.lang.Object
-
- org.eclipse.emfforms.internal.swt.core.ui.SWTValidationUiServiceImpl
-
- All Implemented Interfaces:
SWTValidationUiService
public class SWTValidationUiServiceImpl extends java.lang.Object implements SWTValidationUiService
Default implementation of theSWTValidationUiService
which delegates to theSWTValidationHelper
to get the validation icons and colors.- Author:
- Lucas Koehler
-
-
Constructor Summary
Constructors Constructor Description SWTValidationUiServiceImpl()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.swt.graphics.Color
getValidationBackgroundColor(org.eclipse.emf.common.util.Diagnostic diagnostic, VElement vElement, ViewModelContext viewModelContext)
Returns the background color for a control with the given Diagnostic, VElement and view model context, if applicable.org.eclipse.swt.graphics.Color
getValidationBackgroundColor(VElement vElement, ViewModelContext viewModelContext)
Returns the background color for a control matching the highest severity of the given VElement's diagnostic.org.eclipse.swt.graphics.Color
getValidationForegroundColor(org.eclipse.emf.common.util.Diagnostic diagnostic, VElement vElement, ViewModelContext viewModelContext)
Returns the foreground color for a control with the given Diagnostic, VElement and view model context, if applicable.org.eclipse.swt.graphics.Color
getValidationForegroundColor(VElement vElement, ViewModelContext viewModelContext)
Returns the foreground color for a control matching the highest severity of the given VElement's diagnostic.org.eclipse.swt.graphics.Image
getValidationIcon(org.eclipse.emf.common.util.Diagnostic diagnostic, VElement vElement, ViewModelContext viewModelContext)
Returns the validation icon matching the given Diagnostic, VElement and view model context, if applicable.org.eclipse.swt.graphics.Image
getValidationIcon(VElement vElement, ViewModelContext viewModelContext)
Returns the validation icon matching the highest severity of the given VElement's diagnostic.
-
-
-
Method Detail
-
getValidationIcon
public org.eclipse.swt.graphics.Image getValidationIcon(org.eclipse.emf.common.util.Diagnostic diagnostic, VElement vElement, ViewModelContext viewModelContext)
Description copied from interface:SWTValidationUiService
Returns the validation icon matching the given Diagnostic, VElement and view model context, if applicable.- Specified by:
getValidationIcon
in interfaceSWTValidationUiService
- Parameters:
diagnostic
- theDiagnostic
defining the validation visualizationvElement
- 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(VElement vElement, ViewModelContext viewModelContext)
Description copied from interface:SWTValidationUiService
Returns the validation icon matching the highest severity of the given VElement's diagnostic.- Specified by:
getValidationIcon
in interfaceSWTValidationUiService
- Parameters:
vElement
- TheVElement
that is being renderedviewModelContext
- The correspondingViewModelContext
- Returns:
- the icon to be displayed, or
null
when no icon is to be displayed
-
getValidationForegroundColor
public org.eclipse.swt.graphics.Color getValidationForegroundColor(org.eclipse.emf.common.util.Diagnostic diagnostic, VElement vElement, ViewModelContext viewModelContext)
Description copied from interface:SWTValidationUiService
Returns the foreground color for a control with the given Diagnostic, VElement and view model context, if applicable.- Specified by:
getValidationForegroundColor
in interfaceSWTValidationUiService
- Parameters:
diagnostic
- theDiagnostic
defining the validation visualizationvElement
- TheVElement
that is being renderedviewModelContext
- The correspondingViewModelContext
- Returns:
- the color to be used as a foreground color
-
getValidationForegroundColor
public org.eclipse.swt.graphics.Color getValidationForegroundColor(VElement vElement, ViewModelContext viewModelContext)
Description copied from interface:SWTValidationUiService
Returns the foreground color for a control matching the highest severity of the given VElement's diagnostic.- Specified by:
getValidationForegroundColor
in interfaceSWTValidationUiService
- Parameters:
vElement
- TheVElement
that is being renderedviewModelContext
- The correspondingViewModelContext
- Returns:
- the color to be used as a foreground color
-
getValidationBackgroundColor
public org.eclipse.swt.graphics.Color getValidationBackgroundColor(org.eclipse.emf.common.util.Diagnostic diagnostic, VElement vElement, ViewModelContext viewModelContext)
Description copied from interface:SWTValidationUiService
Returns the background color for a control with the given Diagnostic, VElement and view model context, if applicable.- Specified by:
getValidationBackgroundColor
in interfaceSWTValidationUiService
- Parameters:
diagnostic
- theDiagnostic
defining the validation visualizationvElement
- TheVElement
that is being renderedviewModelContext
- The correspondingViewModelContext
- Returns:
- the color to be used as a background color
-
getValidationBackgroundColor
public org.eclipse.swt.graphics.Color getValidationBackgroundColor(VElement vElement, ViewModelContext viewModelContext)
Description copied from interface:SWTValidationUiService
Returns the background color for a control matching the highest severity of the given VElement's diagnostic.- Specified by:
getValidationBackgroundColor
in interfaceSWTValidationUiService
- Parameters:
vElement
- TheVElement
that is being renderedviewModelContext
- The correspondingViewModelContext
- Returns:
- the color to be used as a background color
-
-