mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diff: lambdify
This commit is contained in:
@@ -21,7 +21,6 @@ import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.util.UserDataHolder;
|
||||
import com.intellij.openapi.util.UserDataHolderBase;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -37,12 +36,7 @@ public class SimpleDiffRequestChain extends UserDataHolderBase implements DiffRe
|
||||
}
|
||||
|
||||
public SimpleDiffRequestChain(@NotNull List<? extends DiffRequest> requests) {
|
||||
myRequests = ContainerUtil.map(requests, new Function<DiffRequest, DiffRequestProducerWrapper>() {
|
||||
@Override
|
||||
public DiffRequestProducerWrapper fun(DiffRequest request) {
|
||||
return new DiffRequestProducerWrapper(request);
|
||||
}
|
||||
});
|
||||
myRequests = ContainerUtil.map(requests, request -> new DiffRequestProducerWrapper(request));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-13
@@ -31,7 +31,6 @@ import com.intellij.openapi.diff.DiffBundle;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.UserDataHolder;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -289,12 +288,7 @@ public abstract class ThreesideTextDiffViewerEx extends ThreesideTextDiffViewer
|
||||
@Override
|
||||
protected List<? extends ThreesideDiffChangeBase> getChanges() {
|
||||
List<? extends ThreesideDiffChangeBase> changes = ThreesideTextDiffViewerEx.this.getChanges();
|
||||
return ContainerUtil.filter(changes, new Condition<ThreesideDiffChangeBase>() {
|
||||
@Override
|
||||
public boolean value(ThreesideDiffChangeBase change) {
|
||||
return change.isConflict();
|
||||
}
|
||||
});
|
||||
return ContainerUtil.filter(changes, change -> change.isConflict());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,12 +299,7 @@ public abstract class ThreesideTextDiffViewerEx extends ThreesideTextDiffViewer
|
||||
List<? extends ThreesideDiffChangeBase> changes = ThreesideTextDiffViewerEx.this.getChanges();
|
||||
final ThreeSide currentSide = getCurrentSide();
|
||||
if (currentSide == ThreeSide.BASE) return changes;
|
||||
return ContainerUtil.filter(changes, new Condition<ThreesideDiffChangeBase>() {
|
||||
@Override
|
||||
public boolean value(ThreesideDiffChangeBase change) {
|
||||
return change.isChange(currentSide);
|
||||
}
|
||||
});
|
||||
return ContainerUtil.filter(changes, change -> change.isChange(currentSide));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -37,7 +37,6 @@ import com.intellij.openapi.editor.event.DocumentListener;
|
||||
import com.intellij.openapi.editor.event.EditorMouseEvent;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.ui.ToggleActionButton;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.EditorPopupHandler;
|
||||
@@ -459,12 +458,7 @@ public class TextDiffViewerUtil {
|
||||
|
||||
@NotNull
|
||||
public static List<? extends EditorEx> getEditableEditors(@NotNull List<? extends EditorEx> editors) {
|
||||
return ContainerUtil.filter(editors, new Condition<EditorEx>() {
|
||||
@Override
|
||||
public boolean value(EditorEx editor) {
|
||||
return !editor.isViewer();
|
||||
}
|
||||
});
|
||||
return ContainerUtil.filter(editors, editor -> !editor.isViewer());
|
||||
}
|
||||
|
||||
public static class EditorFontSizeSynchronizer implements PropertyChangeListener {
|
||||
|
||||
@@ -36,7 +36,6 @@ import com.intellij.openapi.editor.markup.RangeHighlighter;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.PlainTextFileType;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.util.BackgroundTaskUtil;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
@@ -45,7 +44,6 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.HintHint;
|
||||
import com.intellij.ui.HintListener;
|
||||
import com.intellij.ui.LightweightHint;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -98,10 +96,8 @@ public abstract class LineStatusMarkerPopup {
|
||||
}
|
||||
|
||||
public void showAfterScroll() {
|
||||
myEditor.getScrollingModel().runActionOnScrollingFinished(new Runnable() {
|
||||
public void run() {
|
||||
showHintAt(null);
|
||||
}
|
||||
myEditor.getScrollingModel().runActionOnScrollingFinished(() -> {
|
||||
showHintAt(null);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -163,11 +159,8 @@ public abstract class LineStatusMarkerPopup {
|
||||
final CharSequence vcsContent = myTracker.getVcsContent(myRange);
|
||||
final CharSequence currentContent = myTracker.getCurrentContent(myRange);
|
||||
|
||||
return BackgroundTaskUtil.tryComputeFast(new Function<ProgressIndicator, List<DiffFragment>>() {
|
||||
@Override
|
||||
public List<DiffFragment> fun(ProgressIndicator indicator) {
|
||||
return ByWord.compare(vcsContent, currentContent, ComparisonPolicy.DEFAULT, indicator);
|
||||
}
|
||||
return BackgroundTaskUtil.tryComputeFast(indicator -> {
|
||||
return ByWord.compare(vcsContent, currentContent, ComparisonPolicy.DEFAULT, indicator);
|
||||
}, 200);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user