本文整理匯總了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);
}
示例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));
}
示例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());
}
示例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());
}
示例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());
}
示例6: getSideOf
@NotNull
public FragmentSide getSideOf(@NotNull ChangeList source) {
if (myBaseToLeftChangeList == source) {
return FragmentSide.SIDE1;
}
else {
return FragmentSide.SIDE2;
}
}
示例7: getBase
public Interval getBase(FragmentSide side) {
if (FragmentSide.SIDE1 == side) return getBase1();
if (FragmentSide.SIDE2 == side) return getBase2();
throw side.invalidException();
}
示例8: getSecondEditingSide
@NotNull
EditingSides getSecondEditingSide() {
return new MyEditingSides(FragmentSide.SIDE2);
}
示例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));
}
示例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;
}
示例11: ChangesCollector
ChangesCollector(@NotNull Disposable parentDisposable) {
super(FragmentSide.SIDE2, parentDisposable);
}