1 /*
2  * aTunes
3  * Copyright (C) Alex Aranda, Sylvain Gaudard and contributors
4  *
5  * See http://www.atunes.org/wiki/index.php?title=Contributing for information about contributors
6  *
7  * http://www.atunes.org
8  * http://sourceforge.net/projects/atunes
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  */
20 
21 package net.sourceforge.atunes.gui.views.controls;
22 
23 import java.awt.event.ActionEvent;
24 
25 import javax.swing.AbstractAction;
26 
27 import net.sourceforge.atunes.model.IDesktop;
28 
29 /**
30  * A link for url labels
31  */
32 final class Link extends AbstractAction {
33 
34     private static final long serialVersionUID = -3784927498125973809L;
35 
36     private IDesktop desktop;
37 
38     private String url;
39 
40     /**
41      * Instantiates a new link
42      * @param desktop
43      * @param url
44      */
Link(IDesktop desktop, String url)45     Link(IDesktop desktop, String url) {
46     	this.desktop = desktop;
47         this.url = url;
48     }
49 
50     @Override
actionPerformed(ActionEvent e)51     public void actionPerformed(ActionEvent e) {
52     	desktop.openURL(url);
53     }
54 
55 }
56