Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.text.hyperlink
Class DefaultHyperlinkPresenter


java.lang.Object
  extended by 
org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter
All Implemented Interfaces:
EventListener, IHyperlinkPresenter, IHyperlinkPresenterExtension, IDocumentListener, ITextInputListener, ITextPresentationListener, 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 Summary
static  String HYPERLINK_COLOR
          A named preference that holds the color used for hyperlinks.
static  String HYPERLINK_COLOR_SYSTEM_DEFAULT
          A named preference that holds the preference whether to use the native link color.
 
Constructor Summary
DefaultHyperlinkPresenter ( Color color)
          Creates a new default hyperlink presenter.
DefaultHyperlinkPresenter ( IPreferenceStore store)
          Creates a new default hyperlink presenter which uses HYPERLINK_COLOR to read the color from the given preference store.
DefaultHyperlinkPresenter ( RGB color)
          Creates a new default hyperlink presenter.
 
Method Summary
 void applyTextPresentation ( TextPresentation textPresentation)
          This method is called when a text presentation is about to be applied to the text viewer.
 boolean canHideHyperlinks ()
          Tells whether the currently shown hyperlinks can be hidden.
 boolean canShowMultipleHyperlinks ()
          Tells whether this presenter is able to handle more than one hyperlink.
 void documentAboutToBeChanged ( DocumentEvent event)
          The manipulation described by the document event will be performed.
 void documentChanged ( DocumentEvent event)
          The manipulation described by the document event has been performed.
 void hideHyperlinks ()
          Tells this hyperlink presenter to hide the hyperlinks requested to be shown by IHyperlinkPresenter.showHyperlinks(IHyperlink[]).
 void inputDocumentAboutToBeChanged ( IDocument oldInput, IDocument newInput)
          Called before the input document is replaced.
 void inputDocumentChanged ( IDocument oldInput, IDocument newInput)
          Called after the input document has been replaced.
 void install ( ITextViewer textViewer)
          Installs this hyperlink presenter on the given text viewer.
 void propertyChange ( PropertyChangeEvent event)
          Notification that a property has changed.
 void setColor ( Color color)
          Sets the hyperlink foreground color.
 void showHyperlinks ( IHyperlink[] hyperlinks)
          Tells this hyperlink presenter to show the given hyperlinks on the installed text viewer.
 void uninstall ()
          Uninstalls this hyperlink presenter.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HYPERLINK_COLOR

public static final 
String HYPERLINK_COLOR
A named preference that holds the color used for hyperlinks.

Value is of type String. A RGB color value encoded as a string using class PreferenceConverter.

See Also:
StringConverter, PreferenceConverter, Constant Field Values

HYPERLINK_COLOR_SYSTEM_DEFAULT

public static final 
String HYPERLINK_COLOR_SYSTEM_DEFAULT
A 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:
Constant Field Values
Constructor Detail

DefaultHyperlinkPresenter

public DefaultHyperlinkPresenter(
IPreferenceStore store)
Creates a new default hyperlink presenter which uses HYPERLINK_COLOR to read the color from the given preference store.

Parameters:
store - the preference store

DefaultHyperlinkPresenter

public DefaultHyperlinkPresenter(
Color color)
Creates a new default hyperlink presenter.

Parameters:
color - the hyperlink color or null if the existing text color should be preserved; to be disposed by the caller

DefaultHyperlinkPresenter

public DefaultHyperlinkPresenter(
RGB color)
Creates a new default hyperlink presenter.

Parameters:
color - the hyperlink color or null if the existing text color should be preserved
Method Detail

canShowMultipleHyperlinks

public boolean canShowMultipleHyperlinks()
Description copied from interface: IHyperlinkPresenter
Tells whether this presenter is able to handle more than one hyperlink.

Specified by:
canShowMultipleHyperlinks in interface IHyperlinkPresenter
Returns:
true if this presenter can handle more than one hyperlink

showHyperlinks

public void showHyperlinks(
IHyperlink[] hyperlinks)
Description copied from interface: IHyperlinkPresenter
Tells this hyperlink presenter to show the given hyperlinks on the installed text viewer.

Specified by:
showHyperlinks in interface IHyperlinkPresenter
Parameters:
hyperlinks - the hyperlinks to show

canHideHyperlinks

public boolean canHideHyperlinks()
Tells whether the currently shown hyperlinks can be hidden.

Specified by:
canHideHyperlinks in interface IHyperlinkPresenterExtension
Returns:
true if the hyperlink manager can hide the current hyperlinks
Since:
3.4

hideHyperlinks

public void hideHyperlinks()
Description copied from interface: IHyperlinkPresenter
Tells this hyperlink presenter to hide the hyperlinks requested to be shown by IHyperlinkPresenter.showHyperlinks(IHyperlink[]).

Specified by:
hideHyperlinks in interface IHyperlinkPresenter

install

public void install(
ITextViewer textViewer)
Description copied from interface: IHyperlinkPresenter
Installs this hyperlink presenter on the given text viewer.

Specified by:
install in interface IHyperlinkPresenter
Parameters:
textViewer - the text viewer

uninstall

public void uninstall()
Description copied from interface: IHyperlinkPresenter
Uninstalls this hyperlink presenter.

Specified by:
uninstall in interface IHyperlinkPresenter

setColor

public void setColor(
Color color)
Sets the hyperlink foreground color.

Parameters:
color - the hyperlink foreground color or null if the existing text color should be preserved

applyTextPresentation

public void applyTextPresentation(
TextPresentation textPresentation)
Description copied from interface: ITextPresentationListener
This 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:
applyTextPresentation in interface ITextPresentationListener
Parameters:
textPresentation - the current text presentation

documentAboutToBeChanged

public void documentAboutToBeChanged(
DocumentEvent event)
Description copied from interface: IDocumentListener
The manipulation described by the document event will be performed.

Specified by:
documentAboutToBeChanged in interface IDocumentListener
Parameters:
event - the document event describing the document change

documentChanged

public void documentChanged(
DocumentEvent event)
Description copied from interface: IDocumentListener
The manipulation described by the document event has been performed.

Specified by:
documentChanged in interface IDocumentListener
Parameters:
event - the document event describing the document change

inputDocumentAboutToBeChanged

public void inputDocumentAboutToBeChanged(
IDocument oldInput,
                                          
IDocument newInput)
Description copied from interface: ITextInputListener
Called before the input document is replaced.

Specified by:
inputDocumentAboutToBeChanged in interface ITextInputListener
Parameters:
oldInput - the text viewer's previous input document
newInput - the text viewer's new input document

inputDocumentChanged

public void inputDocumentChanged(
IDocument oldInput,
                                 
IDocument newInput)
Description copied from interface: ITextInputListener
Called after the input document has been replaced.

Specified by:
inputDocumentChanged in interface ITextInputListener
Parameters:
oldInput - the text viewer's previous input document
newInput - the text viewer's new input document

propertyChange

public void propertyChange(
PropertyChangeEvent event)
Description copied from interface: IPropertyChangeListener
Notification that a property has changed.

This method gets called when the observed object fires a property change event.

Specified by:
propertyChange in interface IPropertyChangeListener
Parameters:
event - the property change event object describing which property changed and how

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire