LPEX
4.4.0

com.ibm.lpex.alef
Class LpexDefaultHyperlinkPresenter

java.lang.Object
  extended by com.ibm.lpex.alef.LpexDefaultHyperlinkPresenter

public class LpexDefaultHyperlinkPresenter
extends Object

The default hyperlink presenter shows one hyperlink in one window of an LPEX source viewer. The default implementation of LpexSourceViewerConfiguration#getHyperlinkPresenter() returns a new instance of this class.

This class uses Eclipse's DefaultHyperlinkPresenter.HYPERLINK_COLOR as the named preference for the color used for hyperlinks.


Constructor Summary
LpexDefaultHyperlinkPresenter(Color color)
          Creates a new default hyperlink presenter.
LpexDefaultHyperlinkPresenter(IPreferenceStore preferenceStore)
          Creates a new default hyperlink presenter.
LpexDefaultHyperlinkPresenter(RGB rgb)
          Creates a new default hyperlink presenter.
 
Method Summary
 boolean canHideHyperlinks()
           
 boolean canShowMultipleHyperlinks()
          The default implementation of this class returns false, as it handles only one hyperlink at a time.
 void hideHyperlinks()
          Stops showing the active hyperlink.
 void install(ITextViewer textViewer)
          Installs this hyperlink presenter in the given LpexTextViewer.
 void propertyChange(PropertyChangeEvent e)
          Listens to changes to hyperlink's color in the preference store.
 void setColor(Color color)
          Sets the color for the hyperlink.
 void showHyperlinks(IHyperlink[] hyperlinks)
          Shows the first in the given hyperlinks array.
 void uninstall()
          Uninstalls this hyperlink presenter from its associated LpexTextViewer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LpexDefaultHyperlinkPresenter

public LpexDefaultHyperlinkPresenter(IPreferenceStore preferenceStore)
Creates a new default hyperlink presenter. It uses the key DefaultHyperlinkPresenter to read the hyperlink color from the given preference store.

Parameters:
preferenceStore - the preference store

LpexDefaultHyperlinkPresenter

public LpexDefaultHyperlinkPresenter(Color color)
Creates a new default hyperlink presenter. It uses the given hyperlink color.

Parameters:
color - the hyperlink color, must be disposed by the caller

LpexDefaultHyperlinkPresenter

public LpexDefaultHyperlinkPresenter(RGB rgb)
Creates a new default hyperlink presenter. It uses the given hyperlink color.

Parameters:
rgb - the hyperlink color's RGB description
Method Detail

setColor

public void setColor(Color color)
Sets the color for the hyperlink. The color must be disposed by the caller.

Parameters:
color - the hyperlink color, must be disposed by the caller

canShowMultipleHyperlinks

public boolean canShowMultipleHyperlinks()
The default implementation of this class returns false, as it handles only one hyperlink at a time.


install

public void install(ITextViewer textViewer)
Installs this hyperlink presenter in the given LpexTextViewer.

Parameters:
textViewer - the LpexTextViewer to install in

uninstall

public void uninstall()
Uninstalls this hyperlink presenter from its associated LpexTextViewer.


showHyperlinks

public void showHyperlinks(IHyperlink[] hyperlinks)
Shows the first in the given hyperlinks array.


hideHyperlinks

public void hideHyperlinks()
Stops showing the active hyperlink.


propertyChange

public void propertyChange(PropertyChangeEvent e)
Listens to changes to hyperlink's color in the preference store.


canHideHyperlinks

public boolean canHideHyperlinks()
Since:
4.2
See Also:
IHyperlinkPresenterExtension

LPEX
4.4.0

Copyright � 2016 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.