本文整理汇总了Java中com.intellij.openapi.project.DumbAware类的典型用法代码示例。如果您正苦于以下问题:Java DumbAware类的具体用法?Java DumbAware怎么用?Java DumbAware使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DumbAware类属于com.intellij.openapi.project包,在下文中一共展示了DumbAware类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTargets
import com.intellij.openapi.project.DumbAware; //导入依赖的package包/类
public SelectInTarget[] getTargets() {
checkLoadExtensions();
SelectInTarget[] targets = myTargets.toArray(new SelectInTarget[myTargets.size()]);
Arrays.sort(targets, new SelectInTargetComparator());
if (DumbService.getInstance(myProject).isDumb()) {
final List<SelectInTarget> awareList = (List)ContainerUtil.findAll(targets, DumbAware.class);
return awareList.toArray(new SelectInTarget[awareList.size()]);
}
return targets;
}
示例2: applyInformationToEditor
import com.intellij.openapi.project.DumbAware; //导入依赖的package包/类
@Override
public final void applyInformationToEditor() {
if (!isValid()) return; // Document has changed.
if (DumbService.getInstance(myProject).isDumb() && !(this instanceof DumbAware)) {
Document document = getDocument();
PsiFile file = document == null ? null : PsiDocumentManager.getInstance(myProject).getPsiFile(document);
if (file != null) {
DaemonCodeAnalyzerEx.getInstanceEx(myProject).getFileStatusMap().markFileUpToDate(getDocument(), getId());
}
return;
}
doApplyInformationToEditor();
}
示例3: create
import com.intellij.openapi.project.DumbAware; //导入依赖的package包/类
private static Runnable create(@NotNull Runnable delegate, @Nullable Object disposable) {
if (disposable == null) {
return delegate;
}
if (delegate instanceof DumbAware) {
return new DumbAwareRunnable(delegate, disposable);
}
if (delegate instanceof PossiblyDumbAware) {
return new PossiblyDumbAwareRunnable(delegate, disposable);
}
return new DisposeAwareRunnable(delegate, disposable);
}
示例4: fillCompletionVariants
import com.intellij.openapi.project.DumbAware; //导入依赖的package包/类
@Override
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {
PsiFile file = parameters.getOriginalFile();
if (!(file instanceof PsiPlainTextFile)) return;
TextFieldCompletionProvider field = file.getUserData(TextFieldCompletionProvider.COMPLETING_TEXT_FIELD_KEY);
if (field == null) return;
if (!(field instanceof DumbAware) && DumbService.isDumb(file.getProject())) return;
String text = file.getText();
int offset = Math.min(text.length(), parameters.getOffset());
String prefix = field.getPrefix(text.substring(0, offset));
CompletionResultSet activeResult;
if (!result.getPrefixMatcher().getPrefix().equals(prefix)) {
activeResult = result.withPrefixMatcher(prefix);
}
else {
activeResult = result;
}
if (field.isCaseInsensitivity()) {
activeResult = activeResult.caseInsensitive();
}
field.addCompletionVariants(text, offset, prefix, activeResult);
activeResult.stopHere();
}
示例5: applyInformationToEditor
import com.intellij.openapi.project.DumbAware; //导入依赖的package包/类
@Override
public final void applyInformationToEditor() {
if (!isValid()) return; // Document has changed.
if (DumbService.getInstance(myProject).isDumb() && !(this instanceof DumbAware)) {
Document document = getDocument();
PsiFile file = document == null ? null : PsiDocumentManager.getInstance(myProject).getPsiFile(document);
if (file != null) {
((DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(myProject)).getFileStatusMap().markFileUpToDate(getDocument(), getId());
}
return;
}
doApplyInformationToEditor();
}
示例6: fillCompletionVariants
import com.intellij.openapi.project.DumbAware; //导入依赖的package包/类
@Override
public void fillCompletionVariants(CompletionParameters parameters, CompletionResultSet result) {
PsiFile file = parameters.getOriginalFile();
if (!(file instanceof PsiPlainTextFile)) return;
TextFieldCompletionProvider field = file.getUserData(TextFieldCompletionProvider.COMPLETING_TEXT_FIELD_KEY);
if (field == null) return;
if (!(field instanceof DumbAware) && DumbService.isDumb(file.getProject())) return;
String text = file.getText();
int offset = Math.min(text.length(), parameters.getOffset());
String prefix = field.getPrefix(text.substring(0, offset));
CompletionResultSet activeResult;
if (!result.getPrefixMatcher().getPrefix().equals(prefix)) {
activeResult = result.withPrefixMatcher(prefix);
}
else {
activeResult = result;
}
if (field.isCaseInsensitivity()) {
activeResult = activeResult.caseInsensitive();
}
field.addCompletionVariants(text, offset, prefix, activeResult);
}
示例7: create
import com.intellij.openapi.project.DumbAware; //导入依赖的package包/类
private static Runnable create(@Nonnull Runnable delegate, @Nullable Object disposable) {
if (disposable == null) {
return delegate;
}
if (delegate instanceof DumbAware) {
return new DumbAwareRunnable(delegate, disposable);
}
if (delegate instanceof PossiblyDumbAware) {
return new PossiblyDumbAwareRunnable(delegate, disposable);
}
return new DisposeAwareRunnable(delegate, disposable);
}
示例8: fillCompletionVariants
import com.intellij.openapi.project.DumbAware; //导入依赖的package包/类
@RequiredReadAction
@Override
public void fillCompletionVariants(CompletionParameters parameters, CompletionResultSet result) {
PsiFile file = parameters.getOriginalFile();
if (!(file instanceof PsiPlainTextFile)) return;
TextFieldCompletionProvider field = file.getUserData(TextFieldCompletionProvider.COMPLETING_TEXT_FIELD_KEY);
if (field == null) return;
if (!(field instanceof DumbAware) && DumbService.isDumb(file.getProject())) return;
String text = file.getText();
int offset = Math.min(text.length(), parameters.getOffset());
String prefix = field.getPrefix(text.substring(0, offset));
CompletionResultSet activeResult;
if (!result.getPrefixMatcher().getPrefix().equals(prefix)) {
activeResult = result.withPrefixMatcher(prefix);
}
else {
activeResult = result;
}
if (field.isCaseInsensitivity()) {
activeResult = activeResult.caseInsensitive();
}
field.addCompletionVariants(text, offset, prefix, activeResult);
}
示例9: isDumbAware
import com.intellij.openapi.project.DumbAware; //导入依赖的package包/类
@Override
public boolean isDumbAware() {
return this instanceof DumbAware;
}