use of com.jetbrains.lang.dart.ide.DartNamedElementNode in project intellij-plugins by JetBrains.
the class BaseDartGenerateHandler method invoke.
public void invoke(@NotNull final Project project, @NotNull final Editor editor, @NotNull final PsiFile file, final int offset) {
final DartClass dartClass = PsiTreeUtil.getParentOfType(file.findElementAt(offset), DartClassDefinition.class);
if (dartClass == null)
return;
final List<DartComponent> candidates = new ArrayList<>();
collectCandidates(dartClass, candidates);
List<DartNamedElementNode> selectedElements = Collections.emptyList();
if (ApplicationManager.getApplication().isUnitTestMode()) {
selectedElements = ContainerUtil.map(candidates, DartNamedElementNode::new);
} else if (!candidates.isEmpty()) {
final MemberChooser<DartNamedElementNode> chooser = createMemberChooserDialog(project, dartClass, candidates, getTitle());
chooser.show();
if (chooser.getExitCode() != DialogWrapper.OK_EXIT_CODE)
return;
selectedElements = chooser.getSelectedElements();
}
doInvoke(project, editor, file, selectedElements, createFix(dartClass));
}
Aggregations