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


Java DiffNavigationContext类代码示例

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


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

示例1: doScrollToContext

import com.intellij.openapi.diff.DiffNavigationContext; //导入依赖的package包/类
protected boolean doScrollToContext(@NotNull DiffNavigationContext context) {
  ChangedLinesIterator changedLinesIterator = new ChangedLinesIterator(Side.RIGHT);
  NavigationContextChecker checker = new NavigationContextChecker(changedLinesIterator, context);
  int line = checker.contextMatchCheck();
  if (line == -1) {
    // this will work for the case, when spaces changes are ignored, and corresponding fragments are not reported as changed
    // just try to find target line  -> +-
    AllLinesIterator allLinesIterator = new AllLinesIterator(Side.RIGHT);
    NavigationContextChecker checker2 = new NavigationContextChecker(allLinesIterator, context);
    line = checker2.contextMatchCheck();
  }
  if (line == -1) return false;

  scrollToLine(Side.RIGHT, line);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:SimpleDiffViewer.java

示例2: doScrollToContext

import com.intellij.openapi.diff.DiffNavigationContext; //导入依赖的package包/类
protected boolean doScrollToContext(@NotNull DiffNavigationContext context) {
  if (getSide().isLeft()) return false;

  AllLinesIterator allLinesIterator = new AllLinesIterator();
  NavigationContextChecker checker2 = new NavigationContextChecker(allLinesIterator, context);
  int line = checker2.contextMatchCheck();
  if (line == -1) return false;

  scrollToLine(line);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:SimpleOnesideDiffViewer.java

示例3: createDiffNavigationContext

import com.intellij.openapi.diff.DiffNavigationContext; //导入依赖的package包/类
private DiffNavigationContext createDiffNavigationContext(final int actualLine) {
  final ContentsLines contentsLines = new ContentsLines(myFileAnnotation.getAnnotatedContent());

  final Pair<Integer, String> pair = correctActualLineIfTextEmpty(contentsLines, actualLine);
  return new DiffNavigationContext(new Iterable<String>() {
    @Override
    public Iterator<String> iterator() {
      return new CacheOneStepIterator<String>(new ContextLineIterator(contentsLines, myFileAnnotation, pair.getFirst()));
    }
  }, pair.getSecond());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ShowDiffFromAnnotation.java

示例4: convertRequestFair

import com.intellij.openapi.diff.DiffNavigationContext; //导入依赖的package包/类
@Nullable
private static DiffRequest convertRequestFair(@NotNull com.intellij.openapi.diff.DiffRequest oldRequest) {
  if (oldRequest.getOnOkRunnable() != null) return null;
  //if (oldRequest.getBottomComponent() != null) return null; // TODO: we need EDT to make this check. Let's ignore bottom component.
  // TODO: migrate layers

  com.intellij.openapi.diff.DiffContent[] contents = oldRequest.getContents();
  String[] titles = oldRequest.getContentTitles();
  List<DiffContent> newContents = new ArrayList<DiffContent>(contents.length);

  for (int i = 0; i < contents.length; i++) {
    DiffContent convertedContent = convertContent(oldRequest.getProject(), contents[i]);
    if (convertedContent == null) return null;
    newContents.add(convertedContent);
  }

  SimpleDiffRequest newRequest = new SimpleDiffRequest(oldRequest.getWindowTitle(), newContents, Arrays.asList(titles));

  newRequest.putUserData(DiffUserDataKeys.CONTEXT_ACTIONS, Collections.<AnAction>singletonList(new MyShowDiffAction(oldRequest)));

  DiffNavigationContext navigationContext = (DiffNavigationContext)oldRequest.getGenericData().get(DiffTool.SCROLL_TO_LINE.getName());
  if (navigationContext != null) {
    newRequest.putUserData(DiffUserDataKeysEx.NAVIGATION_CONTEXT, navigationContext);
  }

  return newRequest;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:MigrateToNewDiffUtil.java

示例5: doScrollToContext

import com.intellij.openapi.diff.DiffNavigationContext; //导入依赖的package包/类
protected boolean doScrollToContext(@Nonnull DiffNavigationContext context) {
  ChangedLinesIterator changedLinesIterator = new ChangedLinesIterator();
  int line = context.contextMatchCheck(changedLinesIterator);
  if (line == -1) {
    // this will work for the case, when spaces changes are ignored, and corresponding fragments are not reported as changed
    // just try to find target line  -> +-
    AllLinesIterator allLinesIterator = new AllLinesIterator(getEditor(Side.RIGHT).getDocument());
    line = context.contextMatchCheck(allLinesIterator);
  }
  if (line == -1) return false;

  scrollToLine(Side.RIGHT, line);
  return true;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:SimpleDiffViewer.java

示例6: doScrollToContext

import com.intellij.openapi.diff.DiffNavigationContext; //导入依赖的package包/类
protected boolean doScrollToContext(@Nonnull DiffNavigationContext context) {
  if (getSide().isLeft()) return false;

  AllLinesIterator allLinesIterator = new AllLinesIterator(getEditor().getDocument());
  int line = context.contextMatchCheck(allLinesIterator);
  if (line == -1) return false;

  scrollToLine(line);
  return true;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:SimpleOnesideDiffViewer.java

示例7: NavigationContextChecker

import com.intellij.openapi.diff.DiffNavigationContext; //导入依赖的package包/类
public NavigationContextChecker(@NotNull Iterator<Pair<Integer, CharSequence>> changedLinesIterator,
                                @NotNull DiffNavigationContext context) {
  myChangedLinesIterator = changedLinesIterator;
  myContext = context;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:NavigationContextChecker.java

示例8: getDiffNavigationContext

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

示例9: setDiffNavigationContext

import com.intellij.openapi.diff.DiffNavigationContext; //导入依赖的package包/类
public void setDiffNavigationContext(DiffNavigationContext diffNavigationContext) {
  myDiffNavigationContext = diffNavigationContext;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ShowDiffUIContext.java

示例10: NavigationContextChecker

import com.intellij.openapi.diff.DiffNavigationContext; //导入依赖的package包/类
public NavigationContextChecker(@Nonnull Iterator<Pair<Integer, CharSequence>> changedLinesIterator,
                                @Nonnull DiffNavigationContext context) {
  myChangedLinesIterator = changedLinesIterator;
  myContext = context;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:NavigationContextChecker.java


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