當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。