use of com.intellij.codeInsight.intention.IntentionActionWithOptions in project intellij-community by JetBrains.
the class EditorNotificationActions method collectDescriptorsForEditor.
public static void collectDescriptorsForEditor(@NotNull Editor editor, @NotNull List<HighlightInfo.IntentionActionDescriptor> descriptors) {
Project project = editor.getProject();
if (project == null)
return;
FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
if (!(fileEditorManager instanceof FileEditorManagerImpl))
return;
TextEditor fileEditor = TextEditorProvider.getInstance().getTextEditor(editor);
List<JComponent> components = ((FileEditorManagerImpl) fileEditorManager).getTopComponents(fileEditor);
for (JComponent component : components) {
if (component instanceof IntentionActionProvider) {
IntentionActionWithOptions action = ((IntentionActionProvider) component).getIntentionAction();
if (action != null) {
descriptors.add(new HighlightInfo.IntentionActionDescriptor(action, action.getOptions(), null));
}
}
}
}
use of com.intellij.codeInsight.intention.IntentionActionWithOptions in project intellij-community by JetBrains.
the class SdkSetupNotificationTestBase method assertSdkSetupPanelShown.
protected static void assertSdkSetupPanelShown(EditorNotificationPanel panel, String expectedMessagePrefix) {
assertNotNull(panel);
final IntentionActionWithOptions action = panel.getIntentionAction();
assertNotNull(action);
final String text = action.getText();
assertNotNull(text);
if (!text.startsWith(expectedMessagePrefix)) {
final int length = Math.min(text.length(), expectedMessagePrefix.length());
assertEquals(expectedMessagePrefix, text.substring(0, length));
}
}
Aggregations