Class SWTControl
- java.lang.Object
-
- org.eclipse.emf.ecp.edit.spi.ECPAbstractControl
-
- org.eclipse.emf.ecp.edit.internal.swt.util.SWTControl
-
- All Implemented Interfaces:
ECPControlSWT
- Direct Known Subclasses:
MultiControl
,SingleControl
,TableControl
@Deprecated public abstract class SWTControl extends ECPAbstractControl implements ECPControlSWT
Deprecated.This class defines a SWTCOntrol which is an abstract class defining anECPAbstractControl
for SWT.- Author:
- Eugen Neufeld
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
CUSTOM_VARIANT
Deprecated.RAP theming variable to set.protected static java.lang.String
VALIDATION_ERROR_ICON
Deprecated.The icon for a validation error.protected org.eclipse.swt.widgets.Label
validationLabel
Deprecated.The label for the validation icon.
-
Constructor Summary
Constructors Constructor Description SWTControl()
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
backwardCompatibleHandleValidation()
Deprecated.Helper method to keep the old validation.protected abstract org.eclipse.core.databinding.Binding
bindValue()
Deprecated.Triggers the control to perform the databinding.protected org.eclipse.swt.widgets.Button
createButtonForAction(org.eclipse.jface.action.Action action, org.eclipse.swt.widgets.Composite composite)
Deprecated.A helper method which creates a button for an action on a composite.protected void
createContentControl(org.eclipse.swt.widgets.Composite composite)
Deprecated.Helper for creating the unset stacklayout and creating the control's composite.org.eclipse.swt.widgets.Composite
createControl(org.eclipse.swt.widgets.Composite parent)
Deprecated.This method is called to render the control on a parent.java.util.List<RenderingResultRow<org.eclipse.swt.widgets.Control>>
createControls(org.eclipse.swt.widgets.Composite parent)
Deprecated.Renders a control on the provided parent and returning a list ofRenderingResultRows
.void
dispose()
Deprecated.Disposes the control.protected abstract void
fillControlComposite(org.eclipse.swt.widgets.Composite controlComposite)
Deprecated.This method must be overridden by concrete classes.protected abstract org.eclipse.swt.widgets.Control[]
getControlsForTooltip()
Deprecated.Method for retrieving all controls which should have the help text as their tooltip.protected org.eclipse.swt.widgets.Button
getCustomUnsetButton()
Deprecated.The default unset button will be displayed to the right of the control's composite.protected java.lang.String
getHelpText()
Deprecated.Returns the help information.protected org.eclipse.core.databinding.observable.value.IObservableValue
getModelValue()
Deprecated.The model value used for databinding.protected org.eclipse.swt.graphics.Color
getSystemColor(int color)
Deprecated.Method for retrieving aColor
based on the predefined SWT id.protected abstract java.lang.String
getUnsetButtonTooltip()
Deprecated.Returns the string for the unset button tooltip.protected abstract java.lang.String
getUnsetLabelText()
Deprecated.Returns the string for the unset label.protected org.eclipse.swt.graphics.Color
getValidationBackgroundColor(int severity)
Deprecated.Returns the background color for a control with the given validation severity.protected org.eclipse.swt.graphics.Image
getValidationIcon(int severity)
Deprecated.Returns the validation icon matching the given severity.protected boolean
isEditable()
Deprecated.void
setObservableValue(org.eclipse.core.databinding.observable.value.IObservableValue modelValue)
Deprecated.Allows the user to set theIObservableValue
to use in the control during databinding.protected void
showUnsetLabel()
Deprecated.-
Methods inherited from class org.eclipse.emf.ecp.edit.spi.ECPAbstractControl
applyValidation, enabledmentChanged, getControl, getDataBindingContext, getDomainModelReference, getEditingDomain, getEditingDomain, getFirstSetting, getFirstStructuralFeature, getItemPropertyDescriptor, getLocale, getService, getViewModelContext, handleValidation, init, isEmbedded, postInit, resetValidation, setEditable, setEmbedded, showLabel
-
-
-
-
Field Detail
-
CUSTOM_VARIANT
protected static final java.lang.String CUSTOM_VARIANT
Deprecated.RAP theming variable to set.- See Also:
- Constant Field Values
-
VALIDATION_ERROR_ICON
protected static final java.lang.String VALIDATION_ERROR_ICON
Deprecated.The icon for a validation error.- See Also:
- Constant Field Values
-
validationLabel
protected org.eclipse.swt.widgets.Label validationLabel
Deprecated.The label for the validation icon.
-
-
Method Detail
-
createControls
public java.util.List<RenderingResultRow<org.eclipse.swt.widgets.Control>> createControls(org.eclipse.swt.widgets.Composite parent)
Deprecated.Renders a control on the provided parent and returning a list ofRenderingResultRows
.- Specified by:
createControls
in interfaceECPControlSWT
- Parameters:
parent
- theComposite
to render onto- Returns:
- the list of
RenderingResultRows
- See Also:
ECPControlSWT.createControls(org.eclipse.swt.widgets.Composite)
-
createControl
public org.eclipse.swt.widgets.Composite createControl(org.eclipse.swt.widgets.Composite parent)
Deprecated.This method is called to render the control on a parent.- Parameters:
parent
- theComposite
which is the parent- Returns:
- the created
Composite
-
getControlsForTooltip
protected abstract org.eclipse.swt.widgets.Control[] getControlsForTooltip()
Deprecated.Method for retrieving all controls which should have the help text as their tooltip.- Returns:
- the array of the controls to set a tooltip to
-
createContentControl
protected void createContentControl(org.eclipse.swt.widgets.Composite composite)
Deprecated.Helper for creating the unset stacklayout and creating the control's composite.- Parameters:
composite
- the parentComposite
to create the control onto
-
showUnsetLabel
protected void showUnsetLabel()
Deprecated.
-
fillControlComposite
protected abstract void fillControlComposite(org.eclipse.swt.widgets.Composite controlComposite)
Deprecated.This method must be overridden by concrete classes. Here the widget displaying the data is added to the composite.- Parameters:
controlComposite
- theComposite
to add the widget to
-
getCustomUnsetButton
protected org.eclipse.swt.widgets.Button getCustomUnsetButton()
Deprecated.The default unset button will be displayed to the right of the control's composite. Concrete classes may override this method to include an own unset button in their composite rather than using the default positioning.- Returns:
- The custom unset button of the concrete class
-
getModelValue
protected org.eclipse.core.databinding.observable.value.IObservableValue getModelValue()
Deprecated.The model value used for databinding. It is either the set one or the calculated.- Returns:
- the
IObservableValue
-
setObservableValue
public void setObservableValue(org.eclipse.core.databinding.observable.value.IObservableValue modelValue)
Deprecated.Allows the user to set theIObservableValue
to use in the control during databinding.- Parameters:
modelValue
- the setIObservableValue
-
createButtonForAction
protected org.eclipse.swt.widgets.Button createButtonForAction(org.eclipse.jface.action.Action action, org.eclipse.swt.widgets.Composite composite)
Deprecated.A helper method which creates a button for an action on a composite.- Parameters:
action
- the action to create a button forcomposite
- the composite to create the button onto- Returns:
- the created button
-
bindValue
protected abstract org.eclipse.core.databinding.Binding bindValue()
Deprecated.Triggers the control to perform the databinding.- Returns:
- The
Binding
-
getHelpText
protected java.lang.String getHelpText()
Deprecated.Returns the help information.- Returns:
- The help text
-
getValidationIcon
protected org.eclipse.swt.graphics.Image getValidationIcon(int severity)
Deprecated.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
-
getValidationBackgroundColor
protected org.eclipse.swt.graphics.Color getValidationBackgroundColor(int severity)
Deprecated.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
-
getUnsetLabelText
protected abstract java.lang.String getUnsetLabelText()
Deprecated.Returns the string for the unset label.- Returns:
- The unset label text
-
getUnsetButtonTooltip
protected abstract java.lang.String getUnsetButtonTooltip()
Deprecated.Returns the string for the unset button tooltip.- Returns:
- The unset button tooltip
-
getSystemColor
protected final org.eclipse.swt.graphics.Color getSystemColor(int color)
Deprecated.Method for retrieving aColor
based on the predefined SWT id.- Parameters:
color
- the SWT id of the color- Returns:
- the Color or black if the id was incorrect
-
isEditable
@Deprecated protected boolean isEditable()
Deprecated.Whether this control should be editable.- Returns:
- true if the
IItemPropertyDescriptor.canSetProperty(Object)
returns true, false otherwise
-
dispose
public void dispose()
Deprecated.Description copied from class:ECPAbstractControl
Disposes the control. A control which needs specific dispose handling must still call super.dispose.- Overrides:
dispose
in classECPAbstractControl
-
backwardCompatibleHandleValidation
protected void backwardCompatibleHandleValidation()
Deprecated.Helper method to keep the old validation.- Overrides:
backwardCompatibleHandleValidation
in classECPAbstractControl
- Since:
- 1.2
-
-