public class ControlDecorationProvider extends Object
ControlDecoration
to the editor controls of a
ICellEditor
. It is currently only used by the TextCellEditor
.
The default location for the ControlDecoration
is the top right of the editor.
If the editor is located such that the ControlDecoration
would not be visible here
(i.e. cell is at/extends beyond the right edge of the NatTable) then the decoration is placed
at the top left of the editor.
The location can be overridden, in which case the above behaviour does not get used.
Constructor and Description |
---|
ControlDecorationProvider()
Create a default
ControlDecorationProvider for handling
error decorations. |
ControlDecorationProvider(String fieldDecorationId) |
Modifier and Type | Method and Description |
---|---|
void |
createErrorDecorationIfRequired(org.eclipse.swt.widgets.Control controlToDecorate)
If showing an error decoration is enabled, this method will create and add a
ControlDecoration
for the given Control by using the configured information. |
void |
dispose()
Ensure to hide the decoration and dispose any resources related to the
ControlDecoration |
void |
hideDecoration()
Will hide the control decoration.
|
void |
setDecorationPositionOverride(int decorationPositionOverride)
Set the position configuration where the decoration should be rendered relative to the control
that should be decorated.
|
void |
setErrorDecorationEnabled(boolean enabled)
Enables/disables the error decoration.
|
void |
setErrorDecorationText(String errorText) |
void |
showDecoration()
Will show the control decoration.
|
void |
showErrorDecorationHover(String errorText)
Will show the control decoration adding the given text as description text.
|
public ControlDecorationProvider()
ControlDecorationProvider
for handling
error decorations.public ControlDecorationProvider(String fieldDecorationId)
fieldDecorationId
- The field decoration to use by this provider.FieldDecorationRegistry
public void setErrorDecorationEnabled(boolean enabled)
enabled
- true
if a decoration should be added, false
if not.public void setErrorDecorationText(String errorText)
errorText
- the text to be shown as a description for the decoration, or
null
if none has been set.ControlDecoration.setDescriptionText(String)
public void showErrorDecorationHover(String errorText)
errorText
- the text to be shown in the info hover, or null
if no text should be shown.ControlDecoration.show()
,
ControlDecoration.showHoverText(String)
public void setDecorationPositionOverride(int decorationPositionOverride)
decorationPositionOverride
- bit-wise or of position constants (SWT.TOP
,
SWT.BOTTOM
, SWT.LEFT
,
SWT.RIGHT
, and SWT.CENTER
).public void showDecoration()
ControlDecoration.show()
public void hideDecoration()
ControlDecoration.hide()
public void dispose()
ControlDecoration
public void createErrorDecorationIfRequired(org.eclipse.swt.widgets.Control controlToDecorate)
ControlDecoration
for the given Control
by using the configured information.controlToDecorate
- The Control
to create the decoration for.Copyright © 2013. All Rights Reserved.