Package org.eclipse.jface.text.hyperlink
Class DefaultHyperlinkPresenter
java.lang.Object
org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter
- All Implemented Interfaces:
- EventListener,- IHyperlinkPresenter,- IHyperlinkPresenterExtension,- IDocumentListener,- ITextInputListener,- ITextPresentationListener,- ITextViewerLifecycle,- IPropertyChangeListener
- Direct Known Subclasses:
- MultipleHyperlinkPresenter
public class DefaultHyperlinkPresenter
extends Object
implements IHyperlinkPresenter, IHyperlinkPresenterExtension, ITextPresentationListener, ITextInputListener, IDocumentListener, IPropertyChangeListener
The default hyperlink presenter underlines the
 link and colors the line and the text with
 the given color.
 
 It can only be used together with the HyperlinkManager.FIRST
 or the HyperlinkManager.LONGEST_REGION_FIRST hyperlink strategy.
 
- Since:
- 3.1
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new default hyperlink presenter which usesHYPERLINK_COLORto read the color from the given preference store.DefaultHyperlinkPresenter(Color color) Creates a new default hyperlink presenter.DefaultHyperlinkPresenter(RGB color) Creates a new default hyperlink presenter.
- 
Method SummaryModifier and TypeMethodDescriptionvoidapplyTextPresentation(TextPresentation textPresentation) This method is called when a text presentation is about to be applied to the text viewer.booleanTells whether the currently shown hyperlinks can be hidden.booleanTells whether this presenter is able to handle more than one hyperlink.voidThe manipulation described by the document event will be performed.voiddocumentChanged(DocumentEvent event) The manipulation described by the document event has been performed.voidTells this hyperlink presenter to hide the hyperlinks requested to be shown byIHyperlinkPresenter.showHyperlinks(IHyperlink[]).voidinputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) Called before the input document is replaced.voidinputDocumentChanged(IDocument oldInput, IDocument newInput) Called after the input document has been replaced.voidinstall(ITextViewer textViewer) Installs this hyperlink presenter on the given text viewer.voidNotification that a property has changed.voidSets the hyperlink foreground color.voidshowHyperlinks(IHyperlink[] hyperlinks) Tells this hyperlink presenter to show the given hyperlinks on the installed text viewer.voidUninstalls this hyperlink presenter.
- 
Field Details- 
HYPERLINK_COLORA named preference that holds the color used for hyperlinks.Value is of type String. A RGB color value encoded as a string using classPreferenceConverter.- See Also:
 
- 
HYPERLINK_COLOR_SYSTEM_DEFAULTA named preference that holds the preference whether to use the native link color.The preference value is of type Boolean.- Since:
- 3.5
- See Also:
 
 
- 
- 
Constructor Details- 
DefaultHyperlinkPresenterCreates a new default hyperlink presenter which usesHYPERLINK_COLORto read the color from the given preference store.- Parameters:
- store- the preference store
 
- 
DefaultHyperlinkPresenterCreates a new default hyperlink presenter.- Parameters:
- color- the hyperlink color or- nullif the existing text color should be preserved; to be disposed by the caller
 
- 
DefaultHyperlinkPresenterCreates a new default hyperlink presenter.- Parameters:
- color- the hyperlink color or- nullif the existing text color should be preserved
 
 
- 
- 
Method Details- 
canShowMultipleHyperlinkspublic boolean canShowMultipleHyperlinks()Description copied from interface:IHyperlinkPresenterTells whether this presenter is able to handle more than one hyperlink.- Specified by:
- canShowMultipleHyperlinksin interface- IHyperlinkPresenter
- Returns:
- trueif this presenter can handle more than one hyperlink
 
- 
showHyperlinksDescription copied from interface:IHyperlinkPresenterTells this hyperlink presenter to show the given hyperlinks on the installed text viewer.- Specified by:
- showHyperlinksin interface- IHyperlinkPresenter
- Parameters:
- hyperlinks- the hyperlinks to show
 
- 
canHideHyperlinkspublic boolean canHideHyperlinks()Tells whether the currently shown hyperlinks can be hidden.- Specified by:
- canHideHyperlinksin interface- IHyperlinkPresenterExtension
- Returns:
- trueif the hyperlink manager can hide the current hyperlinks
- Since:
- 3.4
 
- 
hideHyperlinkspublic void hideHyperlinks()Description copied from interface:IHyperlinkPresenterTells this hyperlink presenter to hide the hyperlinks requested to be shown byIHyperlinkPresenter.showHyperlinks(IHyperlink[]).- Specified by:
- hideHyperlinksin interface- IHyperlinkPresenter
 
- 
installDescription copied from interface:IHyperlinkPresenterInstalls this hyperlink presenter on the given text viewer.- Specified by:
- installin interface- IHyperlinkPresenter
- Specified by:
- installin interface- ITextViewerLifecycle
- Parameters:
- textViewer- the text viewer
 
- 
uninstallpublic void uninstall()Description copied from interface:IHyperlinkPresenterUninstalls this hyperlink presenter.- Specified by:
- uninstallin interface- IHyperlinkPresenter
- Specified by:
- uninstallin interface- ITextViewerLifecycle
 
- 
setColorSets the hyperlink foreground color.- Parameters:
- color- the hyperlink foreground color or- nullif the existing text color should be preserved
 
- 
applyTextPresentationDescription copied from interface:ITextPresentationListenerThis method is called when a text presentation is about to be applied to the text viewer. The receiver is allowed to change the text presentation during that call.- Specified by:
- applyTextPresentationin interface- ITextPresentationListener
- Parameters:
- textPresentation- the current text presentation
 
- 
documentAboutToBeChangedDescription copied from interface:IDocumentListenerThe manipulation described by the document event will be performed.- Specified by:
- documentAboutToBeChangedin interface- IDocumentListener
- Parameters:
- event- the document event describing the document change
 
- 
documentChangedDescription copied from interface:IDocumentListenerThe manipulation described by the document event has been performed.- Specified by:
- documentChangedin interface- IDocumentListener
- Parameters:
- event- the document event describing the document change
 
- 
inputDocumentAboutToBeChangedDescription copied from interface:ITextInputListenerCalled before the input document is replaced.- Specified by:
- inputDocumentAboutToBeChangedin interface- ITextInputListener
- Parameters:
- oldInput- the text viewer's previous input document
- newInput- the text viewer's new input document
 
- 
inputDocumentChangedDescription copied from interface:ITextInputListenerCalled after the input document has been replaced.- Specified by:
- inputDocumentChangedin interface- ITextInputListener
- Parameters:
- oldInput- the text viewer's previous input document
- newInput- the text viewer's new input document
 
- 
propertyChangeDescription copied from interface:IPropertyChangeListenerNotification that a property has changed.This method gets called when the observed object fires a property change event. - Specified by:
- propertyChangein interface- IPropertyChangeListener
- Parameters:
- event- the property change event object describing which property changed and how
 
 
-