ControlDecoration
instead.@Deprecated public class DecoratedField extends Object
IControlCreator
to create the control that is decorated.
Decorations always appear on either horizontal side of the field, never above or below it. Decorations can be positioned at the top or bottom of either side. Future implementations may provide additional positioning options for decorations.
By default, DecoratedField will consult the FieldDecorationRegistry
to determine how much space should be reserved for each decoration. This
allows fields with decorations from different sources to align properly on
the same dialog, since the registry tracks the size of all decorations
registered. Therefore, it is recommended, but not required, that clients of
DecoratedField register the decorations used. In cases where alignment
between different fields is not a concern, clients can use
setUseMaximumDecorationWidth(false)
and need not register
their decorations.
This class is not intended to be subclassed.
Constructor and Description |
---|
DecoratedField(Composite parent,
int style,
IControlCreator controlCreator)
Deprecated.
Construct a decorated field which is parented by the specified composite
and has the given style bits.
|
Modifier and Type | Method and Description |
---|---|
void |
addFieldDecoration(FieldDecoration decoration,
int position,
boolean showOnFocus)
Deprecated.
Adds an image decoration to the field.
|
Control |
getControl()
Deprecated.
Get the control that is decorated by the receiver.
|
Control |
getLayoutControl()
Deprecated.
Get the control that represents the decorated field.
|
void |
hideDecoration(FieldDecoration decoration)
Deprecated.
Hide the specified decoration.
|
void |
hideHover()
Deprecated.
Hide any hover popups that are currently showing on the control.
|
void |
setUseMaximumDecorationWidth(boolean useMaximumWidth)
Deprecated.
Set a boolean that indicates whether the receiver should use the
decoration registry's maximum decoration width when allocating space for
decorations.
|
void |
showDecoration(FieldDecoration decoration)
Deprecated.
Show the specified decoration.
|
void |
showHoverText(String text)
Deprecated.
Show the specified text using the same hover dialog as is used to show
decorator descriptions.
|
void |
updateDecoration(FieldDecoration decoration)
Deprecated.
Update the specified decoration.
|
public DecoratedField(Composite parent, int style, IControlCreator controlCreator)
parent
- the parent of the decorated field.style
- the desired style bits for the field.controlCreator
- the IControlCreator used to specify the specific kind of
control that is to be decorated.IControlCreator
public void addFieldDecoration(FieldDecoration decoration, int position, boolean showOnFocus)
decoration
- A FieldDecoration describing the image and description for the
decorationposition
- The SWT constant indicating the position of the decoration
relative to the field's control. The position should include
style bits describing both the vertical and horizontal
orientation. SWT.LEFT
and
SWT.RIGHT
describe the horizontal placement of
the decoration relative to the field, and the constants
SWT.TOP
and SWT.BOTTOM
describe
the vertical alignment of the decoration relative to the
field. Decorations always appear on either horizontal side of
the field, never above or below it. For example, a decoration
appearing on the left side of the field, at the top, is
specified as SWT.LEFT | SWT.TOP. If an image decoration
already exists in the specified position, it will be replaced
by the one specified.showOnFocus
- true
if the decoration should only be shown
when the associated control has focus, false
if
it should always be shown.public Control getControl()
null
if
none has been created yet.public Control getLayoutControl()
public void showHoverText(String text)
If there is currently a hover visible, the hover's text will be replaced with the specified text.
text
- the text to be shown in the info hover, or null
if no text should be shown.public void hideHover()
showHoverText
,
or to programatically hide the current decoration hover.
This message has no effect if there is no current hover.
public void showDecoration(FieldDecoration decoration)
addFieldDecoration
.decoration
- the decoration to be shown.public void hideDecoration(FieldDecoration decoration)
addFieldDecoration
.decoration
- the decoration to be hidden.public void updateDecoration(FieldDecoration decoration)
decoration
- the decoration to be hidden.public void setUseMaximumDecorationWidth(boolean useMaximumWidth)
true
. Using the maximum
decoration width is useful so that decorated fields on the same dialog
that have different decoration widths will all align. This also allows
client dialogs to align non-decorated fields with decorated fields by
consulting the maximum decoration width.
Clients may wish to set this value to false
in cases where
space usage is more important than alignment of fields. This value must
be set before the decorations are added in order to ensure proper
alignment.
useMaximumWidth
- true
if the maximum decoration width should be
used as the size for all decorations, false
if
only the decoration size should be used.FieldDecorationRegistry.getMaximumDecorationWidth()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.