Interface IInformationControl
- All Known Implementing Classes:
- AbstractInformationControl,- DefaultInformationControl
 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:
 
- IInformationControlExtensionsince version 2.0 introducing the predicate of whether the control has anything to show or would be empty
- IInformationControlExtension2since version 2.1 replacing the original concept of textual input by general input objects.
- IInformationControlExtension3since version 3.0 providing access to the control's bounds and introducing the concept of persistent size and location.
- IInformationControlExtension4since version 3.3, adding API which allows to set this information control's status field text.
- IInformationControlExtension5since 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.
- Since:
- 2.0
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddDisposeListener(DisposeListener listener) Adds the given listener to the list of dispose listeners.voidaddFocusListener(FocusListener listener) Adds the given listener to the list of focus listeners.Computes and returns a proposal for the size of this information control depending on the information to present.voiddispose()Disposes this information control.booleanReturns whether this information control (or one of its children) has the focus.voidremoveDisposeListener(DisposeListener listener) Removes the given listeners from the list of dispose listeners.voidremoveFocusListener(FocusListener listener) Removes the given listeners from the list of focus listeners.voidsetBackgroundColor(Color background) Sets the background color of this information control.voidsetFocus()Sets the keyboard focus to this information control.voidsetForegroundColor(Color foreground) Sets the foreground color of this information control.voidsetInformation(String information) Sets the information to be presented by this information control.voidsetLocation(Point location) Sets the location of this information control.voidsetSize(int width, int height) Sets the size of this information control.voidsetSizeConstraints(int maxWidth, int maxHeight) Sets the information control's size constraints.voidsetVisible(boolean visible) Controls the visibility of this information control.
- 
Method Details- 
setInformationSets the information to be presented by this information control.Replaced by IInformationControlExtension2.setInput(Object).- Parameters:
- information- the information to be presented
 
- 
setSizeConstraintsvoid setSizeConstraints(int maxWidth, int maxHeight) Sets the information control's size constraints. A constraint value ofSWT.DEFAULTindicates no constraint. This method must be called beforecomputeSizeHint()is called.Note: An information control which implements IInformationControlExtension3may ignore this method or use it as hint for its very first appearance.- Parameters:
- maxWidth- the maximal width of the control to present the information, or- SWT.DEFAULTfor not constraint
- maxHeight- the maximal height of the control to present the information, or- SWT.DEFAULTfor not constraint
 
- 
computeSizeHintPoint computeSizeHint()Computes and returns a proposal for the size of this information control depending on the information to present. The method tries to honor known size constraints but might return a size that exceeds them.- Returns:
- the computed size hint
 
- 
setVisiblevoid setVisible(boolean visible) Controls the visibility of this information control.Note: The information control must not grab focus when made visible. - Parameters:
- visible-- trueif the control should be visible
 
- 
setSizevoid setSize(int width, int height) Sets the size of this information control.- Parameters:
- width- the width of the control
- height- the height of the control
 
- 
setLocationSets the location of this information control.- Parameters:
- location- the location
 
- 
disposevoid dispose()Disposes this information control.
- 
addDisposeListenerAdds the given listener to the list of dispose listeners. If the listener is already registered it is not registered again.- Parameters:
- listener- the listener to be added
 
- 
removeDisposeListenerRemoves the given listeners from the list of dispose listeners. If the listener is not registered this call has no effect.- Parameters:
- listener- the listener to be removed
 
- 
setForegroundColorSets the foreground color of this information control.- Parameters:
- foreground- the foreground color of this information control
 
- 
setBackgroundColorSets the background color of this information control.- Parameters:
- background- the background color of this information control
 
- 
isFocusControlboolean isFocusControl()Returns whether this information control (or one of its children) has the focus. The suggested implementation is like this (fShellis this information control's shell):return fShell.getDisplay().getActiveShell() == fShell Note that implementations of IInformationControlExtension5are required to use this suggested implementation.- Returns:
- truewhen the information control has the focus, otherwise- false
 
- 
setFocusvoid setFocus()Sets the keyboard focus to this information control.
- 
addFocusListenerAdds the given listener to the list of focus listeners. If the listener is already registered it is not registered again.The suggested implementation is to install listeners for SWT.ActivateandSWT.Deactivateon the shell and forward events to the focus listeners. Clients are encouraged to subclassAbstractInformationControl, which does this for free.- Parameters:
- listener- the listener to be added
 
- 
removeFocusListenerRemoves the given listeners from the list of focus listeners. If the listener is not registered this call has no effect.- Parameters:
- listener- the listener to be removed
 
 
-