本文整理匯總了Java中com.intellij.openapi.diff.impl.highlighting.FragmentSide.SIDE1屬性的典型用法代碼示例。如果您正苦於以下問題:Java FragmentSide.SIDE1屬性的具體用法?Java FragmentSide.SIDE1怎麽用?Java FragmentSide.SIDE1使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.intellij.openapi.diff.impl.highlighting.FragmentSide
的用法示例。
在下文中一共展示了FragmentSide.SIDE1屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: getChanges
@NotNull
public ChangeList getChanges(@NotNull final FragmentSide changesSide) {
if (changesSide == FragmentSide.SIDE1) {
return myBaseToLeftChangeList;
}
else {
return myBaseToRightChangeList;
}
}
示例7: getSideOf
@NotNull
public FragmentSide getSideOf(@NotNull ChangeList source) {
if (myBaseToLeftChangeList == source) {
return FragmentSide.SIDE1;
}
else {
return FragmentSide.SIDE2;
}
}
示例8: replaceOperation
private static Operation replaceOperation(TextRange range, TextRange otherRange, Document document, Document otherDocument, FragmentSide base) {
return new Operation(DiffBundle.message("merge.editor.replace.operation.name"),
base == FragmentSide.SIDE1 ? AllIcons.Diff.ArrowRight : AllIcons.Diff.Arrow,
otherDocument,
replaceModification(range, document, otherRange, otherDocument));
}
示例9: insertOperation
private static Operation insertOperation(TextRange range, int offset, Document document, Document otherDocument, FragmentSide base) {
return new Operation(DiffBundle.message("merge.editor.insert.operation.name"),
base == FragmentSide.SIDE1 ? AllIcons.Diff.ArrowRightDown : AllIcons.Diff.ArrowLeftDown,
otherDocument,
insertModification(range, document, offset, otherDocument));
}
示例10: DiffPanelImpl
public DiffPanelImpl(final Window owner,
@NotNull Project project,
boolean enableToolbar,
boolean horizontal,
int diffDividerPolygonsOffset,
DiffTool parentTool) {
myProject = project;
myIsHorizontal = horizontal;
myParentTool = parentTool;
myOptions = new DiffPanelOptions(this);
myPanel = new DiffPanelOuterComponent(TextDiffType.DIFF_TYPES, null);
myPanel.disableToolbar(!enableToolbar);
if (enableToolbar) myPanel.resetToolbar();
myOwnerWindow = owner;
myIsSyncScroll = true;
final boolean v = !horizontal;
myLeftSide = new DiffSideView(this, new CustomLineBorder(1, 0, v ? 0 : 1, v ? 0 : 1));
myRightSide = new DiffSideView(this, new CustomLineBorder(v ? 0 : 1, v ? 0 : 1, 1, 0));
myLeftSide.becomeMaster();
myDiffUpdater = new Rediffers(this);
myDiffDividerPolygonsOffset = diffDividerPolygonsOffset;
myData = createDiffPanelState(this);
if (horizontal) {
mySplitter = new DiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent(),
new DiffDividerPaint(this, FragmentSide.SIDE1, diffDividerPolygonsOffset), myData);
}
else {
mySplitter = new HorizontalDiffSplitter(myLeftSide.getComponent(), myRightSide.getComponent());
}
myPanel.insertDiffComponent(mySplitter.getComponent(), new MyScrollingPanel());
myDataProvider = new MyGenericDataProvider(this);
myPanel.setDataProvider(myDataProvider);
ComparisonPolicy comparisonPolicy = getComparisonPolicy();
if (comparisonPolicy != DiffManagerImpl.getInstanceEx().getComparisonPolicy()) {
setComparisonPolicy(comparisonPolicy);
}
HighlightMode highlightMode = getHighlightMode();
if (highlightMode != DiffManagerImpl.getInstanceEx().getHighlightMode()) {
setHighlightMode(highlightMode);
}
myVisibleAreaListener = new VisibleAreaListener() {
@Override
public void visibleAreaChanged(VisibleAreaEvent e) {
Editor editor1 = getEditor1();
if (editor1 != null) {
editor1.getComponent().repaint();
}
Editor editor2 = getEditor2();
if (editor2 != null) {
editor2.getComponent().repaint();
}
}
};
registerActions();
}
示例11: onContentChangedIn
public void onContentChangedIn(EditorSource source) {
myDiffUpdater.contentRemoved(source);
final EditorEx editor = source.getEditor();
if (myIsHorizontal && source.getSide() == FragmentSide.SIDE1 && editor != null) {
editor.setVerticalScrollbarOrientation(EditorEx.VERTICAL_SCROLLBAR_LEFT);
}
DiffSideView viewSide = getSideView(source.getSide());
viewSide.setEditorSource(getProject(), source);
Disposer.dispose(myScrollSupport);
if (editor == null) {
if (!myDisposed) {
rediff();
}
return;
}
final MouseListener mouseListener = PopupHandler
.installUnknownPopupHandler(editor.getContentComponent(), new MergeActionGroup(this, source.getSide()), ActionManager.getInstance());
myDiffUpdater.contentAdded(source);
editor.getSettings().setLineNumbersShown(true);
editor.getSettings().setFoldingOutlineShown(false);
editor.getFoldingModel().setFoldingEnabled(false);
((EditorMarkupModel)editor.getMarkupModel()).setErrorStripeVisible(true);
Editor editor1 = getEditor(FragmentSide.SIDE1);
Editor editor2 = getEditor(FragmentSide.SIDE2);
if (editor1 != null && editor2 != null && myIsSyncScroll) {
myScrollSupport.install(new EditingSides[]{this});
}
final VisibleAreaListener visibleAreaListener = mySplitter.getVisibleAreaListener();
final ScrollingModel scrollingModel = editor.getScrollingModel();
if (visibleAreaListener != null) {
scrollingModel.addVisibleAreaListener(visibleAreaListener);
scrollingModel.addVisibleAreaListener(myVisibleAreaListener);
}
myFontSizeSynchronizer.synchronize(editor);
source.addDisposable(new Disposable() {
public void dispose() {
myFontSizeSynchronizer.stopSynchronize(editor);
}
});
source.addDisposable(new Disposable() {
public void dispose() {
if (visibleAreaListener != null) {
scrollingModel.removeVisibleAreaListener(visibleAreaListener);
scrollingModel.removeVisibleAreaListener(myVisibleAreaListener);
}
editor.getContentComponent().removeMouseListener(mouseListener);
}
});
}
示例12: getInterval
public Interval getInterval(FragmentSide side) {
return side == FragmentSide.SIDE1 ? myIntervalForSide1 : myIntervalForSide2;
}
示例13: getBase
public Interval getBase(FragmentSide side) {
if (FragmentSide.SIDE1 == side) return getBase1();
if (FragmentSide.SIDE2 == side) return getBase2();
throw side.invalidException();
}
示例14: getFirstEditingSide
@NotNull
EditingSides getFirstEditingSide() {
return new MyEditingSides(FragmentSide.SIDE1);
}
示例15: 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));
}