當前位置: 首頁>>代碼示例>>Java>>正文


Java DumbAware類代碼示例

本文整理匯總了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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:SelectInManager.java

示例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();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:TextEditorHighlightingPass.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:16,代碼來源:DisposeAwareRunnable.java

示例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();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:32,代碼來源:CompletionContributorForTextField.java

示例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();
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:14,代碼來源:TextEditorHighlightingPass.java

示例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);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:31,代碼來源:CompletionContributorForTextField.java

示例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);
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:16,代碼來源:DisposeAwareRunnable.java

示例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);
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:32,代碼來源:CompletionContributorForTextField.java

示例9: isDumbAware

import com.intellij.openapi.project.DumbAware; //導入依賴的package包/類
@Override
public boolean isDumbAware() {
  return this instanceof DumbAware;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:AnAction.java


注:本文中的com.intellij.openapi.project.DumbAware類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。