本文整理汇总了Java中com.siyeh.ipp.psiutils.PsiSelectionSearcher类的典型用法代码示例。如果您正苦于以下问题:Java PsiSelectionSearcher类的具体用法?Java PsiSelectionSearcher怎么用?Java PsiSelectionSearcher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PsiSelectionSearcher类属于com.siyeh.ipp.psiutils包,在下文中一共展示了PsiSelectionSearcher类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processIntention
import com.siyeh.ipp.psiutils.PsiSelectionSearcher; //导入依赖的package包/类
protected void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
final Project project = element.getProject();
final Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
if (editor != null) {
final List<PsiMethodCallExpression> methodCalls =
PsiSelectionSearcher.searchElementsInSelection(editor, project, PsiMethodCallExpression.class, false);
if (methodCalls.size() > 0) {
for (PsiMethodCallExpression call : methodCalls) {
flipCall(call);
}
editor.getSelectionModel().removeSelection();
return;
}
}
if (element instanceof PsiMethodCallExpression) {
flipCall((PsiMethodCallExpression)element);
}
}
示例2: satisfiedBy
import com.siyeh.ipp.psiutils.PsiSelectionSearcher; //导入依赖的package包/类
@Override
public boolean satisfiedBy(PsiElement element, @Nullable Editor editor) {
if (editor != null && editor.getSelectionModel().hasSelection()) {
final List<PsiMethodCallExpression> list =
PsiSelectionSearcher.searchElementsInSelection(editor, element.getProject(), PsiMethodCallExpression.class, false);
for (PsiMethodCallExpression methodCallExpression : list) {
if (isSetGetMethodCall(methodCallExpression)) {
return true;
}
}
}
return isSetGetMethodCall(element);
}