Class AbstractInformationControlManager
- Direct Known Subclasses:
- AbstractHoverInformationControlManager,- InformationPresenter
IInformationControl. This manager can be
 installed on and removed from a control, referred to as the subject control,
 i.e. the one from which the subject of the information to be shown is
 retrieved. Also a manager can be enabled or disabled. An installed and
 enabled manager can be forced to show information in its information control
 using showInformation. An information control manager uses an
 IInformationControlCloser to define the behavior when a
 presented information control must be closed. The disposal of the subject and
 the information control are internally handled by the information control
 manager and are not the responsibility of the information control closer.- Since:
- 2.0
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classConstitutes entities to enumerate anchors for the layout of the information control.static interfaceInterface of an information control closer.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final AbstractInformationControlManager.AnchorAnchor representing the bottom of the information areastatic final AbstractInformationControlManager.AnchorAnchor representing the middle of the subject controlstatic final AbstractInformationControlManager.AnchorAnchor representing the left side of the information areastatic final AbstractInformationControlManager.AnchorAnchor representing the right side of the information areastatic final AbstractInformationControlManager.AnchorAnchor representing the top of the information areaprotected static final booleanTells whether this class and its subclasses are in debug mode.protected booleanIndicates that the information control has been disposed.protected IInformationControlThe information control.The information control closer.protected IInformationControlCreatorThe information control creator.static final StringDialog store constant for the location's x-coordinate.static final StringDialog store constant for the location's y-coordinate.static final StringDialog store constant for the size's height.static final StringDialog store constant for the size's width.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCreates a new information control manager using the given information control creator.
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanTells whether internal data can be cleared on hide.protected RectanglecomputeAvailableArea(Rectangle subjectArea, Rectangle bounds, AbstractInformationControlManager.Anchor anchor) Computes the area available for an information control given an anchor and the subject area withinbounds.protected abstract voidComputes the information to be displayed and the area in which the computed information is valid.protected PointcomputeInformationControlLocation(Rectangle subjectArea, Point controlSize) Computes the location of the information control depending on the subject area and the size of the information control.protected PointcomputeLocation(Rectangle subjectArea, Point controlSize, AbstractInformationControlManager.Anchor anchor) Computes the display location of the information control.protected PointcomputeSizeConstraints(Control subjectControl, IInformationControl informationControl) Computes the size constraints of the information control in points based on the default font of the given subject control as well as the size constraints in character width.protected PointcomputeSizeConstraints(Control subjectControl, Rectangle subjectArea, IInformationControl informationControl) Computes the size constraints of the information control in points.voiddispose()Disposes this manager and if necessary all dependent parts such as the information control.voidDisposes this manager's information control.protected voidComputes information to be displayed as well as the subject area and initiates that this information is presented in the information control.protected IInformationControlReturns the information control.org.eclipse.jface.internal.text.InternalAccessorReturns an adapter that gives access to internal methods.protected AbstractInformationControlManager.AnchorReturns the next fallback anchor as specified by this manager's fallback anchor sequence.protected RectangleReturns the actual subject area.protected ControlReturns the subject control of this manager/information control.protected voidHandles the disposal of the information control.protected voidHandles the disposal of the subject control.protected voidHides the information control and stops the information control closer.voidInstalls this manager on the given control.protected booleanReturns whether this manager is enabled or not.protected booleanTells whether the control takes focus when visible.protected voidPresents the information in the information control or hides the information control if no information should be presented.protected RectangleRestores the information control's bounds.voidSets the anchor used for laying out the information control relative to the subject control.protected voidSets the information control closer for this manager.protected voidsetCustomInformationControlCreator(IInformationControlCreator informationControlCreator) Sets the temporary custom control creator, overriding this manager's default information control creator.voidsetEnabled(boolean enabled) Deprecated.visibility will be changed to protectedvoidsetFallbackAnchors(AbstractInformationControlManager.Anchor[] fallbackAnchors) Sets the anchors fallback sequence used to layout the information control if the original anchor can not be used because the information control would not fit in the display client area.protected final voidsetInformation(Object information, Rectangle subjectArea) Sets the parameters of the information to be displayed.protected final voidsetInformation(String information, Rectangle subjectArea) Sets the parameters of the information to be displayed.voidsetMargins(int xMargin, int yMargin) Sets the horizontal and vertical margin to be used when laying out the information control relative to the subject control.voidsetRestoreInformationControlBounds(IDialogSettings dialogSettings, boolean restoreLocation, boolean restoreSize) Tells this information control manager to open the information control with the values contained in the given dialog settings and to store the control's last valid size in the given dialog settings.voidsetSizeConstraints(int widthInChar, int heightInChar, boolean enforceAsMinimalSize, boolean enforceAsMaximalSize) Sets the width- and height constraints of the information control.voidComputes information to be displayed as well as the subject area and initiates that this information is presented in the information control.protected voidshowInformationControl(Rectangle subjectArea) Shows the information control and starts the information control closer.protected voidStores the information control's bounds.voidtakesFocusWhenVisible(boolean takesFocus) Tells the manager whether it should set the focus to the information control when made visible.protected booleanupdateLocation(Point location, Point size, Rectangle displayArea, AbstractInformationControlManager.Anchor anchor) Checks whether a control of the given size at the given location would be completely visible in the given display area when laid out by using the given anchor.
- 
Field Details- 
ANCHOR_TOPAnchor representing the top of the information area
- 
ANCHOR_BOTTOMAnchor representing the bottom of the information area
- 
ANCHOR_LEFTAnchor representing the left side of the information area
- 
ANCHOR_RIGHTAnchor representing the right side of the information area
- 
ANCHOR_GLOBALAnchor representing the middle of the subject control- Since:
- 2.1
 
- 
STORE_LOCATION_XDialog store constant for the location's x-coordinate.- Since:
- 3.0
- See Also:
 
- 
STORE_LOCATION_YDialog store constant for the location's y-coordinate.- Since:
- 3.0
- See Also:
 
- 
STORE_SIZE_WIDTHDialog store constant for the size's width.- Since:
- 3.0
- See Also:
 
- 
STORE_SIZE_HEIGHTDialog store constant for the size's height.- Since:
- 3.0
- See Also:
 
- 
DEBUGprotected static final boolean DEBUGTells whether this class and its subclasses are in debug mode.Subclasses may use this. - Since:
- 3.4
 
- 
fInformationControlThe information control.This field should not be referenced by subclasses. It is protectedfor API compatibility reasons.
- 
fInformationControlCreatorThe information control creator.This field should not be referenced by subclasses. It is protectedfor API compatibility reasons.
- 
fInformationControlCloserThe information control closer.This field should not be referenced by subclasses. It is protectedfor API compatibility reasons.
- 
fDisposedprotected boolean fDisposedIndicates that the information control has been disposed.This field should not be referenced by subclasses. It is protectedfor API compatibility reasons.
 
- 
- 
Constructor Details- 
AbstractInformationControlManagerCreates a new information control manager using the given information control creator. By default the following configuration is given:- enabled == false
- horizontal margin == 5 points
- vertical margin == 5 points
- width constraint == 60 characters
- height constraint == 6 characters
- enforce constraints as minimal size == false
- enforce constraints as maximal size == false
- layout anchor == ANCHOR_BOTTOM
- fall back anchors == { ANCHOR_TOP, ANCHOR_BOTTOM, ANCHOR_LEFT, ANCHOR_RIGHT, ANCHOR_GLOBAL }
- takes focus when visible == false
 - Parameters:
- creator- the information control creator
 
 
- 
- 
Method Details- 
computeInformationprotected abstract void computeInformation()Computes the information to be displayed and the area in which the computed information is valid. Implementation of this method must finish their computation by setting the computation results usingsetInformation.
- 
setInformationSets the parameters of the information to be displayed. These are the information itself and the area for which the given information is valid. This so called subject area is a graphical region of the information control's subject control. This method callspresentInformation()to trigger the presentation of the computed information.- Parameters:
- information- the information, or- nullif none is available
- subjectArea- the subject area, or- nullif none is available
 
- 
setInformationSets the parameters of the information to be displayed. These are the information itself and the area for which the given information is valid. This so called subject area is a graphical region of the information control's subject control. This method callspresentInformation()to trigger the presentation of the computed information.- Parameters:
- information- the information, or- nullif none is available
- subjectArea- the subject area, or- nullif none is available
- Since:
- 2.1
 
- 
setCloserSets the information control closer for this manager.- Parameters:
- closer- the information control closer for this manager
 
- 
setMarginspublic void setMargins(int xMargin, int yMargin) Sets the horizontal and vertical margin to be used when laying out the information control relative to the subject control.- Parameters:
- xMargin- the x-margin
- yMargin- the y-Margin
 
- 
setSizeConstraintspublic void setSizeConstraints(int widthInChar, int heightInChar, boolean enforceAsMinimalSize, boolean enforceAsMaximalSize) Sets the width- and height constraints of the information control.- Parameters:
- widthInChar- the width constraint in number of characters
- heightInChar- the height constrain in number of characters
- enforceAsMinimalSize- indicates whether the constraints describe the minimal allowed size of the control
- enforceAsMaximalSize- indicates whether the constraints describe the maximal allowed size of the control
 
- 
setRestoreInformationControlBoundspublic void setRestoreInformationControlBounds(IDialogSettings dialogSettings, boolean restoreLocation, boolean restoreSize) Tells this information control manager to open the information control with the values contained in the given dialog settings and to store the control's last valid size in the given dialog settings.Note: This API is only valid if the information control implements IInformationControlExtension3. Not following this restriction will later result in anUnsupportedOperationException.The constants used to store the values are: - Parameters:
- dialogSettings- the dialog settings
- restoreLocation-- trueiff the location is must be (re-)stored
- restoreSize-- trueiff the size is (re-)stored
- Since:
- 3.0
 
- 
setAnchorSets the anchor used for laying out the information control relative to the subject control. E.g, usingANCHOR_TOPindicates that the information control is position above the area for which the information to be displayed is valid.- Parameters:
- anchor- the layout anchor
 
- 
setFallbackAnchorsSets the anchors fallback sequence used to layout the information control if the original anchor can not be used because the information control would not fit in the display client area.The fallback anchor for a given anchor is the one that comes directly after the given anchor or is the first one in the sequence if the given anchor is the last one in the sequence. Note: This sequence is ignored if the original anchor is not contained in this list. - Parameters:
- fallbackAnchors- the array with the anchor fallback sequence
- See Also:
 
- 
setCustomInformationControlCreatorprotected void setCustomInformationControlCreator(IInformationControlCreator informationControlCreator) Sets the temporary custom control creator, overriding this manager's default information control creator.- Parameters:
- informationControlCreator- the creator, possibly- null
- Since:
- 3.0
 
- 
takesFocusWhenVisiblepublic void takesFocusWhenVisible(boolean takesFocus) Tells the manager whether it should set the focus to the information control when made visible.- Parameters:
- takesFocus-- trueif information control should take focus when made visible
 
- 
isTakingFocusWhenVisibleprotected boolean isTakingFocusWhenVisible()Tells whether the control takes focus when visible.- Returns:
- trueif the control takes focus when visible,- falseotherwise
- Since:
- 3.7
 
- 
handleSubjectControlDisposedprotected void handleSubjectControlDisposed()Handles the disposal of the subject control. By default, the information control is disposed by callingdisposeInformationControl. Subclasses may extend this method.
- 
installInstalls this manager on the given control. The control is now taking the role of the subject control. This implementation sets the control also as the information control closer's subject control and automatically enables this manager.- Parameters:
- subjectControl- the subject control
 
- 
getSubjectControlReturns the subject control of this manager/information control.- Returns:
- the subject control
 
- 
getSubjectAreaReturns the actual subject area.- Returns:
- the actual subject area
 
- 
setEnabledDeprecated.visibility will be changed to protectedSets the enable state of this manager.- Parameters:
- enabled- the enable state
 
- 
isEnabledprotected boolean isEnabled()Returns whether this manager is enabled or not.- Returns:
- trueif this manager is enabled otherwise- false
 
- 
computeSizeConstraintsprotected Point computeSizeConstraints(Control subjectControl, IInformationControl informationControl) Computes the size constraints of the information control in points based on the default font of the given subject control as well as the size constraints in character width.- Parameters:
- subjectControl- the subject control
- informationControl- the information control whose size constraints are computed
- Returns:
- the computed size constraints in points
 
- 
computeSizeConstraintsprotected Point computeSizeConstraints(Control subjectControl, Rectangle subjectArea, IInformationControl informationControl) Computes the size constraints of the information control in points.- Parameters:
- subjectControl- the subject control
- subjectArea- the subject area
- informationControl- the information control whose size constraints are computed
- Returns:
- the computed size constraints in points
- Since:
- 3.0
 
- 
handleInformationControlDisposedprotected void handleInformationControlDisposed()Handles the disposal of the information control. By default, the information control closer is stopped.
- 
getInformationControlReturns the information control. If the information control has not been created yet, it is automatically created.- Returns:
- the information control
 
- 
computeLocationprotected Point computeLocation(Rectangle subjectArea, Point controlSize, AbstractInformationControlManager.Anchor anchor) Computes the display location of the information control. The location is computed considering the given subject area, the anchor at the subject area, and the size of the information control. This method does not care about whether the information control would be completely visible when placed at the result location.- Parameters:
- subjectArea- the subject area
- controlSize- the size of the information control
- anchor- the anchor at the subject area
- Returns:
- the display location of the information control
 
- 
computeAvailableAreaprotected Rectangle computeAvailableArea(Rectangle subjectArea, Rectangle bounds, AbstractInformationControlManager.Anchor anchor) Computes the area available for an information control given an anchor and the subject area withinbounds.- Parameters:
- subjectArea- the subject area
- bounds- the bounds
- anchor- the anchor at the subject area
- Returns:
- the area available at the given anchor relative to the subject area, confined to the monitor's client area
- Since:
- 3.3
 
- 
updateLocationprotected boolean updateLocation(Point location, Point size, Rectangle displayArea, AbstractInformationControlManager.Anchor anchor) Checks whether a control of the given size at the given location would be completely visible in the given display area when laid out by using the given anchor. If not, this method tries to shift the control orthogonal to the direction given by the anchor to make it visible. If possible it updates the location.This method returns trueif the potentially updated position results in a completely visible control, orfalseotherwise.- Parameters:
- location- the location of the control
- size- the size of the control
- displayArea- the display area in which the control should be visible
- anchor- anchor for lying out the control
- Returns:
- trueif the updated location is useful
 
- 
getNextFallbackAnchorprotected AbstractInformationControlManager.Anchor getNextFallbackAnchor(AbstractInformationControlManager.Anchor anchor) Returns the next fallback anchor as specified by this manager's fallback anchor sequence.The fallback anchor for the given anchor is the one that comes directly after the given anchor or is the first one in the sequence if the given anchor is the last one in the sequence. Note: It is the callers responsibility to prevent an endless loop i.e. to test whether a given anchor has already been used once. then - Parameters:
- anchor- the current anchor
- Returns:
- the next fallback anchor or nullif no fallback anchor is available
 
- 
computeInformationControlLocationComputes the location of the information control depending on the subject area and the size of the information control. This method attempts to find a location at which the information control lies completely in the display's client area while honoring the manager's default anchor. If this isn't possible using the default anchor, the fallback anchors are tried out.- Parameters:
- subjectArea- the information area
- controlSize- the size of the information control
- Returns:
- the computed location of the information control
 
- 
showInformationpublic void showInformation()Computes information to be displayed as well as the subject area and initiates that this information is presented in the information control. This happens only if this controller is enabled.
- 
doShowInformationprotected void doShowInformation()Computes information to be displayed as well as the subject area and initiates that this information is presented in the information control.
- 
presentInformationprotected void presentInformation()Presents the information in the information control or hides the information control if no information should be presented. The information has previously been set usingsetInformation.This method should only be called from overriding methods or from setInformation.
- 
hideInformationControlprotected void hideInformationControl()Hides the information control and stops the information control closer.
- 
canClearDataOnHideprotected boolean canClearDataOnHide()Tells whether internal data can be cleared on hide.- Returns:
- trueif data can be cleared on hide
- Since:
- 3.6
- See Also:
 
- 
showInformationControlShows the information control and starts the information control closer. This method may not be called by clients.- Parameters:
- subjectArea- the information area
 
- 
disposeInformationControlpublic void disposeInformationControl()Disposes this manager's information control.
- 
disposepublic void dispose()Disposes this manager and if necessary all dependent parts such as the information control. For symmetry it first disables this manager.
- 
storeInformationControlBoundsprotected void storeInformationControlBounds()Stores the information control's bounds.- Since:
- 3.0
 
- 
restoreInformationControlBoundsRestores the information control's bounds.- Returns:
- the stored bounds
- Since:
- 3.0
 
- 
getInternalAccessorpublic org.eclipse.jface.internal.text.InternalAccessor getInternalAccessor()Returns an adapter that gives access to internal methods.Note: This method is not intended to be referenced or overridden by clients. - Returns:
- the replaceable information control accessor
- Since:
- 3.4
- Restriction:
- This method is not intended to be referenced by clients.
- Restriction:
- This method is not intended to be re-implemented or extended by clients.
 
 
-