public class InformationPresenter extends AbstractInformationControlManager implements IInformationPresenter, IInformationPresenterExtension, IWidgetTokenKeeper, IWidgetTokenKeeperExtension
IInformationPresenter.
This implementation extends AbstractInformationControlManager.
The information control is made visible on request by calling
showInformationControl(Rectangle).
Usually, clients instantiate this class and configure it before using it. The configuration
must be consistent: This means the used IInformationControlCreator
must create an information control expecting information in the same format the configured
IInformationProviders use to encode the information they provide.
AbstractInformationControlManager.Anchor, AbstractInformationControlManager.IInformationControlCloser| Modifier and Type | Field and Description |
|---|---|
static int |
WIDGET_PRIORITY
Priority of the info controls managed by this information presenter.
|
ANCHOR_BOTTOM, ANCHOR_GLOBAL, ANCHOR_LEFT, ANCHOR_RIGHT, ANCHOR_TOP, fDisposed, fInformationControl, fInformationControlCloser, fInformationControlCreator, STORE_LOCATION_X, STORE_LOCATION_Y, STORE_SIZE_HEIGHT, STORE_SIZE_WIDTH| Constructor and Description |
|---|
InformationPresenter(IInformationControlCreator creator)
Creates a new information presenter that uses the given information control creator.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
computeInformation()
Computes the information to be displayed and the area in which the computed
information is valid.
|
String |
getDocumentPartitioning()
Returns the document partitioning this information presenter is using.
|
IInformationProvider |
getInformationProvider(String contentType)
Returns the information provider to be used for the given content type.
|
protected void |
handleInformationControlDisposed()
Handles the disposal of the information control.
|
protected void |
hideInformationControl()
Hides the information control and stops the information control closer.
|
void |
install(ITextViewer textViewer)
Installs the information presenter on the given text viewer.
|
boolean |
requestWidgetToken(IWidgetTokenOwner owner)
The given widget token owner requests the widget token from this token
keeper.
|
boolean |
requestWidgetToken(IWidgetTokenOwner owner,
int priority)
The given widget token owner requests the widget token from
this token keeper.
|
void |
setDocumentPartitioning(String partitioning)
Sets the document partitioning to be used by this information presenter.
|
boolean |
setFocus(IWidgetTokenOwner owner)
Requests the receiver to give focus to its popup shell, hover, or similar.
|
void |
setInformationProvider(IInformationProvider provider,
String contentType)
Registers a given information provider for a particular content type.
|
void |
setOffset(int offset)
Sets a offset to override the selection.
|
protected void |
showInformationControl(Rectangle subjectArea)
Shows the information control and starts the information control closer.
|
void |
uninstall()
Removes the information presenter from the text viewer it has previously been
installed on.
|
computeInformationControlLocation, computeLocation, computeSizeConstraints, computeSizeConstraints, dispose, disposeInformationControl, doShowInformation, getInformationControl, getNextFallbackAnchor, getSubjectArea, getSubjectControl, handleSubjectControlDisposed, install, isEnabled, presentInformation, restoreInformationControlBounds, setAnchor, setCloser, setCustomInformationControlCreator, setEnabled, setFallbackAnchors, setInformation, setInformation, setMargins, setRestoreInformationControlBounds, setSizeConstraints, showInformation, storeInformationControlBounds, takesFocusWhenVisible, updateLocationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitshowInformationpublic static final int WIDGET_PRIORITY
5.public InformationPresenter(IInformationControlCreator creator)
IDocumentExtension3.DEFAULT_PARTITIONING is used.creator - the information control creator to be usedpublic void setDocumentPartitioning(String partitioning)
partitioning - the document partitioning to be used by this information presenterpublic String getDocumentPartitioning()
IInformationPresenterExtensiongetDocumentPartitioning in interface IInformationPresenterExtensionpublic void setInformationProvider(IInformationProvider provider, String contentType)
provider - the information provider to register, or null to remove an existing onecontentType - the content type under which to registerpublic IInformationProvider getInformationProvider(String contentType)
IInformationPresentergetInformationProvider in interface IInformationPresentercontentType - the type of the content for which information will be requestednull if none exists for the specified content typepublic void setOffset(int offset)
-1 will disable
overriding.offset - the offset to override selection or -1protected void computeInformation()
AbstractInformationControlManagersetInformation.computeInformation in class AbstractInformationControlManagerpublic void install(ITextViewer textViewer)
IInformationPresenterIInformationPresenter.showInformation()
can be called until IInformationPresenter.uninstall() is called.install in interface IInformationPresentertextViewer - the viewer on which the presenter is installedpublic void uninstall()
IInformationPresenteruninstall in interface IInformationPresenterprotected void showInformationControl(Rectangle subjectArea)
AbstractInformationControlManagershowInformationControl in class AbstractInformationControlManagersubjectArea - the information areaprotected void hideInformationControl()
AbstractInformationControlManagerhideInformationControl in class AbstractInformationControlManagerprotected void handleInformationControlDisposed()
AbstractInformationControlManagerhandleInformationControlDisposed in class AbstractInformationControlManagerpublic boolean requestWidgetToken(IWidgetTokenOwner owner)
IWidgetTokenKeepertrue if the token is released by this
token keeper. Note, the keeper must not call
releaseWidgetToken(IWidgetTokenKeeper) explicitly.
Replaced by
IWidgetTokenKeeperExtension.requestWidgetToken(IWidgetTokenOwner, int).
requestWidgetToken in interface IWidgetTokenKeeperowner - the token ownertrue if token has been released false
otherwisepublic boolean requestWidgetToken(IWidgetTokenOwner owner, int priority)
IWidgetTokenKeeperExtensiontrue if the token is released
by this token keeper. Note, the keeper must not call
releaseWidgetToken(IWidgetTokenKeeper) explicitly.
The general contract is that the receiver should release the token
if priority exceeds the receiver's priority.
requestWidgetToken in interface IWidgetTokenKeeperExtensionowner - the token ownerpriority - the priority of the requesttrue if token has been released false otherwisepublic boolean setFocus(IWidgetTokenOwner owner)
IWidgetTokenKeeperExtensionsetFocus in interface IWidgetTokenKeeperExtensionowner - the token ownertrue if the receiver tried to take focus, false if it did not.Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.