mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-124580 Links in mac sheets dialogs do not work
This commit is contained in:
@@ -25,16 +25,22 @@ import org.jdesktop.swingx.graphics.GraphicsUtilities;
|
||||
import org.jdesktop.swingx.graphics.ShadowRenderer;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.HyperlinkEvent;
|
||||
import javax.swing.event.HyperlinkListener;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
|
||||
/**
|
||||
* Created by Denis Fokin
|
||||
*/
|
||||
public class SheetController {
|
||||
|
||||
private static final Logger LOG = Logger.getInstance(SheetController.class);
|
||||
private static final int SHEET_MINIMUM_HEIGHT = 143;
|
||||
private static String fontName = "Lucida Grande";
|
||||
private static Font regularFont = new Font(fontName, Font.PLAIN, 10);
|
||||
@@ -262,6 +268,24 @@ public class SheetController {
|
||||
|
||||
messageTextPane.setContentType("text/html");
|
||||
|
||||
messageTextPane.addHyperlinkListener(new HyperlinkListener() {
|
||||
public void hyperlinkUpdate(HyperlinkEvent he) {
|
||||
if(he.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
|
||||
if(Desktop.isDesktopSupported()) {
|
||||
try {
|
||||
Desktop.getDesktop().browse(he.getURL().toURI());
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
catch (URISyntaxException e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
FontMetrics fontMetrics = mySheetMessage.getFontMetrics(regularFont);
|
||||
|
||||
int widestWordWidth = 250;
|
||||
|
||||
Reference in New Issue
Block a user