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
b3756154
Commit
b3756154
authored
6 years ago
by
Denis Fokin
Browse files
Options
Download
Email Patches
Plain Diff
Make it scrollable
parent
1990d312
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
platform/platform-impl/src/com/intellij/internal/focus/DumpFocusableComponentHierarchyAction.java
+14
-8
...internal/focus/DumpFocusableComponentHierarchyAction.java
with
14 additions
and
8 deletions
+14
-8
platform/platform-impl/src/com/intellij/internal/focus/DumpFocusableComponentHierarchyAction.java
+
14
-
8
View file @
b3756154
...
...
@@ -6,6 +6,7 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
import
com.intellij.openapi.project.DumbAware
;
import
com.intellij.openapi.wm.WindowManager
;
import
com.intellij.ui.JBColor
;
import
com.intellij.ui.components.JBScrollPane
;
import
org.jetbrains.annotations.NotNull
;
import
javax.swing.*
;
...
...
@@ -48,15 +49,15 @@ public class DumpFocusableComponentHierarchyAction extends AnAction implements D
dump
.
add
(
"Children count in focused component: "
+
(
focusedComponent
==
null
?
"null"
:
((
JComponent
)
focusedComponent
).
getComponentCount
()));
int
FONT_HEIGHT
=
30
;
JPanel
jPanel
=
new
JPanel
(
new
BorderLayout
())
{
@Override
protected
void
paintComponent
(
Graphics
g
)
{
super
.
paintComponent
(
g
);
int
FONT_HEIGHT
=
30
;
g
.
setColor
(
JBColor
.
BLACK
);
g
.
fillRect
(
0
,
0
,
activeWindow
.
getBounds
().
width
,
activeWindow
.
getBounds
().
height
);
g
.
fillRect
(
0
,
0
,
getBounds
().
width
,
getBounds
().
height
);
g
.
setColor
(
JBColor
.
WHITE
);
for
(
int
i
=
dump
.
size
()
-
1
;
i
>=
0
;
i
--)
{
...
...
@@ -65,21 +66,26 @@ public class DumpFocusableComponentHierarchyAction extends AnAction implements D
}
};
jPanel
.
setPreferredSize
(
visibleFrame
.
getSize
());
jPanel
.
setPreferredSize
(
new
Dimension
(
visibleFrame
.
getWidth
(),
dump
.
size
()
*
FONT_HEIGHT
+
200
));
JScrollPane
scrollPane
=
new
JBScrollPane
(
jPanel
);
scrollPane
.
setPreferredSize
(
visibleFrame
.
getSize
());
Popup
popup
=
PopupFactory
.
getSharedInstance
().
getPopup
(
visibleFrame
,
j
Pane
l
,
visibleFrame
.
getX
(),
visibleFrame
.
getY
());
Popup
popup
=
PopupFactory
.
getSharedInstance
().
getPopup
(
visibleFrame
,
scroll
Pane
,
visibleFrame
.
getX
(),
visibleFrame
.
getY
());
popup
.
show
();
jPanel
.
add
(
new
JButton
(
new
AbstractAction
(
"Close and copy into the clipboard"
)
{
JButton
closeButton
=
new
JButton
(
new
AbstractAction
(
"Close and copy into the clipboard"
)
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
StringBuilder
dumpAsString
=
new
StringBuilder
();
for
(
int
i
=
dump
.
size
()
-
1
;
i
>=
0
;
i
--)
{
for
(
int
i
=
dump
.
size
()
-
1
;
i
>=
0
;
i
--)
{
dumpAsString
.
append
(
dump
.
get
(
i
)).
append
(
"\n"
);
}
Toolkit
.
getDefaultToolkit
().
getSystemClipboard
().
setContents
(
new
StringSelection
(
dumpAsString
.
toString
()),
null
);
popup
.
hide
();
}
}),
BorderLayout
.
SOUTH
);
});
jPanel
.
add
(
closeButton
,
BorderLayout
.
SOUTH
);
}
}
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