mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] pass Disposable parameter explicitly to MainFrame and FileHistoryPanel
GitOrigin-RevId: ef551396f2dff0f7a1bbe50657bc2d4fa0efe29c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
265d467e45
commit
0a9497f079
@@ -60,8 +60,8 @@ public class FileHistoryPanel extends JPanel implements DataProvider, Disposable
|
||||
@NotNull private final VcsLogCommitDetailsListPanel myDetailsPanel;
|
||||
@NotNull private final JBSplitter myDetailsSplitter;
|
||||
|
||||
public FileHistoryPanel(@NotNull AbstractVcsLogUi logUi, @NotNull FileHistoryModel fileHistoryModel,
|
||||
@NotNull VcsLogData logData, @NotNull FilePath filePath, boolean withDiffPreview) {
|
||||
public FileHistoryPanel(@NotNull AbstractVcsLogUi logUi, @NotNull FileHistoryModel fileHistoryModel, @NotNull VcsLogData logData,
|
||||
@NotNull FilePath filePath, boolean withDiffPreview, @NotNull Disposable disposable) {
|
||||
myProject = logData.getProject();
|
||||
|
||||
myFilePath = filePath;
|
||||
@@ -71,7 +71,7 @@ public class FileHistoryPanel extends JPanel implements DataProvider, Disposable
|
||||
myProperties = logUi.getProperties();
|
||||
|
||||
myGraphTable = new VcsLogGraphTable(logUi.getId(), logData, logUi.getProperties(), logUi.getColorManager(),
|
||||
logUi::requestMore, logUi) {
|
||||
logUi::requestMore, disposable) {
|
||||
@Override
|
||||
protected boolean isSpeedSearchEnabled() {
|
||||
return true;
|
||||
@@ -136,7 +136,7 @@ public class FileHistoryPanel extends JPanel implements DataProvider, Disposable
|
||||
PopupHandler.installPopupHandler(myGraphTable, VcsLogActionPlaces.HISTORY_POPUP_ACTION_GROUP, VcsLogActionPlaces.VCS_HISTORY_PLACE);
|
||||
invokeOnDoubleClick(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_SHOW_DIFF_ACTION), tableWithProgress);
|
||||
|
||||
Disposer.register(logUi, this);
|
||||
Disposer.register(disposable, this);
|
||||
}
|
||||
|
||||
private void invokeOnDoubleClick(@NotNull AnAction action, @NotNull JComponent component) {
|
||||
|
||||
@@ -79,7 +79,7 @@ public class FileHistoryUi extends AbstractVcsLogUi {
|
||||
};
|
||||
|
||||
myFilterUi = new FileHistoryFilterUi(path, revision, root, uiProperties);
|
||||
myFileHistoryPanel = new FileHistoryPanel(this, myFileHistoryModel, logData, path, !VcsLogUiUtil.isDiffPreviewInEditor());
|
||||
myFileHistoryPanel = new FileHistoryPanel(this, myFileHistoryModel, logData, path, !VcsLogUiUtil.isDiffPreviewInEditor(), this);
|
||||
|
||||
if (VcsLogUiUtil.isDiffPreviewInEditor()) {
|
||||
new FileHistoryEditorDiffPreview(logData.getProject(), myUiProperties, myFileHistoryPanel);
|
||||
|
||||
@@ -72,7 +72,7 @@ public class VcsLogUiImpl extends AbstractVcsLogUi implements MainVcsLogUi {
|
||||
protected MainFrame createMainFrame(@NotNull VcsLogData logData,
|
||||
@NotNull MainVcsLogUiProperties uiProperties, @NotNull VcsLogFilterUiEx filterUi) {
|
||||
boolean isDiffPreviewAsEditor = VcsLogUiUtil.isDiffPreviewInEditor();
|
||||
MainFrame mainFrame = new MainFrame(logData, this, uiProperties, filterUi, !isDiffPreviewAsEditor);
|
||||
MainFrame mainFrame = new MainFrame(logData, this, uiProperties, filterUi, !isDiffPreviewAsEditor, this);
|
||||
if (isDiffPreviewAsEditor) {
|
||||
new VcsLogEditorDiffPreview(myProject, myUiProperties, mainFrame);
|
||||
}
|
||||
|
||||
@@ -87,14 +87,15 @@ public class MainFrame extends JPanel implements DataProvider, Disposable {
|
||||
@NotNull AbstractVcsLogUi logUi,
|
||||
@NotNull MainVcsLogUiProperties uiProperties,
|
||||
@NotNull VcsLogFilterUiEx filterUi,
|
||||
boolean withDiffPreview) {
|
||||
boolean withDiffPreview,
|
||||
@NotNull Disposable disposable) {
|
||||
myLogData = logData;
|
||||
myUiProperties = uiProperties;
|
||||
|
||||
myFilterUi = filterUi;
|
||||
|
||||
myGraphTable = new MyVcsLogGraphTable(logUi.getId(), logData, logUi.getProperties(), logUi.getColorManager(),
|
||||
() -> logUi.getRefresher().onRefresh(), logUi::requestMore, logUi);
|
||||
() -> logUi.getRefresher().onRefresh(), logUi::requestMore, disposable);
|
||||
myGraphTable.setCompactReferencesView(myUiProperties.get(MainVcsLogUiProperties.COMPACT_REFERENCES_VIEW));
|
||||
myGraphTable.setShowTagNames(myUiProperties.get(MainVcsLogUiProperties.SHOW_TAG_NAMES));
|
||||
myGraphTable.setLabelsLeftAligned(myUiProperties.get(MainVcsLogUiProperties.LABELS_LEFT_ALIGNED));
|
||||
@@ -164,7 +165,7 @@ public class MainFrame extends JPanel implements DataProvider, Disposable {
|
||||
add(myChangesBrowserSplitter);
|
||||
}
|
||||
|
||||
Disposer.register(logUi, this);
|
||||
Disposer.register(disposable, this);
|
||||
myGraphTable.resetDefaultFocusTraversalKeys();
|
||||
setFocusCycleRoot(true);
|
||||
setFocusTraversalPolicy(new MyFocusPolicy());
|
||||
|
||||
@@ -277,7 +277,7 @@ internal class BranchesVcsLogUi(id: String, logData: VcsLogData, colorManager: V
|
||||
get() = mainFrame.changesBrowser
|
||||
|
||||
override fun createMainFrame(logData: VcsLogData, uiProperties: MainVcsLogUiProperties, filterUi: VcsLogFilterUiEx) =
|
||||
MainFrame(logData, this, uiProperties, filterUi, false)
|
||||
MainFrame(logData, this, uiProperties, filterUi, false, this)
|
||||
.apply {
|
||||
isFocusCycleRoot = false
|
||||
focusTraversalPolicy = null //new focus traversal policy will be configured include branches tree
|
||||
|
||||
Reference in New Issue
Block a user