vcs: cleanup - fix codestyle

GitOrigin-RevId: 1f4f4207b772142e078038f04c62a3ad7d936591
This commit is contained in:
Aleksey Pivovarov
2019-10-13 12:02:20 +00:00
committed by intellij-monorepo-bot
parent d89280634f
commit 944e23f7ae
10 changed files with 48 additions and 43 deletions
@@ -6,6 +6,6 @@ import com.intellij.diff.impl.CacheDiffRequestChainProcessor
import com.intellij.diff.impl.DiffRequestProcessor
import com.intellij.openapi.project.Project
open class ChainDiffVirtualFile(private val chain: DiffRequestChain, name : String) : DiffVirtualFile(name) {
open class ChainDiffVirtualFile(private val chain: DiffRequestChain, name: String) : DiffVirtualFile(name) {
override fun createProcessor(project: Project): DiffRequestProcessor = CacheDiffRequestChainProcessor(project, chain)
}
@@ -26,7 +26,7 @@ import com.intellij.openapi.vfs.VirtualFile
class DiffEditorProvider : FileEditorProvider, DumbAware {
companion object {
const val DiffEditorProviderId = "DiffEditor"
const val DIFF_EDITOR_PROVIDER_ID = "DiffEditor"
}
override fun accept(project: Project, file: VirtualFile): Boolean {
@@ -43,6 +43,6 @@ class DiffEditorProvider : FileEditorProvider, DumbAware {
Disposer.dispose(editor)
}
override fun getEditorTypeId(): String = DiffEditorProviderId
override fun getEditorTypeId(): String = DIFF_EDITOR_PROVIDER_ID
override fun getPolicy(): FileEditorPolicy = FileEditorPolicy.HIDE_DEFAULT_EDITOR
}
@@ -1,12 +1,17 @@
package com.intellij.diff.editor
class DiffFileIconProvider : com.intellij.ide.FileIconProvider {
import com.intellij.icons.AllIcons
import com.intellij.ide.FileIconProvider
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import javax.swing.Icon
override fun getIcon(file: com.intellij.openapi.vfs.VirtualFile, flags: Int, project: com.intellij.openapi.project.Project?): javax.swing.Icon? {
if(file is DiffVirtualFile)
return com.intellij.icons.AllIcons.Actions.Diff
return null
class DiffFileIconProvider : FileIconProvider {
override fun getIcon(file: VirtualFile, flags: Int, project: Project?): Icon? {
if (file is DiffVirtualFile) {
return AllIcons.Actions.Diff
}
return null
}
}
@@ -19,7 +19,7 @@ import com.intellij.diff.impl.DiffRequestProcessor
import com.intellij.openapi.project.Project
import com.intellij.testFramework.LightVirtualFile
abstract class DiffVirtualFile(name : String) : LightVirtualFile(name, DiffFileType.INSTANCE, "") {
abstract class DiffVirtualFile(name: String) : LightVirtualFile(name, DiffFileType.INSTANCE, "") {
abstract fun createProcessor(project: Project): DiffRequestProcessor
override fun isWritable(): Boolean = false
@@ -1,6 +1,5 @@
package com.intellij.diff.editor
import com.intellij.diff.util.DiffUserDataKeysEx
import com.intellij.openapi.fileEditor.FileEditor
import com.intellij.openapi.fileEditor.FileEditorPolicy
import com.intellij.openapi.fileEditor.FileEditorProvider
@@ -19,10 +18,10 @@ class GraphViewEditorProvider : FileEditorProvider, DumbAware {
}
override fun disposeEditor(editor: FileEditor) {
Disposer.dispose(editor)
Disposer.dispose(editor)
}
override fun getEditorTypeId(): String = "GraphViewEditor"
override fun getPolicy(): FileEditorPolicy =
FileEditorPolicy.PLACE_BEFORE_DEFAULT_EDITOR
FileEditorPolicy.PLACE_BEFORE_DEFAULT_EDITOR
}
@@ -7,12 +7,13 @@ import javax.swing.Icon
class GraphViewFileIconProvider : FileIconProvider {
override fun getIcon(file: VirtualFile, flags: Int, project: Project?): Icon? {
if (file is GraphViewVirtualFile)
return AllIcons.Vcs.Branch
return null
override fun getIcon(file: VirtualFile, flags: Int, project: Project?): Icon? {
if (file is GraphViewVirtualFile) {
return AllIcons.Vcs.Branch
}
return null
}
}
@@ -3,23 +3,22 @@ package com.intellij.diff.editor
import com.intellij.ide.actions.SplitAction
import com.intellij.openapi.util.Key
import com.intellij.testFramework.LightVirtualFile
import com.intellij.ui.content.Content
import javax.swing.JComponent
class GraphViewVirtualFile(val toolbarsAndTable: JComponent, val getTabNameFunc: () -> String)
: LightVirtualFile(getTabNameFunc(), GraphViewFileType.INSTANCE, "") {
companion object {
@JvmField
val TabContentId: Key<String> = Key("TabContentId")
@JvmField
val GraphVirtualFile: Key<GraphViewVirtualFile> = Key("GraphVirtualFile")
}
: LightVirtualFile(getTabNameFunc(), GraphViewFileType.INSTANCE, "") {
companion object {
@JvmField
val TabContentId: Key<String> = Key("TabContentId")
@JvmField
val GraphVirtualFile: Key<GraphViewVirtualFile> = Key("GraphVirtualFile")
}
init {
this.putUserData(SplitAction.FORBID_TAB_SPLIT, true)
}
init {
this.putUserData(SplitAction.FORBID_TAB_SPLIT, true)
}
fun getTabName(): String {
return getTabNameFunc()
}
fun getTabName(): String {
return getTabNameFunc()
}
}
@@ -84,8 +84,9 @@ public final class Splash extends Window {
@Override
public void paint(Graphics g) {
if (myProgress < 0.10 || myProgressSlideImages.isEmpty())
if (myProgress < 0.10 || myProgressSlideImages.isEmpty()) {
StartupUiUtil.drawImage(g, myImage, 0, 0, null);
}
paintProgress(g);
}
@@ -412,12 +412,8 @@ public class ChangesViewManager implements ChangesViewEx,
if (project.isDisposed()) return;
myView.addSelectionListener(() -> {
if (!Registry.is("show.diff.preview.as.editor.tab"))
return;
if (!myVcsConfiguration.LOCAL_CHANGES_DETAILS_PREVIEW_SHOWN)
return;
if (!Registry.is("show.diff.preview.as.editor.tab")) return;
if (!myVcsConfiguration.LOCAL_CHANGES_DETAILS_PREVIEW_SHOWN) return;
if (myModelUpdateInProgress) return;
FileEditorManager instance = FileEditorManager.getInstance(myProject);
@@ -431,10 +427,12 @@ public class ChangesViewManager implements ChangesViewEx,
}
private void triggerUpdatePreview(boolean fromModelRefresh) {
if (Registry.is("show.diff.as.editor.tab"))
if (Registry.is("show.diff.as.editor.tab")) {
updatePreview(fromModelRefresh);
else
}
else {
invokeLater(() -> updatePreview(fromModelRefresh));
}
}
@Override
@@ -489,8 +487,9 @@ public class ChangesViewManager implements ChangesViewEx,
}
private void setDiffPreviewVisible(boolean isDiffPreviewVisible) {
if (Registry.is("show.diff.preview.as.editor.tab") && !isDiffPreviewVisible)
if (Registry.is("show.diff.preview.as.editor.tab") && !isDiffPreviewVisible) {
FileEditorManager.getInstance(myProject).closeFile(myPreviewDiffVirtualFile);
}
else {
FileEditorManager.getInstance(myProject).openFile(new PreviewDiffVirtualFile(myDiffPreviewProvider), false, true);
}
@@ -43,8 +43,9 @@ public class PreviewDiffSplitterComponent extends OnePixelSplitter {
}
private void updateVisibility() {
if (Registry.is("show.log.as.editor.tab"))
if (Registry.is("show.log.as.editor.tab")) {
return;
}
setSecondComponent(myDetailsOn ? myProcessor.getComponent() : null);
JComponent secondComponent = getSecondComponent();