org.jdesktop.swingx.renderer.HyperlinkProvider Maven / Gradle / Ivy
/*
* $Id: HyperlinkProvider.java 3927 2011-02-22 16:34:11Z kleopatra $
*
* Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
* Santa Clara, California 95054, U.S.A. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.jdesktop.swingx.renderer;
import java.awt.Point;
import java.awt.event.ActionEvent;
import org.jdesktop.swingx.JXHyperlink;
import org.jdesktop.swingx.hyperlink.AbstractHyperlinkAction;
import org.jdesktop.swingx.rollover.RolloverProducer;
import org.jdesktop.swingx.rollover.RolloverRenderer;
/**
* Renderer for hyperlinks".
*
* The renderer is configured with a LinkAction.
* It's mostly up to the developer to guarantee that the all
* values which are passed into the getXXRendererComponent(...) are
* compatible with T: she can provide a runtime class to check against.
* If it isn't the renderer will configure the
* action with a null target.
*
* It's recommended to not use the given Action anywhere else in code,
* as it is updated on each getXXRendererComponent() call which might
* lead to undesirable side-effects.
*
* Internally uses JXHyperlink as rendering component.
*
* PENDING: can go from ButtonProvider?
*
* PENDING: make renderer respect selected cell state.
*
* PENDING: TreeCellRenderer has several issues
*
* - no icons
*
- usual background highlighter issues
*
*
* @author Jeanette Winzenburg
*/
public class HyperlinkProvider
extends ComponentProvider implements
RolloverRenderer {
private AbstractHyperlinkAction