mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-116519 - Heroku Deployment facet: make the public key field more user-friendly
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package com.intellij.remoteServer.util;
|
||||
|
||||
import com.intellij.codeInsight.hint.HintManager;
|
||||
import com.intellij.codeInsight.hint.HintUtil;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ui.HyperlinkAdapter;
|
||||
import com.intellij.ui.HyperlinkLabel;
|
||||
import com.intellij.ui.awt.RelativePoint;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.HyperlinkEvent;
|
||||
|
||||
/**
|
||||
* @author michael.golubev
|
||||
*/
|
||||
public class TooltipUtil {
|
||||
|
||||
public static HyperlinkLabel createTooltip(final String message) {
|
||||
final HyperlinkLabel link = new HyperlinkLabel("");
|
||||
link.setIcon(AllIcons.General.Help_small);
|
||||
link.setUseIconAsLink(true);
|
||||
link.setIconTextGap(0);
|
||||
link.addHyperlinkListener(new HyperlinkAdapter() {
|
||||
@Override
|
||||
protected void hyperlinkActivated(HyperlinkEvent e) {
|
||||
final JLabel label = new JLabel(message);
|
||||
label.setBorder(HintUtil.createHintBorder());
|
||||
label.setBackground(HintUtil.INFORMATION_COLOR);
|
||||
label.setOpaque(true);
|
||||
HintManager.getInstance()
|
||||
.showHint(label, RelativePoint.getSouthEastOf(link), HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE, -1);
|
||||
}
|
||||
});
|
||||
return link;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user