1 package org.abstracthorizon.aequo.gui;
2
3 import java.awt.Component;
4 import java.awt.Cursor;
5 import java.awt.event.MouseEvent;
6 import java.awt.event.MouseListener;
7
8 import org.abstracthorizon.aequo.util.BrowserUtility;
9
10
11
12
13
14
15
16 public class URLLink implements MouseListener {
17
18
19 protected String url;
20
21
22 protected Component component;
23
24
25
26
27
28
29 public URLLink(String url, Component component) {
30 this.url = url;
31 this.component = component;
32 }
33
34 public void mouseClicked(MouseEvent e) {
35 BrowserUtility.openURL(url);
36 }
37
38 public void mouseEntered(MouseEvent e) {
39 component.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
40 }
41
42 public void mouseExited(MouseEvent e) {
43 component.setCursor(Cursor.getDefaultCursor());
44 }
45
46 public void mousePressed(MouseEvent e) { }
47
48 public void mouseReleased(MouseEvent e) { }
49
50 }