public interface IInformationControl
If this information control is used by a AbstractHoverInformationControlManager
then that manager will own this control and override any properties that
may have been set before by any other client.
The information control must not grab focus when made visible using
setVisible(true)
.
In order to provide backward compatibility for clients of
IInformationControl
, extension interfaces are used as a means
of evolution. The following extension interfaces exist:
IInformationControlExtension
since
version 2.0 introducing the predicate of whether the control has anything to
show or would be emptyIInformationControlExtension2
since
version 2.1 replacing the original concept of textual input by general input
objects.IInformationControlExtension3
since
version 3.0 providing access to the control's bounds and introducing
the concept of persistent size and location.IInformationControlExtension4
since
version 3.3, adding API which allows to set this information control's status field text.IInformationControlExtension5
since
version 3.4, adding API to get the visibility of the control, to
test whether another control is a child of the information control,
to compute size constraints based on the information control's main font
and to return a control creator for an enriched version of this information control.
Clients can implement this interface and its extension interfaces,
subclass AbstractInformationControl
, or use the (text-based)
default implementation DefaultInformationControl
.
Modifier and Type | Method and Description |
---|---|
void |
addDisposeListener(DisposeListener listener)
Adds the given listener to the list of dispose listeners.
|
void |
addFocusListener(FocusListener listener)
Adds the given listener to the list of focus listeners.
|
Point |
computeSizeHint()
Computes and returns a proposal for the size of this information control depending
on the information to present.
|
void |
dispose()
Disposes this information control.
|
boolean |
isFocusControl()
Returns whether this information control (or one of its children) has the focus.
|
void |
removeDisposeListener(DisposeListener listener)
Removes the given listeners from the list of dispose listeners.
|
void |
removeFocusListener(FocusListener listener)
Removes the given listeners from the list of focus listeners.
|
void |
setBackgroundColor(Color background)
Sets the background color of this information control.
|
void |
setFocus()
Sets the keyboard focus to this information control.
|
void |
setForegroundColor(Color foreground)
Sets the foreground color of this information control.
|
void |
setInformation(String information)
Sets the information to be presented by this information control.
|
void |
setLocation(Point location)
Sets the location of this information control.
|
void |
setSize(int width,
int height)
Sets the size of this information control.
|
void |
setSizeConstraints(int maxWidth,
int maxHeight)
Sets the information control's size constraints.
|
void |
setVisible(boolean visible)
Controls the visibility of this information control.
|
void setInformation(String information)
Replaced by IInformationControlExtension2.setInput(Object)
.
information
- the information to be presentedvoid setSizeConstraints(int maxWidth, int maxHeight)
SWT.DEFAULT
indicates no constraint. This method must be called before
computeSizeHint()
is called.
Note: An information control which implements IInformationControlExtension3
may ignore this method or use it as hint for its very first appearance.
maxWidth
- the maximal width of the control to present the information, or SWT.DEFAULT
for not constraintmaxHeight
- the maximal height of the control to present the information, or SWT.DEFAULT
for not constraintPoint computeSizeHint()
void setVisible(boolean visible)
Note: The information control must not grab focus when made visible.
visible
- true
if the control should be visiblevoid setSize(int width, int height)
width
- the width of the controlheight
- the height of the controlvoid setLocation(Point location)
location
- the locationvoid dispose()
void addDisposeListener(DisposeListener listener)
listener
- the listener to be addedvoid removeDisposeListener(DisposeListener listener)
listener
- the listener to be removedvoid setForegroundColor(Color foreground)
foreground
- the foreground color of this information controlvoid setBackgroundColor(Color background)
background
- the background color of this information controlboolean isFocusControl()
fShell
is this information control's shell):
return fShell.getDisplay().getActiveShell() == fShell
true
when the information control has the focus, otherwise false
void setFocus()
void addFocusListener(FocusListener listener)
The suggested implementation is to install listeners for SWT.Activate
and SWT.Deactivate
on the shell and forward events to the focus listeners. Clients are
encouraged to subclass AbstractInformationControl
, which does this
for free.
listener
- the listener to be addedvoid removeFocusListener(FocusListener listener)
listener
- the listener to be removed
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.