当前位置: 首页>>代码示例>>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;未经允许,请勿转载。