本文整理汇总了Java中com.intellij.util.diff.FilesTooBigForDiffException类的典型用法代码示例。如果您正苦于以下问题:Java FilesTooBigForDiffException类的具体用法?Java FilesTooBigForDiffException怎么用?Java FilesTooBigForDiffException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FilesTooBigForDiffException类属于com.intellij.util.diff包,在下文中一共展示了FilesTooBigForDiffException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: translatedViaDiff
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
private boolean translatedViaDiff(DocumentEvent e, DocumentEventImpl event) {
try {
myLine = event.translateLineViaDiff(myLine);
}
catch (FilesTooBigForDiffException ignored) {
return false;
}
if (myLine < 0 || myLine >= getDocument().getLineCount()) {
invalidate(e);
}
else {
DocumentEx document = getDocument();
setIntervalStart(document.getLineStartOffset(myLine));
setIntervalEnd(document.getLineEndOffset(myLine));
}
return true;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PersistentRangeHighlighterImpl.java
示例2: rediff
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
void rediff() {
try {
if (myTopMessageDiffPanel != null) {
myPanel.removeTopComponent(myTopMessageDiffPanel);
}
LineBlocks blocks = myData.updateEditors();
setLineBlocks(blocks != null ? blocks : LineBlocks.EMPTY);
if (blocks != null && blocks.getCount() == 0) {
if (myData.isContentsEqual()) {
setFileContentsAreIdentical();
}
}
}
catch (FilesTooBigForDiffException e) {
setTooBigFileErrorContents();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:DiffPanelImpl.java
示例3: translateViaDiff
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
@Nullable
private static Pair<ProperTextRange, LinesCols> translateViaDiff(final DocumentEventImpl event, LinesCols linesCols) {
try {
int myStartLine = event.translateLineViaDiffStrict(linesCols.myStartLine);
Document document = event.getDocument();
if (myStartLine < 0 || myStartLine >= document.getLineCount()) {
return null;
}
int start = document.getLineStartOffset(myStartLine) + linesCols.myStartColumn;
if (start >= document.getTextLength()) return null;
int myEndLine = event.translateLineViaDiffStrict(linesCols.myEndLine);
if (myEndLine < 0 || myEndLine >= document.getLineCount()) {
return null;
}
int end = document.getLineStartOffset(myEndLine) + linesCols.myEndColumn;
if (end > document.getTextLength() || end < start) return null;
return Pair.create(new ProperTextRange(start, end), new LinesCols(myStartLine, linesCols.myStartColumn, myEndLine, linesCols.myEndColumn));
}
catch (FilesTooBigForDiffException e) {
return null;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:PersistentRangeMarker.java
示例4: getBlock
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
@Nullable
private Block getBlock(VcsFileRevision revision) throws FilesTooBigForDiffException, VcsException {
if (myRevisionToContentMap.containsKey(revision)) {
return myRevisionToContentMap.get(revision);
}
final String revisionContent = getContentOf(revision);
if (revisionContent == null) return null;
int index = myRevisions.indexOf(revision);
Block blockByIndex = getBlock(index);
if (blockByIndex == null) return null;
myRevisionToContentMap.put(revision, new FindBlock(revisionContent, blockByIndex).getBlockInThePrevVersion());
return myRevisionToContentMap.get(revision);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:VcsHistoryDialog.java
示例5: buildChanges
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
private ArrayList<Change> buildChanges() throws FilesTooBigForDiffException {
Document base = getDocument(FragmentSide.SIDE1);
DiffString[] baseLines = DiffUtil.convertToLines(base.getText());
Document version = getDocument(FragmentSide.SIDE2);
DiffString[] versionLines = DiffUtil.convertToLines(version.getText());
DiffFragment[] fragments = ComparisonPolicy.DEFAULT.buildDiffFragmentsFromLines(baseLines, versionLines);
final ArrayList<Change> result = new ArrayList<Change>();
new DiffFragmentsEnumerator(fragments) {
@Override
protected void process(DiffFragment fragment) {
if (fragment.isEqual()) return;
Context context = getContext();
TextRange range1 = context.createRange(FragmentSide.SIDE1);
TextRange range2 = context.createRange(FragmentSide.SIDE2);
result.add(new SimpleChange(ChangeType.fromDiffFragment(context.getFragment()), range1, range2, ChangeList.this));
}
}.execute();
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ChangeList.java
示例6: getNewChangedRanges
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
private List<Range> getNewChangedRanges(int changedLine1, int changedLine2, int vcsLine1, int vcsLine2)
throws FilesTooBigForDiffException {
if (changedLine1 == changedLine2 && vcsLine1 == vcsLine2) {
return Collections.emptyList();
}
if (changedLine1 == changedLine2) {
return Collections.singletonList(new Range(changedLine1, changedLine2, vcsLine1, vcsLine2));
}
if (vcsLine1 == vcsLine2) {
return Collections.singletonList(new Range(changedLine1, changedLine2, vcsLine1, vcsLine2));
}
List<String> lines = new DocumentWrapper(myDocument).getLines(changedLine1, changedLine2 - 1);
List<String> vcsLines = new DocumentWrapper(myVcsDocument).getLines(vcsLine1, vcsLine2 - 1);
return new RangesBuilder(lines, vcsLines, changedLine1, vcsLine1, myMode).getRanges();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:LineStatusTracker.java
示例7: testChangedSpaceCorrection
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
public void testChangedSpaceCorrection() throws FilesTooBigForDiffException {
DiffCorrection correction = new DiffCorrection.ChangedSpace(ComparisonPolicy.DEFAULT);
DiffFragment[] fragments = correction.correct(new DiffFragment[]{
new DiffFragment("x", "y"),
new DiffFragment(" ", " "),
new DiffFragment("ab", "ab"),
new DiffFragment(" ", " "),
new DiffFragment(" ", " w o r d"),
new DiffFragment(" ", " w o r d")});
CHECK.compareAll(new DiffFragment[]{
new DiffFragment("x", "y"),
new DiffFragment(null, " "), new DiffFragment(" ", " "),
new DiffFragment("ab", "ab"),
new DiffFragment(" ", " "),
new DiffFragment(" ", " "), new DiffFragment(null, "w o r d"),
new DiffFragment(" ", null), new DiffFragment(" ", " "), new DiffFragment(null, "w o r d")}, fragments);
fragments = correction.correct(new DiffFragment[]{new DiffFragment("\n ", "\n ")});
CHECK.compareAll(new DiffFragment[]{new DiffFragment("\n", "\n"),
new DiffFragment(" ", null), new DiffFragment(" ", " ")}, fragments);
fragments = correction.correct(new DiffFragment[]{new DiffFragment("\n", "\n\n")});
CHECK.compareAll(new DiffFragment[]{new DiffFragment("\n", "\n"), new DiffFragment(null, "\n")}, fragments);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:CorrectionTest.java
示例8: testConcatinateSingleSide
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
public void testConcatinateSingleSide() throws FilesTooBigForDiffException {
DiffCorrection correction = new DiffCorrection.ConcatenateSingleSide();
DiffFragment[] corrected = correction.correct(
new DiffFragment[]{new DiffFragment(null, "a"),
new DiffFragment("b", null),
new DiffFragment("c", "d"),
new DiffFragment(null, "a"),
new DiffFragment("b", null),
new DiffFragment("1", null),
new DiffFragment("x", "x"),
new DiffFragment(null, "a")});
CHECK.compareAll(new DiffFragment[]{new DiffFragment("b", "a"),
new DiffFragment("c", "d"),
new DiffFragment("b1", "a"),
new DiffFragment("x", "x"), new DiffFragment(null, "a")},
corrected);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:CorrectionTest.java
示例9: testConnectSingleSideToChange
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
public void testConnectSingleSideToChange() throws FilesTooBigForDiffException {
DiffFragment first = DiffFragment.unchanged("a", "A");
DiffFragment oneSide = new DiffFragment(null, "b");
DiffFragment equal = new DiffFragment("c", "c");
DiffFragment last = DiffFragment.unchanged("g", "G");
DiffFragment[] fragments = DiffCorrection.ConnectSingleSideToChange.INSTANCE.correct(new DiffFragment[]{
first,
oneSide,
equal,
new DiffFragment(null, "d"), new DiffFragment("e", "E"), new DiffFragment("f", null),
last
});
CHECK.compareAll(new DiffFragment[]{
first, oneSide, equal,
new DiffFragment("ef", "dE"),
last
}, fragments);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:CorrectionTest.java
示例10: calculateDiff
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
public Collection<TextRange> calculateDiff(@NotNull final Document beforeDocument, @NotNull final Document currentDocument) {
myNewMarkup.ranges.clear();
myOldMarkup.document = beforeDocument;
myNewMarkup.document = currentDocument;
List<LineFragment> lineFragments;
try {
lineFragments = myCompareProcessor.process(beforeDocument.getText(), currentDocument.getText());
}
catch (FilesTooBigForDiffException e) {
LOG.info(e);
return Collections.emptyList();
}
final FragmentHighlighterImpl fragmentHighlighter = new FragmentHighlighterImpl(myOldMarkup, myNewMarkup);
for (Iterator<LineFragment> iterator = lineFragments.iterator(); iterator.hasNext();) {
LineFragment fragment = iterator.next();
fragmentHighlighter.setIsLast(!iterator.hasNext());
fragment.highlight(fragmentHighlighter);
}
return new ArrayList<TextRange>(myNewMarkup.ranges);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ChangesDiffCalculator.java
示例11: doTest
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
private static void doTest(
String[] beforePrevBlock,
String[] prevBlock,
String[] afterPrevBlock,
String[] beforeBlock,
String[] block,
String[] afterBlock) throws FilesTooBigForDiffException {
String[] prevVersion = composeVersion(beforePrevBlock, prevBlock, afterPrevBlock);
String[] currentVersion = composeVersion(beforeBlock, block, afterBlock);
FindBlock findBlock = new FindBlock(prevVersion,
new Block(currentVersion, beforeBlock.length, beforeBlock.length + block.length - 1));
Block actualBlock = findBlock.getBlockInThePrevVersion();
Block expectedBlock = new Block(prevVersion,beforePrevBlock.length, beforePrevBlock.length + prevBlock.length - 1);
assertEquals(expectedBlock, actualBlock);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SelectedBlockHistoryTest.java
示例12: findSubFragments
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
private ArrayList<LineFragment> findSubFragments(@NotNull DiffString text1, @NotNull DiffString text2) throws FilesTooBigForDiffException {
DiffFragment[] fragments = new ByWord(myComparisonPolicy).buildFragments(text1, text2);
fragments = DiffCorrection.ConnectSingleSideToChange.INSTANCE.correct(fragments);
fragments = UniteSameType.INSTANCE.correct(fragments);
fragments = PreferWholeLines.INSTANCE.correct(fragments);
fragments = UniteSameType.INSTANCE.correct(fragments);
DiffFragment[][] lines = Util.splitByUnchangedLines(fragments);
lines = Util.uniteFormattingOnly(lines);
LineFragmentsCollector collector = new LineFragmentsCollector();
for (DiffFragment[] line : lines) {
DiffFragment[][] subLines = LineBlockDivider.SINGLE_SIDE.divide(line);
subLines = Util.uniteFormattingOnly(subLines);
for (DiffFragment[] subLineFragments : subLines) {
LineFragment subLine = collector.addDiffFragment(Util.concatenate(subLineFragments));
if (!subLine.isOneSide()) {
subLine.setChildren(processInlineFragments(subLineFragments));
}
}
}
return collector.getFragments();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:TextCompareProcessor.java
示例13: process
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
@Override
public void process(@NotNull DiffFragment fragment, @NotNull FragmentsCollector collector) throws FilesTooBigForDiffException {
DiffString text1 = fragment.getText1();
DiffString text2 = fragment.getText2();
if (!fragment.isEqual()) {
if (myComparisonPolicy.isEqual(fragment))
fragment = myComparisonPolicy.createFragment(text1, text2);
collector.add(fragment);
} else {
assert text1 != null;
assert text2 != null;
DiffString[] lines1 = text1.tokenize();
DiffString[] lines2 = text2.tokenize();
LOG.assertTrue(lines1.length == lines2.length);
for (int i = 0; i < lines1.length; i++)
collector.addAll(myDiffPolicy.buildFragments(lines1[i], lines2[i]));
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:DiffCorrection.java
示例14: updateRevisionsList
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
private void updateRevisionsList() throws VcsException {
if (myIsInLoading) return;
if (myChangesOnlyCheckBox.isSelected()) {
loadContentsFor(myRevisions.toArray(new VcsFileRevision[myRevisions.size()]));
try {
((ListTableModel)myList.getModel()).setItems(filteredRevisions());
}
catch (FilesTooBigForDiffException e) {
myChangesOnlyCheckBox.setEnabled(false);
myChangesOnlyCheckBox.setSelected(false);
setErrorText(e.getMessage());
((ListTableModel)myList.getModel()).setItems(myRevisions);
}
((ListTableModel)myList.getModel()).fireTableDataChanged();
updateDiff(0, 0);
}
else {
((ListTableModel)myList.getModel()).setItems(myRevisions);
((ListTableModel)myList.getModel()).fireTableDataChanged();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:VcsHistoryDialog.java
示例15: addPostfixes
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
private void addPostfixes() throws FilesTooBigForDiffException {
DiffString postfix1 = myVersion1.getCurrentWordPostfixAndOneMore();
DiffString postfix2 = myVersion2.getCurrentWordPostfixAndOneMore();
int length1 = postfix1.length();
int length2 = postfix2.length();
DiffFragment wholePostfix = myComparisonPolicy.createFragment(postfix1, postfix2);
if (wholePostfix.isEqual()) {
add(DiffFragment.unchanged(cutLast(postfix1, length1), cutLast(postfix2, length2)));
return;
}
if (length1 > 0 || length2 > 0) {
DiffFragment[] fragments = BY_CHAR.buildFragments(postfix1, postfix2);
DiffFragment firstFragment = fragments[0];
if (firstFragment.isEqual()) {
final DiffString text1 = cutLast(firstFragment.getText1(), length1);
final DiffString text2 = cutLast(firstFragment.getText2(), length2);
add(myComparisonPolicy.createFragment(text1, text2));
//add(firstFragment);
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ByWord.java
示例16: translateLineViaDiff
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
public int translateLineViaDiff(int line) throws FilesTooBigForDiffException {
Diff.Change change = reBuildDiffIfNeeded();
if (change == null) return line;
int newLine = line;
while (change != null) {
if (line < change.line0) break;
if (line >= change.line0 + change.deleted) {
newLine += change.inserted - change.deleted;
}
else {
int delta = Math.min(change.inserted, line - change.line0);
newLine = change.line1 + delta;
break;
}
change = change.link;
}
return newLine;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:DocumentEventImpl.java
示例17: diff
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
@NotNull
public static <T> FairDiffIterable diff(@NotNull T[] data1, @NotNull T[] data2, @NotNull ProgressIndicator indicator) {
indicator.checkCanceled();
try {
// TODO: use ProgressIndicator inside
Diff.Change change = Diff.buildChanges(data1, data2);
return fair(create(change, data1.length, data2.length));
}
catch (FilesTooBigForDiffException e) {
throw new DiffTooBigException();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:DiffIterableUtil.java
示例18: doRevert
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
protected void doRevert() throws IOException, FilesTooBigForDiffException {
Block b = myCalculator.getSelectionFor(myLeftRevision, new Progress() {
public void processed(int percentage) {
// should be already processed.
}
});
Document d = myGateway.getDocument(myRightEntry.getPath());
int from = d.getLineStartOffset(myFromLine);
int to = d.getLineEndOffset(myToLine);
d.replaceString(from, to, b.getBlockContent());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:SelectionReverter.java
示例19: isLeftContentAvailable
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
@Override
protected boolean isLeftContentAvailable(RevisionProcessingProgress p) {
try {
return myCalculator.canCalculateFor(myLeftRevision, p);
}
catch (FilesTooBigForDiffException e) {
return false;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:SelectionDifferenceModel.java
示例20: isRightContentAvailable
import com.intellij.util.diff.FilesTooBigForDiffException; //导入依赖的package包/类
@Override
protected boolean isRightContentAvailable(RevisionProcessingProgress p) {
try {
return myCalculator.canCalculateFor(myRightRevision, p);
}
catch (FilesTooBigForDiffException e) {
return false;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:SelectionDifferenceModel.java
注:本文中的com.intellij.util.diff.FilesTooBigForDiffException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论