use of com.intellij.ui.HoverHyperlinkLabel in project intellij-community by JetBrains.
the class ContentRootPanel method createFolderComponent.
private <P extends JpsElement> JComponent createFolderComponent(final ContentFolder folder, Color foreground, ModuleSourceRootEditHandler<P> editor) {
final VirtualFile folderFile = folder.getFile();
final VirtualFile contentEntryFile = getContentEntry().getFile();
final String properties = folder instanceof SourceFolder ? StringUtil.notNullize(editor.getPropertiesString((P) ((SourceFolder) folder).getJpsElement().getProperties())) : "";
if (folderFile != null && contentEntryFile != null) {
String path = folderFile.equals(contentEntryFile) ? "." : VfsUtilCore.getRelativePath(folderFile, contentEntryFile, File.separatorChar);
HoverHyperlinkLabel hyperlinkLabel = new HoverHyperlinkLabel(path + properties, foreground);
hyperlinkLabel.setMinimumSize(new Dimension(0, 0));
hyperlinkLabel.addHyperlinkListener(new HyperlinkListener() {
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
myCallback.navigateFolder(getContentEntry(), folder);
}
});
registerTextComponent(hyperlinkLabel, foreground);
return new UnderlinedPathLabel(hyperlinkLabel);
} else {
String path = toRelativeDisplayPath(folder.getUrl(), getContentEntry().getUrl());
final JLabel pathLabel = new JLabel(path + properties);
pathLabel.setOpaque(false);
pathLabel.setForeground(JBColor.RED);
return new UnderlinedPathLabel(pathLabel);
}
}
use of com.intellij.ui.HoverHyperlinkLabel in project intellij-plugins by JetBrains.
the class DartProblemsFilterForm method createUIComponents.
private void createUIComponents() {
myResetFilterHyperlink = new HoverHyperlinkLabel(DartBundle.message("reset.filter"));
myResetFilterHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
protected void hyperlinkActivated(final HyperlinkEvent e) {
myListeners.forEach(FilterListener::filtersResetRequested);
}
});
}
use of com.intellij.ui.HoverHyperlinkLabel in project intellij-community by JetBrains.
the class ValidatingTableEditor method createUIComponents.
private void createUIComponents() {
myTable = new ChangesTrackingTableView<Item>() {
protected void onCellValueChanged(int row, int column, Object value) {
final Item original = getItems().get(row);
Item override = cloneOf(original);
final ColumnInfo<Item, Object> columnInfo = getTableModel().getColumnInfos()[column];
columnInfo.setValue(override, value);
updateMessage(row, override);
}
@Override
protected void onEditingStopped() {
updateMessage(-1, null);
}
};
myFixLink = new HoverHyperlinkLabel(null);
}
Aggregations