Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
58af520e
Commit
58af520e
authored
6 years ago
by
Ivan Migalev
Browse files
Options
Download
Email Patches
Plain Diff
Make BrowseHierarchyActionBase responsible for component disposal
parent
29354033
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
platform/lang-impl/src/com/intellij/ide/hierarchy/actions/BrowseHierarchyActionBase.java
+5
-1
...llij/ide/hierarchy/actions/BrowseHierarchyActionBase.java
platform/platform-api/src/com/intellij/openapi/project/DumbUnawareHider.java
+1
-10
...pi/src/com/intellij/openapi/project/DumbUnawareHider.java
with
6 additions
and
11 deletions
+6
-11
platform/lang-impl/src/com/intellij/ide/hierarchy/actions/BrowseHierarchyActionBase.java
+
5
-
1
View file @
58af520e
...
...
@@ -10,6 +10,7 @@ import com.intellij.openapi.Disposable;
import
com.intellij.openapi.actionSystem.*
;
import
com.intellij.openapi.diagnostic.Logger
;
import
com.intellij.openapi.project.DumbService
;
import
com.intellij.openapi.project.DumbUnawareHider
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.util.Disposer
;
import
com.intellij.openapi.wm.ToolWindowId
;
...
...
@@ -74,7 +75,10 @@ public abstract class BrowseHierarchyActionBase extends AnAction {
if
(
selectedContent
!=
null
&&
!
selectedContent
.
isPinned
())
{
content
=
selectedContent
;
final
Component
component
=
content
.
getComponent
();
Component
component
=
content
.
getComponent
();
if
(
component
instanceof
DumbUnawareHider
)
{
component
=
((
DumbUnawareHider
)
component
).
getContent
();
}
if
(
component
instanceof
Disposable
)
{
Disposer
.
dispose
((
Disposable
)
component
);
}
...
...
This diff is collapsed.
Click to expand it.
platform/platform-api/src/com/intellij/openapi/project/DumbUnawareHider.java
+
1
-
10
View file @
58af520e
...
...
@@ -16,8 +16,6 @@
package
com.intellij.openapi.project
;
import
com.intellij.openapi.Disposable
;
import
com.intellij.openapi.util.Disposer
;
import
com.intellij.ui.components.JBPanelWithEmptyText
;
import
org.jetbrains.annotations.NotNull
;
...
...
@@ -27,7 +25,7 @@ import java.awt.*;
/**
* @author peter
*/
public
class
DumbUnawareHider
extends
JBPanelWithEmptyText
implements
Disposable
{
public
class
DumbUnawareHider
extends
JBPanelWithEmptyText
{
private
final
JComponent
myDumbUnawareContent
;
...
...
@@ -47,11 +45,4 @@ public class DumbUnawareHider extends JBPanelWithEmptyText implements Disposable
getComponent
(
i
).
setVisible
(
show
);
}
}
@Override
public
void
dispose
()
{
if
(
myDumbUnawareContent
instanceof
Disposable
)
{
Disposer
.
dispose
((
Disposable
)
myDumbUnawareContent
);
}
}
}
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