mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-178618 dir-diff: use null instead of default project
this commit reverts e9e28e9787
This commit is contained in:
@@ -115,7 +115,7 @@ public abstract class DiffElement<T> {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Callable<DiffElement<T>> getElementChooser(Project project) {
|
||||
public Callable<DiffElement<T>> getElementChooser(@Nullable Project project) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,6 @@ import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||
import com.intellij.openapi.diff.impl.dir.DirDiffPanel;
|
||||
import com.intellij.openapi.diff.impl.dir.DirDiffTableModel;
|
||||
import com.intellij.openapi.diff.impl.dir.DirDiffWindow;
|
||||
import com.intellij.openapi.project.DefaultProjectFactory;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -44,7 +42,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -69,9 +66,7 @@ class DirDiffViewer implements FrameDiffTool.DiffViewer {
|
||||
@Nullable String helpID) {
|
||||
myHelpID = helpID;
|
||||
|
||||
Project project = context.getProject();
|
||||
if (project == null) project = DefaultProjectFactory.getInstance().getDefaultProject();
|
||||
DirDiffTableModel model = new DirDiffTableModel(project, element1, element2, settings);
|
||||
DirDiffTableModel model = new DirDiffTableModel(context.getProject(), element1, element2, settings);
|
||||
|
||||
myDirDiffPanel = new DirDiffPanel(model, new DirDiffWindow() {
|
||||
@NotNull
|
||||
|
||||
@@ -74,7 +74,7 @@ public class DirDiffTableModel extends AbstractTableModel implements DirDiffMode
|
||||
public static final String COLUMN_DATE = "Date";
|
||||
public static final String EMPTY_STRING = StringUtil.repeatSymbol(' ', 50);
|
||||
|
||||
private final Project myProject;
|
||||
@Nullable private final Project myProject;
|
||||
private final DirDiffSettings mySettings;
|
||||
|
||||
private DiffElement mySource;
|
||||
@@ -91,7 +91,7 @@ public class DirDiffTableModel extends AbstractTableModel implements DirDiffMode
|
||||
private DirDiffPanel myPanel;
|
||||
private volatile boolean myDisposed;
|
||||
|
||||
public DirDiffTableModel(@NotNull Project project, DiffElement source, DiffElement target, DirDiffSettings settings) {
|
||||
public DirDiffTableModel(@Nullable Project project, DiffElement source, DiffElement target, DirDiffSettings settings) {
|
||||
UsageTrigger.trigger("diff.DirDiffTableModel");
|
||||
myProject = project;
|
||||
mySettings = settings;
|
||||
@@ -528,6 +528,7 @@ public class DirDiffTableModel extends AbstractTableModel implements DirDiffMode
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Project getProject() {
|
||||
return myProject;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user