Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
088ae2cb
Commit
088ae2cb
authored
6 years ago
by
Julia Beliaeva
Browse files
Options
Download
Email Patches
Plain Diff
[vcs-log] extract interface VcsLogTabsProperties
parent
13aecda8
Branches unavailable
Tags unavailable
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogManager.java
+4
-4
...log/impl/src/com/intellij/vcs/log/impl/VcsLogManager.java
platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogProjectTabsProperties.java
+2
-1
...om/intellij/vcs/log/impl/VcsLogProjectTabsProperties.java
platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogTabsManager.java
+6
-7
...impl/src/com/intellij/vcs/log/impl/VcsLogTabsManager.java
platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogTabsProperties.java
+9
-0
...l/src/com/intellij/vcs/log/impl/VcsLogTabsProperties.java
platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java
+2
-2
...log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java
with
23 additions
and
14 deletions
+23
-14
platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogManager.java
+
4
-
4
View file @
088ae2cb
...
...
@@ -38,7 +38,7 @@ public class VcsLogManager implements Disposable {
private
static
final
Logger
LOG
=
Logger
.
getInstance
(
VcsLogManager
.
class
);
@NotNull
private
final
Project
myProject
;
@NotNull
private
final
VcsLog
Project
TabsProperties
myUiProperties
;
@NotNull
private
final
VcsLogTabsProperties
myUiProperties
;
@Nullable
private
final
Consumer
<
Throwable
>
myRecreateMainLogHandler
;
@NotNull
private
final
VcsLogData
myLogData
;
...
...
@@ -46,12 +46,12 @@ public class VcsLogManager implements Disposable {
@NotNull
private
final
VcsLogTabsWatcher
myTabsLogRefresher
;
@NotNull
private
final
PostponableLogRefresher
myPostponableRefresher
;
public
VcsLogManager
(
@NotNull
Project
project
,
@NotNull
VcsLog
Project
TabsProperties
uiProperties
,
@NotNull
Collection
<
VcsRoot
>
roots
)
{
public
VcsLogManager
(
@NotNull
Project
project
,
@NotNull
VcsLogTabsProperties
uiProperties
,
@NotNull
Collection
<
VcsRoot
>
roots
)
{
this
(
project
,
uiProperties
,
roots
,
true
,
null
);
}
public
VcsLogManager
(
@NotNull
Project
project
,
@NotNull
VcsLog
Project
TabsProperties
uiProperties
,
@NotNull
VcsLogTabsProperties
uiProperties
,
@NotNull
Collection
<
VcsRoot
>
roots
,
boolean
scheduleRefreshImmediately
,
@Nullable
Consumer
<
Throwable
>
recreateHandler
)
{
...
...
@@ -96,7 +96,7 @@ public class VcsLogManager implements Disposable {
}
@NotNull
public
VcsLog
Project
TabsProperties
getUiProperties
()
{
public
VcsLogTabsProperties
getUiProperties
()
{
return
myUiProperties
;
}
...
...
This diff is collapsed.
Click to expand it.
platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogProjectTabsProperties.java
+
2
-
1
View file @
088ae2cb
...
...
@@ -17,7 +17,7 @@ import static com.intellij.util.containers.ContainerUtil.*;
import
static
java
.
util
.
Comparator
.
comparingInt
;
@State
(
name
=
"Vcs.Log.Tabs.Properties"
,
storages
=
{
@Storage
(
file
=
StoragePathMacros
.
WORKSPACE_FILE
)})
public
class
VcsLogProjectTabsProperties
implements
PersistentStateComponent
<
VcsLogProjectTabsProperties
.
State
>
{
public
class
VcsLogProjectTabsProperties
implements
PersistentStateComponent
<
VcsLogProjectTabsProperties
.
State
>
,
VcsLogTabsProperties
{
public
static
final
String
MAIN_LOG_ID
=
"MAIN"
;
private
static
final
int
RECENTLY_FILTERED_VALUES_LIMIT
=
10
;
@NotNull
private
final
VcsLogApplicationSettings
myAppSettings
;
...
...
@@ -65,6 +65,7 @@ public class VcsLogProjectTabsProperties implements PersistentStateComponent<Vcs
}
}
@Override
@NotNull
public
MainVcsLogUiProperties
createProperties
(
@NotNull
final
String
id
)
{
myState
.
TAB_STATES
.
putIfAbsent
(
id
,
new
VcsLogUiPropertiesImpl
.
State
());
...
...
This diff is collapsed.
Click to expand it.
platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogTabsManager.java
+
6
-
7
View file @
088ae2cb
...
...
@@ -14,12 +14,15 @@ import java.util.List;
public
class
VcsLogTabsManager
{
@NotNull
private
final
Project
myProject
;
@NotNull
private
final
VcsLogProjectTabsProperties
myUiProperties
;
private
boolean
myIsLogDisposing
=
false
;
public
VcsLogTabsManager
(
@NotNull
Project
project
,
@NotNull
MessageBus
messageBus
,
@NotNull
VcsLogProjectTabsProperties
uiProperties
,
@NotNull
Disposable
parent
)
{
myProject
=
project
;
myUiProperties
=
uiProperties
;
messageBus
.
connect
(
parent
).
subscribe
(
VcsProjectLog
.
VCS_PROJECT_LOG_CHANGED
,
new
VcsProjectLog
.
ProjectLogListener
()
{
@Override
...
...
@@ -37,7 +40,7 @@ public class VcsLogTabsManager {
@CalledInAwt
private
void
createLogTabs
(
@NotNull
VcsLogManager
manager
)
{
List
<
String
>
tabIds
=
m
anager
.
get
UiProperties
()
.
getTabs
();
List
<
String
>
tabIds
=
m
y
UiProperties
.
getTabs
();
for
(
String
tabId
:
tabIds
)
{
openLogTab
(
manager
,
tabId
,
false
);
}
...
...
@@ -48,19 +51,15 @@ public class VcsLogTabsManager {
}
private
void
openLogTab
(
@NotNull
VcsLogManager
manager
,
@NotNull
String
tabId
,
boolean
focus
)
{
VcsLogManager
.
VcsLogUiFactory
<?
extends
VcsLogUiImpl
>
factory
=
new
PersistentVcsLogUiFactory
(
manager
.
getMainLogUiFactory
(
tabId
),
manager
.
getUiProperties
());
VcsLogManager
.
VcsLogUiFactory
<?
extends
VcsLogUiImpl
>
factory
=
new
PersistentVcsLogUiFactory
(
manager
.
getMainLogUiFactory
(
tabId
));
VcsLogContentUtil
.
openLogTab
(
myProject
,
manager
,
VcsLogContentProvider
.
TAB_NAME
,
tabId
,
factory
,
focus
);
}
private
class
PersistentVcsLogUiFactory
implements
VcsLogManager
.
VcsLogUiFactory
<
VcsLogUiImpl
>
{
private
final
VcsLogManager
.
VcsLogUiFactory
<?
extends
VcsLogUiImpl
>
myFactory
;
@NotNull
private
final
VcsLogProjectTabsProperties
myUiProperties
;
public
PersistentVcsLogUiFactory
(
@NotNull
VcsLogManager
.
VcsLogUiFactory
<?
extends
VcsLogUiImpl
>
factory
,
@NotNull
VcsLogProjectTabsProperties
properties
)
{
public
PersistentVcsLogUiFactory
(
@NotNull
VcsLogManager
.
VcsLogUiFactory
<?
extends
VcsLogUiImpl
>
factory
)
{
myFactory
=
factory
;
myUiProperties
=
properties
;
}
@Override
...
...
This diff is collapsed.
Click to expand it.
platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogTabsProperties.java
0 → 100644
+
9
-
0
View file @
088ae2cb
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package
com.intellij.vcs.log.impl
;
import
org.jetbrains.annotations.NotNull
;
public
interface
VcsLogTabsProperties
{
@NotNull
MainVcsLogUiProperties
createProperties
(
@NotNull
String
id
);
}
This diff is collapsed.
Click to expand it.
platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java
+
2
-
2
View file @
088ae2cb
...
...
@@ -47,7 +47,7 @@ public class VcsProjectLog implements Disposable {
private
static
final
int
RECREATE_LOG_TRIES
=
5
;
@NotNull
private
final
Project
myProject
;
@NotNull
private
final
MessageBus
myMessageBus
;
@NotNull
private
final
VcsLog
Project
TabsProperties
myUiProperties
;
@NotNull
private
final
VcsLogTabsProperties
myUiProperties
;
@NotNull
private
final
VcsLogTabsManager
myTabsManager
;
@NotNull
...
...
@@ -60,7 +60,7 @@ public class VcsProjectLog implements Disposable {
myProject
=
project
;
myMessageBus
=
messageBus
;
myUiProperties
=
uiProperties
;
myTabsManager
=
new
VcsLogTabsManager
(
project
,
messageBus
,
this
);
myTabsManager
=
new
VcsLogTabsManager
(
project
,
messageBus
,
uiProperties
,
this
);
}
@Nullable
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help