當前位置: 首頁>>代碼示例>>Java>>正文


Java FragmentSide.SIDE2屬性代碼示例

本文整理匯總了Java中com.intellij.openapi.diff.impl.highlighting.FragmentSide.SIDE2屬性的典型用法代碼示例。如果您正苦於以下問題:Java FragmentSide.SIDE2屬性的具體用法?Java FragmentSide.SIDE2怎麽用?Java FragmentSide.SIDE2使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.intellij.openapi.diff.impl.highlighting.FragmentSide的用法示例。


在下文中一共展示了FragmentSide.SIDE2屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getData

public Object getData(String dataId) {
  if (FocusDiffSide.DATA_KEY.is(dataId)) {
    int index = getFocusedEditorIndex();
    if (index < 0) return null;
    switch (index) {
      case 0:
        return new BranchFocusedSide(FragmentSide.SIDE1);
      case 1:
        return new MergeFocusedSide();
      case 2:
        return new BranchFocusedSide(FragmentSide.SIDE2);
    }
  }
  else if (PlatformDataKeys.DIFF_VIEWER.is(dataId)) return MergePanel2.this;
  return super.getData(dataId);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:16,代碼來源:MergePanel2.java

示例2: getSideView

public DiffSideView getSideView(FragmentSide side) {
  if (side == FragmentSide.SIDE1) {
    return myLeftSide;
  }
  if (side == FragmentSide.SIDE2) return myRightSide;
  throw new IllegalArgumentException(String.valueOf(side));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:DiffPanelImpl.java

示例3: MergeNoConflict

MergeNoConflict(@NotNull TextRange baseRange,
                @NotNull TextRange leftRange,
                @NotNull TextRange rightRange,
                @NotNull MergeList mergeList) {
  super(baseRange, mergeList, new ChangeHighlighterHolder());
  myLeftChange = new NoConflictChange(this, FragmentSide.SIDE1, baseRange, leftRange, mergeList.getLeftChangeList());
  myRightChange = new NoConflictChange(this, FragmentSide.SIDE2, baseRange, rightRange, mergeList.getRightChangeList());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:MergeNoConflict.java

示例4: MergeConflict

MergeConflict(@NotNull TextRange baseRange,
              @NotNull TextRange leftRange,
              @NotNull TextRange rightRange,
              @NotNull MergeList mergeList) {
  super(baseRange, mergeList, new ChangeHighlighterHolder());
  myLeftChange = new ConflictChange(this, FragmentSide.SIDE1, leftRange, mergeList.getLeftChangeList());
  myRightChange = new ConflictChange(this, FragmentSide.SIDE2, rightRange, mergeList.getRightChangeList());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:MergeConflict.java

示例5: processText

@NotNull
private static List<MergeFragment> processText(@NotNull String leftText,
                                               @NotNull String baseText,
                                               @NotNull String rightText,
                                               @NotNull ContextLogger logger) throws FilesTooBigForDiffException {
  DiffFragment[] leftFragments = DiffPolicy.DEFAULT_LINES.buildFragments(DiffString.create(baseText), DiffString.create(leftText));
  DiffFragment[] rightFragments = DiffPolicy.DEFAULT_LINES.buildFragments(DiffString.create(baseText), DiffString.create(rightText));
  int[] leftOffsets = {0, 0};
  int[] rightOffsets = {0, 0};
  int leftIndex = 0;
  int rightIndex = 0;
  MergeBuilder builder = new MergeBuilder(logger);
  while (leftIndex < leftFragments.length || rightIndex < rightFragments.length) {
    FragmentSide side;
    TextRange[] equalRanges = new TextRange[2];
    if (leftOffsets[0] < rightOffsets[0] && leftIndex < leftFragments.length) {
      side = FragmentSide.SIDE1;
      getEqualRanges(leftFragments[leftIndex], leftOffsets, equalRanges);
      leftIndex++;
    } else if (rightIndex < rightFragments.length) {
      side = FragmentSide.SIDE2;
      getEqualRanges(rightFragments[rightIndex], rightOffsets, equalRanges);
      rightIndex++;
    } else break;
    if (equalRanges[0] != null && equalRanges[1] != null) builder.add(equalRanges[0], equalRanges[1], side);
    else logger.assertTrue(equalRanges[0] == null && equalRanges[1] == null);
  }
  return builder.finish(leftText.length(), baseText.length(), rightText.length());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:29,代碼來源:MergeList.java

示例6: getSideOf

@NotNull
public FragmentSide getSideOf(@NotNull ChangeList source) {
  if (myBaseToLeftChangeList == source) {
    return FragmentSide.SIDE1;
  }
  else {
    return FragmentSide.SIDE2;
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:MergeList.java

示例7: getBase

public Interval getBase(FragmentSide side) {
  if (FragmentSide.SIDE1 == side) return getBase1();
  if (FragmentSide.SIDE2 == side) return getBase2();
  throw side.invalidException();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:Trapezium.java

示例8: getSecondEditingSide

@NotNull
EditingSides getSecondEditingSide() {
  return new MyEditingSides(FragmentSide.SIDE2);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:MergePanel2.java

示例9: getRange

@Override
public TextRange getRange(FragmentSide side) {
  if (side == FragmentSide.SIDE1) return myRange1;
  if (side == FragmentSide.SIDE2) return myRange2;
  throw new IllegalArgumentException(String.valueOf(side));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:InlineFragment.java

示例10: Version

public Version(@NotNull Word[] words, @NotNull DiffString text, @NotNull FragmentBuilder builder, boolean delete) {
  myWords = words;
  myText = text;
  myBuilder = builder;
  mySide = delete ? FragmentSide.SIDE1 : FragmentSide.SIDE2;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:ByWord.java

示例11: ChangesCollector

ChangesCollector(@NotNull Disposable parentDisposable) {
  super(FragmentSide.SIDE2, parentDisposable);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:3,代碼來源:ChangesDiffCalculator.java


注:本文中的com.intellij.openapi.diff.impl.highlighting.FragmentSide.SIDE2屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。