- Direct Known Subclasses:
IControlCreatorto 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
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
This class is not intended to be subclassed.
Method SummaryModifier and TypeMethodDescription
voidDeprecated.Adds an image decoration to the field.Deprecated.Get the control that is decorated by the receiver.Deprecated.Get the control that represents the decorated field.
voidDeprecated.Hide the specified decoration.
voidDeprecated.Hide any hover popups that are currently showing on the control.
(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.
voidDeprecated.Show the specified decoration.
voidDeprecated.Show the specified text using the same hover dialog as is used to show decorator descriptions.
voidDeprecated.Update the specified decoration.
DecoratedFieldDeprecated.Construct a decorated field which is parented by the specified composite and has the given style bits. Use the controlCreator to create the specific kind of control that is decorated inside the field.
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.
- See Also:
addFieldDecorationpublic void addFieldDecoration
(FieldDecoration decoration, int position, boolean showOnFocus)Deprecated.Adds an image decoration to the field.
decoration- A FieldDecoration describing the image and description for the decoration
position- 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.RIGHTdescribe the horizontal placement of the decoration relative to the field, and the constants
SWT.BOTTOMdescribe 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.
trueif the decoration should only be shown when the associated control has focus,
falseif it should always be shown.
getControlpublic Control getControl()Deprecated.Get the control that is decorated by the receiver.
- the Control decorated by the receiver, or
nullif none has been created yet.
getLayoutControlpublic Control getLayoutControl()Deprecated.Get the control that represents the decorated field. This composite should be used to lay out the field within its parent.
- the Control that should be layed out in the field's parent's layout. This is typically not the control itself, since additional controls are used to represent the decorations.
showHoverTextpublic void showHoverText
(String text)Deprecated.Show the specified text using the same hover dialog as is used to show decorator descriptions. Normally, a decoration's description text will be shown in an info hover over the field's control whenever the mouse hovers over the decoration. This method can be used to show a decoration's description text at other times (such as when the control receives focus), or to show other text associated with the field.
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
nullif no text should be shown.
hideHoverpublic void hideHover()Deprecated.Hide any hover popups that are currently showing on the control. Normally, a decoration's description text will be shown in an info hover over the field's control as long as the mouse hovers over the decoration, and will be hidden when the mouse exits the control. This method can be used to hide a hover that was shown using
showHoverText, or to programatically hide the current decoration hover.
This message has no effect if there is no current hover.
showDecorationpublic void showDecoration
(FieldDecoration decoration)Deprecated.Show the specified decoration. This message has no effect if the decoration is already showing, or was not already added to the field using
decoration- the decoration to be shown.
hideDecorationpublic void hideDecoration
(FieldDecoration decoration)Deprecated.Hide the specified decoration. This message has no effect if the decoration is already hidden, or was not already added to the field using
decoration- the decoration to be hidden.
updateDecorationpublic void updateDecoration
(FieldDecoration decoration)Deprecated.Update the specified decoration. This message should be used if the image or description in the decoration have changed. This message has no immediate effect if the decoration is not visible, and no effect at all if the decoration was not previously added to the field.
decoration- the decoration to be hidden.
setUseMaximumDecorationWidthpublic 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. The default value is
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
falsein 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.
trueif the maximum decoration width should be used as the size for all decorations,
falseif only the decoration size should be used.
- See Also: