本文整理匯總了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;
}