File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
heapviewer/src/org/graalvm/visualvm/heapviewer/java/impl
libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/components Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,7 @@ static String getThreadsHTML(HeapContext context) {
198
198
JavaClass javaClassClass = heap .getJavaClassByName (Class .class .getName ());
199
199
// Use this to enable VisualVM color scheme for threads dumps:
200
200
// sw.append("<pre style='color: #cc3300;'>"); // NOI18N
201
+ sb .append ("<head><style>span.g {color: #666666;}</style></head>" );
201
202
sb .append ("<pre>" ); // NOI18N
202
203
for (GCRoot root : roots ) {
203
204
if (root .getKind ().equals (GCRoot .THREAD_OBJECT )) {
@@ -255,15 +256,15 @@ static String getThreadsHTML(HeapContext context) {
255
256
} else if (GCRoot .JNI_LOCAL .equals (local .getKind ())) {
256
257
text = Bundle .JavaThreadsProvider_JniLocal ();
257
258
}
258
- sb .append (" <span style =\" color: #666666 \" >" + text + ":</span> " ).append (HeapUtils .instanceToHtml (localInstance , false , javaClassClass )).append ("<br>" ); // NOI18N
259
+ sb .append (" <span class =\" g \" >" + text + ":</span> " ).append (HeapUtils .instanceToHtml (localInstance , false , javaClassClass )).append ("<br>" ); // NOI18N
259
260
} else {
260
261
String text = "" ;
261
262
if (GCRoot .JAVA_FRAME .equals (local .getKind ())) {
262
263
text = Bundle .JavaThreadsProvider_UnknownLocalVariable ();
263
264
} else if (GCRoot .JNI_LOCAL .equals (local .getKind ())) {
264
265
text = Bundle .JavaThreadsProvider_UnknownJniLocal ();
265
266
}
266
- sb .append (" <span style =\" color: #666666 \" >" + text + "</span><br>" ); // NOI18N
267
+ sb .append (" <span class =\" g \" >" + text + "</span><br>" ); // NOI18N
267
268
}
268
269
}
269
270
}
Original file line number Diff line number Diff line change @@ -653,8 +653,14 @@ public void setText(String value) {
653
653
value = value .replaceAll ("\\ n\\ r|\\ r\\ n|\\ n|\\ r" , "<br>" ); //NOI18N
654
654
value = value .replace ("<code>" , "<code style=\" font-size: " + font .getSize () + "pt;\" >" ); //NOI18N
655
655
656
+ int index = getHeaderEndIndex (value );
657
+ String header = "" ;
658
+ if (index != -1 ) {
659
+ header = value .substring (0 , index );
660
+ value = value .substring (index );
661
+ }
656
662
String colorText = "rgb(" + textColor .getRed () + "," + textColor .getGreen () + "," + textColor .getBlue () + ")" ; //NOI18N
657
- String newText = "<html><body text=\" " + colorText + "\" style=\" font-size: " + font .getSize () + //NOI18N
663
+ String newText = "<html>" + header + " <body text=\" " + colorText + "\" style=\" font-size: " + font .getSize () + //NOI18N
658
664
"pt; font-family: " + font .getName () + ";\" >" + value + "</body></html>" ; //NOI18N
659
665
660
666
setDocument (getEditorKit ().createDefaultDocument ()); // Workaround for http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5042872
@@ -866,4 +872,10 @@ protected void showURL(URL url) {
866
872
// override to react to URL clicks
867
873
}
868
874
875
+ private static int getHeaderEndIndex (String htmlText ) {
876
+ if (htmlText .startsWith ("<head>" )) {
877
+ return htmlText .indexOf ("</head>" )+"</head>" .length ();
878
+ }
879
+ return -1 ;
880
+ }
869
881
}
You can’t perform that action at this time.
0 commit comments