org.eclipse.emf.ecp.edit.spi.swt.util
Class SWTValidationHelper

java.lang.Object
  extended by org.eclipse.emf.ecp.edit.spi.swt.util.SWTValidationHelper

public final class SWTValidationHelper
extends Object

Helper class for accessing icons and colours for validations.

Since:
1.5
Author:
jfaltermeier

Field Summary
static SWTValidationHelper INSTANCE
          The instance of the SWTValidationHelper.
 
Method Summary
 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.
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 the Diagnostic
vElement - The VElement that is being rendered
viewModelContext - The corresponding ViewModelContext
Returns:
the color to be used as a background color

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 the Diagnostic
Returns:
the color to be used as a background color

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 the Diagnostic
vElement - The VElement that is being rendered
viewModelContext - The corresponding ViewModelContext
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 the Diagnostic
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 the Diagnostic
vElement - The VElement that is being rendered
viewModelContext - The corresponding ViewModelContext
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


Copyright © 2015. All Rights Reserved.