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


Java Change类代码示例

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


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

示例1: fromChanges

import com.intellij.openapi.diff.impl.incrementalMerge.Change; //导入依赖的package包/类
@NotNull
public static LineBlocks fromChanges(@NotNull List<Change> changes) {
  // changes may come mixed, need to sort them to get correct intervals
  Collections.sort(changes, ChangeList.CHANGE_ORDER);

  List<Diff> diffs = new ArrayList<Diff>(changes.size());
  for (Change change : changes) {
    if (!change.isValid()) { continue; }
    int start1 = change.getChangeSide(FragmentSide.SIDE1).getStartLine();
    int end1 = change.getChangeSide(FragmentSide.SIDE1).getEndLine();
    Interval interval1 = Interval.fromTo(start1, end1);

    int start2 = change.getChangeSide(FragmentSide.SIDE2).getStartLine();
    int end2 = change.getChangeSide(FragmentSide.SIDE2).getEndLine();
    Interval interval2 = Interval.fromTo(start2, end2);

    diffs.add(new Diff(interval1, interval2, change.getType().getTypeKey()));
  }
  return new LineBlocks(diffs);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:LineBlocks.java

示例2: fromChanges

import com.intellij.openapi.diff.impl.incrementalMerge.Change; //导入依赖的package包/类
@Nonnull
public static LineBlocks fromChanges(@Nonnull List<Change> changes) {
  // changes may come mixed, need to sort them to get correct intervals
  Collections.sort(changes, ChangeList.CHANGE_ORDER);

  List<Diff> diffs = new ArrayList<Diff>(changes.size());
  for (Change change : changes) {
    if (!change.isValid()) { continue; }
    int start1 = change.getChangeSide(FragmentSide.SIDE1).getStartLine();
    int end1 = change.getChangeSide(FragmentSide.SIDE1).getEndLine();
    Interval interval1 = Interval.fromTo(start1, end1);

    int start2 = change.getChangeSide(FragmentSide.SIDE2).getStartLine();
    int end2 = change.getChangeSide(FragmentSide.SIDE2).getEndLine();
    Interval interval2 = Interval.fromTo(start2, end2);

    diffs.add(new Diff(interval1, interval2, change.getType().getTypeKey()));
  }
  return new LineBlocks(diffs);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:LineBlocks.java

示例3: actionPerformed

import com.intellij.openapi.diff.impl.incrementalMerge.Change; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DataContext dataContext = e.getDataContext();
  List<Change> notConflicts = ContainerUtil.collect(getNotConflicts(dataContext));
  for (Change change : notConflicts) {
    Change.apply(change, MergeList.BRANCH_SIDE);
  }
  if (myDiffPanel != null) {
    myDiffPanel.requestScrollEditors();
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:ApplyNonConflicts.java

示例4: getNotConflicts

import com.intellij.openapi.diff.impl.incrementalMerge.Change; //导入依赖的package包/类
private static Iterator<Change> getNotConflicts(MergeList mergeList) {
  if (mergeList == null) return new ArrayList<Change>(1).iterator();
  return FilteringIterator.create(mergeList.getAllChanges(), MergeList.NOT_CONFLICTS);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ApplyNonConflicts.java

示例5: getNotConflicts

import com.intellij.openapi.diff.impl.incrementalMerge.Change; //导入依赖的package包/类
private static Iterator<Change> getNotConflicts(DataContext dataContext) {
  MergeList mergeList = MergeList.fromDataContext(dataContext);
  if (mergeList == null) return new ArrayList<Change>(1).iterator();
  return FilteringIterator.create(mergeList.getAllChanges(), MergeList.NOT_CONFLICTS);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:ApplyNonConflicts.java

示例6: select

import com.intellij.openapi.diff.impl.incrementalMerge.Change; //导入依赖的package包/类
private void select(Change change) {
 if (change == null) return;
 myDispatcher.getMulticaster().selectionInPreviewChanged(change.getType().getTextDiffType().getDisplayName());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:DiffPreviewPanel.java

示例7: select

import com.intellij.openapi.diff.impl.incrementalMerge.Change; //导入依赖的package包/类
private void select(Change change) {
  if (change == null) return;
  myDispatcher.getMulticaster().selectionInPreviewChanged(change.getType().getTextDiffType().getDisplayName());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:DiffPreviewPanel.java


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