org.vizzini.ui.table
Class SortTableHyperlinkMouseListener

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by org.vizzini.ui.table.SortTableHyperlinkMouseListener
All Implemented Interfaces:
MouseListener, EventListener

public class SortTableHyperlinkMouseListener
extends MouseAdapter

Provides a mouse listener for hyperlink events on a SortTable. The action is to launch the default browser to a URL. The URL is constructed from a prefix, the cell value, and a suffix. Optionally, the cell value can be ignored.

Since:
v0.2
Version:
v0.2
Author:
Jeffrey M. Thompson

Constructor Summary
SortTableHyperlinkMouseListener(String columnName)
          Construct this object with the given parameters.
SortTableHyperlinkMouseListener(String columnName, String prefix)
          Construct this object with the given parameters.
SortTableHyperlinkMouseListener(String columnName, String prefix, String suffix)
          Construct this object with the given parameters.
SortTableHyperlinkMouseListener(String columnName, String prefix, String suffix, boolean isCellValueUsed)
          Construct this object with the given parameters.
 
Method Summary
protected  String createUrl(String value)
          Create a URL using the given value.
protected  String getCellValueFor(SortTable sortTable, Point point)
          Return the cell value for the given parameters.
 void mouseClicked(MouseEvent event)
          Respond to a mouse click event.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortTableHyperlinkMouseListener

public SortTableHyperlinkMouseListener(String columnName)
Construct this object with the given parameters.

Parameters:
columnName - Hyperlink column name. (required)
Since:
v0.2

SortTableHyperlinkMouseListener

public SortTableHyperlinkMouseListener(String columnName,
                                       String prefix)
Construct this object with the given parameters.

Parameters:
columnName - Hyperlink column name. (required)
prefix - URL prefix. (required)
Since:
v0.2

SortTableHyperlinkMouseListener

public SortTableHyperlinkMouseListener(String columnName,
                                       String prefix,
                                       String suffix)
Construct this object with the given parameters.

Parameters:
columnName - Hyperlink column name. (required)
prefix - URL prefix. (required)
suffix - URL suffix. (required)
Since:
v0.2

SortTableHyperlinkMouseListener

public SortTableHyperlinkMouseListener(String columnName,
                                       String prefix,
                                       String suffix,
                                       boolean isCellValueUsed)
Construct this object with the given parameters.

Parameters:
columnName - Hyperlink column name. (required)
prefix - URL prefix. (required)
suffix - URL suffix. (required)
isCellValueUsed - Flag indicating whether the cell value is used in the URL.
Since:
v0.2
Method Detail

mouseClicked

public void mouseClicked(MouseEvent event)
Respond to a mouse click event.

Specified by:
mouseClicked in interface MouseListener
Overrides:
mouseClicked in class MouseAdapter
Parameters:
event - Mouse event.
Since:
v0.2

createUrl

protected String createUrl(String value)
Create a URL using the given value. The URL is constructed from a prefix, the cell value, and a suffix. Optionally, the cell value can be ignored.

Parameters:
value - Cell data value.
Since:
v0.2

getCellValueFor

protected String getCellValueFor(SortTable sortTable,
                                 Point point)
Return the cell value for the given parameters.

Parameters:
sortTable - Sort table.
point - Mouse click point.
Since:
v0.2


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02