use of com.intellij.codeInsight.intention.impl.config.ActionUsagePanel in project intellij-community by JetBrains.
the class PostfixDescriptionPanel method initializeExamplePanel.
private void initializeExamplePanel(@NotNull JPanel panel) {
panel.setLayout(new BorderLayout());
ActionUsagePanel actionUsagePanel = new ActionUsagePanel();
panel.add(actionUsagePanel);
Disposer.register(this, actionUsagePanel);
}
use of com.intellij.codeInsight.intention.impl.config.ActionUsagePanel in project intellij-community by JetBrains.
the class PostfixDescriptionPanel method showUsages.
private static void showUsages(@NotNull JPanel panel, @Nullable TextDescriptor exampleUsage) {
String text = "";
FileType fileType = PlainTextFileType.INSTANCE;
if (exampleUsage != null) {
try {
text = exampleUsage.getText();
String name = exampleUsage.getFileName();
FileTypeManagerEx fileTypeManager = FileTypeManagerEx.getInstanceEx();
String extension = fileTypeManager.getExtension(name);
fileType = fileTypeManager.getFileTypeByExtension(extension);
} catch (IOException e) {
LOG.error(e);
}
}
((ActionUsagePanel) panel.getComponent(0)).reset(text, fileType);
panel.repaint();
}
Aggregations