当前位置: 首页>>代码示例>>Java>>正文


Java FileEditorLocation类代码示例

本文整理汇总了Java中com.intellij.openapi.fileEditor.FileEditorLocation的典型用法代码示例。如果您正苦于以下问题:Java FileEditorLocation类的具体用法?Java FileEditorLocation怎么用?Java FileEditorLocation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FileEditorLocation类属于com.intellij.openapi.fileEditor包,在下文中一共展示了FileEditorLocation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compare

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
@Override
public int compare(UsageNode c1, UsageNode c2) {
  if (c1 instanceof StringNode) return 1;
  if (c2 instanceof StringNode) return -1;
  Usage o1 = c1.getUsage();
  Usage o2 = c2.getUsage();
  int weight1 = o1 == USAGES_OUTSIDE_SCOPE_SEPARATOR ? 2 : o1 == MORE_USAGES_SEPARATOR ? 1 : 0;
  int weight2 = o2 == USAGES_OUTSIDE_SCOPE_SEPARATOR ? 2 : o2 == MORE_USAGES_SEPARATOR ? 1 : 0;
  if (weight1 != weight2) return weight1 - weight2;

  VirtualFile v1 = UsageListCellRenderer.getVirtualFile(o1);
  VirtualFile v2 = UsageListCellRenderer.getVirtualFile(o2);
  String name1 = v1 == null ? null : v1.getName();
  String name2 = v2 == null ? null : v2.getName();
  int i = Comparing.compare(name1, name2);
  if (i != 0) return i;

  if (o1 instanceof Comparable && o2 instanceof Comparable) {
    //noinspection unchecked
    return ((Comparable)o1).compareTo(o2);
  }

  FileEditorLocation loc1 = o1.getLocation();
  FileEditorLocation loc2 = o2.getLocation();
  return Comparing.compare(loc1, loc2);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ShowUsagesAction.java

示例2: compare

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
@Override
public int compare(UsageNode c1, UsageNode c2) {
  if (c1 instanceof StringNode) return 1;
  if (c2 instanceof StringNode) return -1;
  Usage o1 = c1.getUsage();
  Usage o2 = c2.getUsage();
  if (o1 == MORE_USAGES_SEPARATOR) return 1;
  if (o2 == MORE_USAGES_SEPARATOR) return -1;

  VirtualFile v1 = UsageListCellRenderer.getVirtualFile(o1);
  VirtualFile v2 = UsageListCellRenderer.getVirtualFile(o2);
  String name1 = v1 == null ? null : v1.getName();
  String name2 = v2 == null ? null : v2.getName();
  int i = Comparing.compare(name1, name2);
  if (i != 0) return i;

  if (o1 instanceof Comparable && o2 instanceof Comparable) {
    return ((Comparable)o1).compareTo(o2);
  }

  FileEditorLocation loc1 = o1.getLocation();
  FileEditorLocation loc2 = o2.getLocation();
  return Comparing.compare(loc1, loc2);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:ShowUsagesAction.java

示例3: compare

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
@Override
public int compare(UsageNode c1, UsageNode c2) {
  if (c1 instanceof StringNode) return 1;
  if (c2 instanceof StringNode) return -1;
  Usage o1 = c1.getUsage();
  Usage o2 = c2.getUsage();
  if (o1 == MORE_USAGES_SEPARATOR) return 1;
  if (o2 == MORE_USAGES_SEPARATOR) return -1;

  VirtualFile v1 = UsageListCellRenderer.getVirtualFile(o1);
  VirtualFile v2 = UsageListCellRenderer.getVirtualFile(o2);
  String name1 = v1 == null ? null : v1.getName();
  String name2 = v2 == null ? null : v2.getName();
  int i = Comparing.compare(name1, name2);
  if (i != 0) return i;

  if (o1 instanceof Comparable && o2 instanceof Comparable) {
    return ((Comparable) o1).compareTo(o2);
  }

  FileEditorLocation loc1 = o1.getLocation();
  FileEditorLocation loc2 = o2.getLocation();
  return Comparing.compare(loc1, loc2);
}
 
开发者ID:square,项目名称:dagger-intellij-plugin,代码行数:25,代码来源:ShowUsagesAction.java

示例4: findUsagesInEditor

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
private void findUsagesInEditor(@NotNull final PsiElement[] primaryElements,
                                @NotNull final PsiElement[] secondaryElements,
                                @NotNull FindUsagesHandler handler,
                                @NotNull PsiFile scopeFile,
                                @NotNull FileSearchScope direction,
                                @NotNull final FindUsagesOptions findUsagesOptions,
                                @NotNull FileEditor fileEditor) {
  initLastSearchElement(findUsagesOptions, primaryElements, secondaryElements);

  clearStatusBar();

  final FileEditorLocation currentLocation = fileEditor.getCurrentLocation();

  final UsageSearcher usageSearcher = createUsageSearcher(primaryElements, secondaryElements, handler, findUsagesOptions, scopeFile);
  AtomicBoolean usagesWereFound = new AtomicBoolean();

  Usage fUsage = findSiblingUsage(usageSearcher, direction, currentLocation, usagesWereFound, fileEditor);

  if (fUsage != null) {
    fUsage.navigate(true);
    fUsage.selectInEditor();
  }
  else if (!usagesWereFound.get()) {
    String message = getNoUsagesFoundMessage(primaryElements[0]) + " in " + scopeFile.getName();
    showHintOrStatusBarMessage(message, fileEditor);
  }
  else {
    fileEditor.putUserData(KEY_START_USAGE_AGAIN, VALUE_START_USAGE_AGAIN);
    showHintOrStatusBarMessage(getSearchAgainMessage(primaryElements[0], direction), fileEditor);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:FindUsagesManager.java

示例5: findUsagesInEditor

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
private void findUsagesInEditor(@NotNull UsageInfoToUsageConverter.TargetElementsDescriptor descriptor,
                                @NotNull FindUsagesHandler handler,
                                @NotNull PsiFile scopeFile,
                                @NotNull FileSearchScope direction,
                                @NotNull final FindUsagesOptions findUsagesOptions,
                                @NotNull FileEditor fileEditor) {
  initLastSearchElement(findUsagesOptions, descriptor);

  clearStatusBar();

  final FileEditorLocation currentLocation = fileEditor.getCurrentLocation();

  final UsageSearcher usageSearcher = createUsageSearcher(descriptor, handler, findUsagesOptions, scopeFile);
  AtomicBoolean usagesWereFound = new AtomicBoolean();

  Usage fUsage = findSiblingUsage(usageSearcher, direction, currentLocation, usagesWereFound, fileEditor);

  if (fUsage != null) {
    fUsage.navigate(true);
    fUsage.selectInEditor();
  }
  else if (!usagesWereFound.get()) {
    String message = getNoUsagesFoundMessage(descriptor.getPrimaryElements()[0]) + " in " + scopeFile.getName();
    showHintOrStatusBarMessage(message, fileEditor);
  }
  else {
    fileEditor.putUserData(KEY_START_USAGE_AGAIN, VALUE_START_USAGE_AGAIN);
    showHintOrStatusBarMessage(getSearchAgainMessage(descriptor.getPrimaryElements()[0], direction), fileEditor);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:FindUsagesManager.java

示例6: findUsagesInEditor

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
private void findUsagesInEditor(@Nonnull final PsiElement[] primaryElements,
                                @Nonnull final PsiElement[] secondaryElements,
                                @Nonnull FindUsagesHandler handler,
                                @Nonnull PsiFile scopeFile,
                                @Nonnull FileSearchScope direction,
                                @Nonnull final FindUsagesOptions findUsagesOptions,
                                @Nonnull FileEditor fileEditor) {
  initLastSearchElement(findUsagesOptions, primaryElements, secondaryElements);

  clearStatusBar();

  final FileEditorLocation currentLocation = fileEditor.getCurrentLocation();

  PsiElement2UsageTargetAdapter[] primaryTargets = PsiElement2UsageTargetAdapter.convert(primaryElements);
  PsiElement2UsageTargetAdapter[] secondaryTargets = PsiElement2UsageTargetAdapter.convert(primaryElements);
  final UsageSearcher usageSearcher = createUsageSearcher(primaryTargets, secondaryTargets, handler, findUsagesOptions, scopeFile);
  AtomicBoolean usagesWereFound = new AtomicBoolean();

  Usage fUsage = findSiblingUsage(usageSearcher, direction, currentLocation, usagesWereFound, fileEditor);

  if (fUsage != null) {
    fUsage.navigate(true);
    fUsage.selectInEditor();
  }
  else if (!usagesWereFound.get()) {
    String message = getNoUsagesFoundMessage(primaryElements[0]) + " in " + scopeFile.getName();
    showHintOrStatusBarMessage(message, fileEditor);
  }
  else {
    fileEditor.putUserData(KEY_START_USAGE_AGAIN, VALUE_START_USAGE_AGAIN);
    showHintOrStatusBarMessage(getSearchAgainMessage(primaryElements[0], direction), fileEditor);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:34,代码来源:FindUsagesManager.java

示例7: getCurrentLocation

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
@Nullable
@Override
public FileEditorLocation getCurrentLocation() {
    return null;
}
 
开发者ID:Blenta,项目名称:intellij-bpmn-editor,代码行数:6,代码来源:BPMNFileEditor.java

示例8: getCurrentLocation

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
@Nullable
@Override
public FileEditorLocation getCurrentLocation() {
    return swaggerEditor.getCurrentLocation();
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:6,代码来源:SwaggerUISplitView.java

示例9: getLocation

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
@Override
public FileEditorLocation getLocation() {
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:UsageAdapter.java

示例10: getLocation

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
@Nullable
FileEditorLocation getLocation();
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:Usage.java

示例11: getCurrentLocation

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
@Override
public FileEditorLocation getCurrentLocation() {
  TextEditor textEditor = getTextEditor();
  return textEditor == null ? null : textEditor.getCurrentLocation();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:BaseRemoteFileEditor.java

示例12: getEditorFor

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
@Nullable
private static Editor getEditorFor(@NotNull Usage usage) {
  FileEditorLocation location = usage.getLocation();
  FileEditor newFileEditor = location == null ? null : location.getEditor();
  return newFileEditor instanceof TextEditor ? ((TextEditor)newFileEditor).getEditor() : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ShowUsagesAction.java

示例13: findSiblingUsage

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
private static Usage findSiblingUsage(@NotNull final UsageSearcher usageSearcher,
                                      @NotNull FileSearchScope dir,
                                      final FileEditorLocation currentLocation,
                                      @NotNull final AtomicBoolean usagesWereFound,
                                      @NotNull FileEditor fileEditor) {
  if (fileEditor.getUserData(KEY_START_USAGE_AGAIN) != null) {
    dir = dir == FileSearchScope.AFTER_CARET ? FileSearchScope.FROM_START : FileSearchScope.FROM_END;
  }

  final FileSearchScope direction = dir;

  final AtomicReference<Usage> foundUsage = new AtomicReference<Usage>();
  usageSearcher.generate(new Processor<Usage>() {
    @Override
    public boolean process(Usage usage) {
      usagesWereFound.set(true);
      if (direction == FileSearchScope.FROM_START) {
        foundUsage.compareAndSet(null, usage);
        return false;
      }
      if (direction == FileSearchScope.FROM_END) {
        foundUsage.set(usage);
      }
      else if (direction == FileSearchScope.AFTER_CARET) {
        if (Comparing.compare(usage.getLocation(), currentLocation) > 0) {
          foundUsage.set(usage);
          return false;
        }
      }
      else if (direction == FileSearchScope.BEFORE_CARET) {
        if (Comparing.compare(usage.getLocation(), currentLocation) >= 0) {
          return false;
        }
        while (true) {
          Usage found = foundUsage.get();
          if (found == null) {
            if (foundUsage.compareAndSet(null, usage)) break;
          }
          else {
            if (Comparing.compare(found.getLocation(), usage.getLocation()) < 0 && foundUsage.compareAndSet(found, usage)) break;
          }
        }
      }

      return true;
    }
  });

  fileEditor.putUserData(KEY_START_USAGE_AGAIN, null);

  return foundUsage.get();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:53,代码来源:FindUsagesManager.java

示例14: getLocation

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
public FileEditorLocation getLocation() {
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:NameUsage.java

示例15: getCurrentLocation

import com.intellij.openapi.fileEditor.FileEditorLocation; //导入依赖的package包/类
public FileEditorLocation getCurrentLocation() {
    return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ImageFileEditorImpl.java


注:本文中的com.intellij.openapi.fileEditor.FileEditorLocation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。