Skip to content

Commit c46360e

Browse files
committed
4819: Improved tooltips and context menus for Stack Trace View
Reviewed-by: hirt
1 parent 849c9dd commit c46360e

File tree

6 files changed

+21
-12
lines changed
  • application
    • l10n
      • org.openjdk.jmc.flightrecorder.ui.ja/src/main/resources/org/openjdk/jmc/flightrecorder/ui/messages/internal
      • org.openjdk.jmc.flightrecorder.ui.zh_CN/src/main/resources/org/openjdk/jmc/flightrecorder/ui/messages/internal
    • org.openjdk.jmc.flightrecorder.ui/src/main
    • uitests/org.openjdk.jmc.test.jemmy/src/test/java/org/openjdk/jmc/test/jemmy/misc/wrappers

6 files changed

+21
-12
lines changed

application/l10n/org.openjdk.jmc.flightrecorder.ui.ja/src/main/resources/org/openjdk/jmc/flightrecorder/ui/messages/internal/messages_ja.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ STACKTRACE_VIEW_GROUP_TRACES_FROM_ROOT=\u30B9\u30EC\u30C3\u30C9\u30FB\u30EB\u30F
433433
STACKTRACE_VIEW_LAST_FRAME=\u6700\u7D42\u30D5\u30EC\u30FC\u30E0
434434
STACKTRACE_VIEW_LAYOUT_OPTIONS=\u30EC\u30A4\u30A2\u30A6\u30C8\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3
435435
STACKTRACE_VIEW_SELECTION=\u30B9\u30BF\u30C3\u30AF\u30FB\u30C8\u30EC\u30FC\u30B9\u30FB\u30D3\u30E5\u30FC\u306E\u9078\u629E
436-
STACKTRACE_VIEW_SHOW_AS_TREE=\u30C4\u30EA\u30FC\u3067\u8868\u793A
436+
STACKTRACE_VIEW_TREE_VIEW=\u30C4\u30EA\u30FC\u3067\u8868\u793A
437437
STACKTRACE_VIEW_STACK_TRACE=\u30B9\u30BF\u30C3\u30AF\u30FB\u30C8\u30EC\u30FC\u30B9
438438
STACKTRACE_VIEW_OPTIMIZATION_TYPE=\u6700\u9069\u5316\u30BF\u30A4\u30D7
439439
STACKTRACE_VIEW_REDUCE_TREE_DEPTH=\u30C4\u30EA\u30FC\u306E\u6DF1\u3055\u306E\u524A\u6E1B

application/l10n/org.openjdk.jmc.flightrecorder.ui.zh_CN/src/main/resources/org/openjdk/jmc/flightrecorder/ui/messages/internal/messages_zh_CN.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ STACKTRACE_VIEW_GROUP_TRACES_FROM_ROOT=\u7EC4\u8DDF\u8E2A\u81EA\u7EBF\u7A0B\u683
433433
STACKTRACE_VIEW_LAST_FRAME=\u4E0A\u4E00\u4E2A\u5E27
434434
STACKTRACE_VIEW_LAYOUT_OPTIONS=\u5E03\u5C40\u9009\u9879
435435
STACKTRACE_VIEW_SELECTION=\u5806\u6808\u8DDF\u8E2A\u89C6\u56FE\u9009\u62E9
436-
STACKTRACE_VIEW_SHOW_AS_TREE=\u663E\u793A\u4E3A\u6811
436+
STACKTRACE_VIEW_TREE_VIEW=\u663E\u793A\u4E3A\u6811
437437
STACKTRACE_VIEW_STACK_TRACE=\u5806\u6808\u8DDF\u8E2A
438438
STACKTRACE_VIEW_OPTIMIZATION_TYPE=\u4F18\u5316\u7C7B\u578B
439439
STACKTRACE_VIEW_REDUCE_TREE_DEPTH=\u51CF\u5C11\u6811\u6DF1\u5EA6

application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/messages/internal/Messages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ public class Messages extends NLS {
463463
public static String STACKTRACE_VIEW_OPTIMIZATION_TYPE;
464464
public static String STACKTRACE_VIEW_REDUCE_TREE_DEPTH;
465465
public static String STACKTRACE_VIEW_SELECTION;
466-
public static String STACKTRACE_VIEW_SHOW_AS_TREE;
466+
public static String STACKTRACE_VIEW_TREE_VIEW;
467467
public static String STACKTRACE_VIEW_STACK_TRACE;
468468
public static String STACKTRACE_VIEW_THREAD_ROOT;
469469
public static String STACKTRACE_VIEW_TRACES_IN_GROUP;

application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/views/stacktrace/StacktraceView.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ public void run() {
193193
private ColumnViewer viewer;
194194
private boolean treeLayout;
195195
private boolean reducedTree;
196+
private IAction reducedTreeAction;
196197
private boolean threadRootAtTop;
197198
private IItemCollection itemsToShow;
198199
private MethodFormatter methodFormatter;
@@ -361,6 +362,11 @@ public void keyTraversed(TraverseEvent e) {
361362

362363
};
363364

365+
private void updateReducedTreeOption() {
366+
reducedTreeAction.setEnabled(treeLayout);
367+
reducedTreeAction.setChecked(reducedTree);
368+
}
369+
364370
@Override
365371
public void init(IViewSite site, IMemento memento) throws PartInitException {
366372
super.init(site, memento);
@@ -370,10 +376,11 @@ public void init(IViewSite site, IMemento memento) throws PartInitException {
370376
treeLayout = StateToolkit.readBoolean(state, TREE_LAYOUT_KEY, false);
371377
reducedTree = StateToolkit.readBoolean(state, REDUCED_TREE_KEY, true);
372378

373-
IAction reducedTreeAction = ActionToolkit.checkAction(this::setReducedTree,
374-
Messages.STACKTRACE_VIEW_REDUCE_TREE_DEPTH, null);
375-
reducedTreeAction.setChecked(reducedTree);
376-
IAction treeAction = ActionToolkit.checkAction(this::setTreeLayout, Messages.STACKTRACE_VIEW_SHOW_AS_TREE,
379+
reducedTreeAction = ActionToolkit.checkAction(this::setReducedTree, Messages.STACKTRACE_VIEW_REDUCE_TREE_DEPTH,
380+
null);
381+
updateReducedTreeOption();
382+
383+
IAction treeAction = ActionToolkit.checkAction(this::setTreeLayout, Messages.STACKTRACE_VIEW_TREE_VIEW,
377384
CoreImages.TREE_MODE);
378385
treeAction.setChecked(treeLayout);
379386
layoutActions = new IAction[] {treeAction, reducedTreeAction};
@@ -431,13 +438,15 @@ public void createPartControl(Composite parent) {
431438
private void setTreeLayout(boolean treeLayout) {
432439
this.treeLayout = treeLayout;
433440
rebuildViewer();
441+
updateReducedTreeOption();
434442
}
435443

436444
private void setReducedTree(boolean reducedTree) {
437445
this.reducedTree = reducedTree;
438446
if (viewer instanceof TreeViewer) {
439447
viewer.setContentProvider(createTreeContentProvider());
440448
}
449+
updateReducedTreeOption();
441450
}
442451

443452
// See JMC-6787

application/org.openjdk.jmc.flightrecorder.ui/src/main/resources/org/openjdk/jmc/flightrecorder/ui/messages/internal/messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ STACKTRACE_VIEW_GROUP_TRACES_FROM_ROOT=Group traces from thread root
442442
STACKTRACE_VIEW_LAST_FRAME=Last Frame
443443
STACKTRACE_VIEW_LAYOUT_OPTIONS=Layout Options
444444
STACKTRACE_VIEW_SELECTION=Stack Trace View Selection
445-
STACKTRACE_VIEW_SHOW_AS_TREE=Show as Tree
445+
STACKTRACE_VIEW_TREE_VIEW=Tree View
446446
STACKTRACE_VIEW_STACK_TRACE=Stack Trace
447447
STACKTRACE_VIEW_OPTIMIZATION_TYPE=Optimization Type
448448
STACKTRACE_VIEW_REDUCE_TREE_DEPTH=Reduce Tree Depth

application/uitests/org.openjdk.jmc.test.jemmy/src/test/java/org/openjdk/jmc/test/jemmy/misc/wrappers/JfrStackTrace.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class JfrStackTrace extends MCJemmyBase {
6161
private String FRAME_GROUP = "Choose Frame Group";
6262
private String PREVIOUS = "Previous Frame Group";
6363
private String NEXT = "Next Frame Group";
64-
private String TREE = "Show as Tree";
64+
private String TREE = "Tree View";
6565
private String GROUP_METHOD = "Group traces from last method";
6666
private String GROUP_ROOT = "Group traces from thread root";
6767

@@ -392,7 +392,7 @@ public void clickNextFrameGroupButton() {
392392
}
393393

394394
/**
395-
* Clicks the button "Show as Tree" in the toolbar
395+
* Clicks the button "Tree View" in the toolbar
396396
*/
397397
public void clickShowAsTreeButton() {
398398
toolBar.clickToolItem(TREE);
@@ -428,7 +428,7 @@ public void setChooseFrameGroup(Boolean state) {
428428
}
429429

430430
/**
431-
* Makes sure that the the state of the Show as tree mode corresponds with the provided value.
431+
* Makes sure that the the state of the "Tree View" mode corresponds with the provided value.
432432
*
433433
* @param state
434434
* {@code true} if the stack trace should be displayed as a tree, {@code false} if it
@@ -444,7 +444,7 @@ public void setViewAsTree(Boolean state) {
444444
}
445445

446446
/**
447-
* Checks if the "Show as Tree" button in the toolbar is enabled.
447+
* Checks if the "Tree View" button in the toolbar is enabled.
448448
*
449449
* @return {@code true} if enabled, {@code false} if not
450450
*/

0 commit comments

Comments
 (0)