if (selection instanceof SonarTreeModel.RuleLabel) {
if (rulesToolTipMap != null && rulesToolTipMap.size() != 0) {
final SonarTreeModel.RuleLabel ruleLabel = (SonarTreeModel.RuleLabel) selection;
String toolTipText = rulesToolTipMap.get(ruleLabel.getRuleKey());
if (toolTipText != null) {
Balloon popup = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(toolTipText, MessageType.INFO, null)
.createBalloon();
JComponent component = toolWindow.getComponent();
popup.show(new RelativePoint(component, new Point()), Balloon.Position.above);
return;
}
}
Balloon popup = JBPopupFactory.getInstance()
.createHtmlTextBalloonBuilder("<p>Can't show description</p><p>Check your sonar project configuration</p>", MessageType.WARNING, null)
.createBalloon();
JComponent component = toolWindow.getComponent();
popup.show(new RelativePoint(component, new Point()), Balloon.Position.above);
downloadRules();
}
}
}