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
9816a8be
Unverified
Commit
9816a8be
authored
7 years ago
by
Vladimir Krivosheev
Browse files
Options
Download
Email Patches
Plain Diff
reduce findConfigurationByName
parent
8d1c8cf2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
platform/lang-api/src/com/intellij/execution/RunManager.kt
+2
-0
platform/lang-api/src/com/intellij/execution/RunManager.kt
platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.kt
+4
-0
...ng-impl/src/com/intellij/execution/impl/RunManagerImpl.kt
platform/testFramework/src/com/intellij/mock/MockRunManager.kt
+2
-0
...orm/testFramework/src/com/intellij/mock/MockRunManager.kt
plugins/coverage-common/src/com/intellij/coverage/view/CoverageView.java
+8
-10
...e-common/src/com/intellij/coverage/view/CoverageView.java
with
16 additions
and
10 deletions
+16
-10
platform/lang-api/src/com/intellij/execution/RunManager.kt
+
2
-
0
View file @
9816a8be
...
...
@@ -202,6 +202,8 @@ abstract class RunManager {
abstract
fun
findConfigurationByName
(
name
:
String
?):
RunnerAndConfigurationSettings
?
abstract
fun
findSettings
(
configuration
:
RunConfiguration
):
RunnerAndConfigurationSettings
?
fun
findConfigurationByTypeAndName
(
typeId
:
String
,
name
:
String
)
=
allSettings
.
firstOrNull
{
typeId
==
it
.
type
.
id
&&
name
==
it
.
name
}
fun
findConfigurationByTypeAndName
(
type
:
ConfigurationType
?,
name
:
String
)
=
type
?.
let
{
findConfigurationByTypeAndName
(
it
.
id
,
name
)
}
...
...
This diff is collapsed.
Click to expand it.
platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.kt
+
4
-
0
View file @
9816a8be
...
...
@@ -849,6 +849,10 @@ open class RunManagerImpl(internal val project: Project) : RunManagerEx(), Persi
return
allSettings
.
firstOrNull
{
it
.
name
==
name
}
}
override
fun
findSettings
(
configuration
:
RunConfiguration
):
RunnerAndConfigurationSettings
?
{
return
allSettings
.
firstOrNull
{
it
.
configuration
===
configuration
}
?:
findConfigurationByName
(
configuration
.
name
)
}
override
fun
<
T
:
BeforeRunTask
<
*
>>
getBeforeRunTasks
(
settings
:
RunConfiguration
,
taskProviderId
:
Key
<
T
>):
List
<
T
>
{
if
(
settings
is
WrappingRunConfiguration
<
*
>)
{
return
getBeforeRunTasks
(
settings
.
peer
,
taskProviderId
)
...
...
This diff is collapsed.
Click to expand it.
platform/testFramework/src/com/intellij/mock/MockRunManager.kt
+
2
-
0
View file @
9816a8be
...
...
@@ -13,6 +13,8 @@ import com.intellij.openapi.util.Key
import
javax.swing.Icon
class
MockRunManager
:
RunManagerEx
()
{
override
fun
findSettings
(
configuration
:
RunConfiguration
):
RunnerAndConfigurationSettings
?
=
null
override
fun
getConfigurationType
(
typeName
:
String
)
=
TODO
(
"not implemented"
)
override
fun
hasSettings
(
settings
:
RunnerAndConfigurationSettings
)
=
false
...
...
This diff is collapsed.
Click to expand it.
plugins/coverage-common/src/com/intellij/coverage/view/CoverageView.java
+
8
-
10
View file @
9816a8be
/*
* Copyright 2000-2017 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.
*/
// 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.coverage.view
;
import
com.intellij.CommonBundle
;
...
...
@@ -52,7 +50,7 @@ public class CoverageView extends BorderLayoutPanel implements DataProvider, Dis
private
final
CoverageViewBuilder
myBuilder
;
private
final
Project
myProject
;
private
final
CoverageViewManager
.
StateBean
myStateBean
;
public
CoverageView
(
final
Project
project
,
final
CoverageDataManager
dataManager
,
CoverageViewManager
.
StateBean
stateBean
)
{
myProject
=
project
;
...
...
@@ -70,12 +68,12 @@ public class CoverageView extends BorderLayoutPanel implements DataProvider, Dis
emptyText
.
appendText
(
" Click "
);
emptyText
.
appendText
(
"Edit"
,
SimpleTextAttributes
.
LINK_ATTRIBUTES
,
new
ActionListener
()
{
public
void
actionPerformed
(
final
ActionEvent
e
)
{
final
String
configurationName
=
configuration
.
getName
();
final
RunnerAndConfigurationSettings
configurationSettings
=
RunManager
.
getInstance
(
project
).
findConfigurationByName
(
configurationName
);
final
RunnerAndConfigurationSettings
configurationSettings
=
RunManager
.
getInstance
(
project
).
findSettings
(
configuration
);
if
(
configurationSettings
!=
null
)
{
RunDialog
.
editConfiguration
(
project
,
configurationSettings
,
"Edit Run Configuration"
);
}
else
{
Messages
.
showErrorDialog
(
project
,
"Configuration \'"
+
configurationName
+
"\' was not found"
,
CommonBundle
.
getErrorTitle
());
}
else
{
Messages
.
showErrorDialog
(
project
,
"Configuration \'"
+
configuration
.
getName
()
+
"\' was not found"
,
CommonBundle
.
getErrorTitle
());
}
}
});
...
...
@@ -208,7 +206,7 @@ public class CoverageView extends BorderLayoutPanel implements DataProvider, Dis
public
void
updateParentTitle
()
{
myBuilder
.
updateParentTitle
();
}
private
AbstractTreeNode
getSelectedValue
()
{
return
(
AbstractTreeNode
)
myBuilder
.
getSelectedValue
();
}
...
...
@@ -286,7 +284,7 @@ public class CoverageView extends BorderLayoutPanel implements DataProvider, Dis
myBuilder
.
updateParentTitle
();
}
}
private
class
GoUpAction
extends
DumbAwareAction
{
private
final
CoverageViewTreeStructure
myTreeStructure
;
...
...
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