mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[shelf]: rename and convert to interface DiffPreviewUpdateProcessor
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.intellij.openapi.vcs.changes;
|
||||
|
||||
import com.intellij.diff.chains.DiffRequestProducerException;
|
||||
import com.intellij.diff.impl.CacheDiffRequestProcessor;
|
||||
import com.intellij.diff.requests.DiffRequest;
|
||||
import com.intellij.diff.requests.ErrorDiffRequest;
|
||||
import com.intellij.diff.requests.LoadingDiffRequest;
|
||||
@@ -31,7 +32,8 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class CacheChangeProcessor extends CacheDiffRefreshableRequestProcessor<CacheChangeProcessor.ChangeWrapper> {
|
||||
public abstract class CacheChangeProcessor extends CacheDiffRequestProcessor<CacheChangeProcessor.ChangeWrapper>
|
||||
implements DiffPreviewUpdateProcessor {
|
||||
|
||||
@Nullable private Change myCurrentChange;
|
||||
|
||||
|
||||
+7
-13
@@ -15,31 +15,25 @@
|
||||
*/
|
||||
package com.intellij.openapi.vcs.changes;
|
||||
|
||||
import com.intellij.diff.impl.CacheDiffRequestProcessor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.CalledInAwt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public abstract class CacheDiffRefreshableRequestProcessor<T> extends CacheDiffRequestProcessor<T> {
|
||||
public CacheDiffRefreshableRequestProcessor(@Nullable Project project) {
|
||||
super(project);
|
||||
}
|
||||
|
||||
public CacheDiffRefreshableRequestProcessor(@Nullable Project project, @NotNull String place) {
|
||||
super(project, place);
|
||||
}
|
||||
import javax.swing.*;
|
||||
|
||||
public interface DiffPreviewUpdateProcessor {
|
||||
/**
|
||||
* Notify currently shown diff that it's not needed now and cached values can be reset, a.e. before hiding preview panel
|
||||
*/
|
||||
@CalledInAwt
|
||||
public abstract void clear();
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* Get newly requested element for diff and update/create new diff request for it
|
||||
* a.e. get selection from some model and check if previously shown diff request need to be replaced or still valid for such selection
|
||||
*/
|
||||
@CalledInAwt
|
||||
public abstract void refresh();
|
||||
void refresh();
|
||||
|
||||
@NotNull
|
||||
JComponent getComponent();
|
||||
}
|
||||
+2
-2
@@ -24,11 +24,11 @@ import javax.swing.*;
|
||||
|
||||
public class PreviewDiffSplitterComponent extends JBSplitter {
|
||||
@NotNull private final JComponent myFirstComponent;
|
||||
@NotNull private final CacheDiffRefreshableRequestProcessor myProcessor;
|
||||
@NotNull private final DiffPreviewUpdateProcessor myProcessor;
|
||||
private boolean myDetailsOn;
|
||||
|
||||
public PreviewDiffSplitterComponent(@NotNull JComponent firstComponent,
|
||||
@NotNull CacheDiffRefreshableRequestProcessor processor,
|
||||
@NotNull DiffPreviewUpdateProcessor processor,
|
||||
@NotNull String splitterDimensionKey, boolean detailsOn) {
|
||||
super(splitterDimensionKey, 0.5f);
|
||||
myFirstComponent = firstComponent;
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ package com.intellij.openapi.vcs.changes.shelf;
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.diff.DiffContentFactoryEx;
|
||||
import com.intellij.diff.chains.DiffRequestProducerException;
|
||||
import com.intellij.diff.impl.CacheDiffRequestProcessor;
|
||||
import com.intellij.diff.requests.DiffRequest;
|
||||
import com.intellij.diff.requests.SimpleDiffRequest;
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -741,7 +742,7 @@ public class ShelvedChangesViewManager implements ProjectComponent {
|
||||
return new DnDImage(image, new Point(-image.getWidth(null), -image.getHeight(null)));
|
||||
}
|
||||
|
||||
private class MyShelvedPreviewProcessor extends CacheDiffRefreshableRequestProcessor<ShelvedWrapper> {
|
||||
private class MyShelvedPreviewProcessor extends CacheDiffRequestProcessor<ShelvedWrapper> implements DiffPreviewUpdateProcessor {
|
||||
|
||||
@NotNull private final DiffShelvedChangesAction.PatchesPreloader myPreloader;
|
||||
@Nullable private ShelvedWrapper myCurrentShelvedElement;
|
||||
|
||||
Reference in New Issue
Block a user