Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK-8293364: IGV: Refactor Action in EditorTopComponent and fix minor bugs #10170

Closed
wants to merge 35 commits into from

Conversation

tobiasholenstein
Copy link
Contributor

@tobiasholenstein tobiasholenstein commented Sep 5, 2022

Refactor the Actions in EditorTopComponent (com.sun.hotspot.igv.view.actions). Move Action specific code from EditorTopComponent to the corresponding Action.

Refactoring of com.sun.hotspot.igv.view.actions and EditorTopComponent

  • Created a new ExportGraph Action and moved corresponding functions exportToSVG(..) and exportToPDF(..) to new ExportGraph.java
  • Moved key bindings for satellite-view (pressing S) from EditorTopComponent to OverviewAction.java
  • Moved Action specific code from EditorTopComponent to the corresponding XXXAction.java
  • Changed PrevDiagramAction, ExpandDiffAction, ExtractAction, HideAction, NextDiagramAction, ReduceDiffAction and ShowAllAction to be context aware ContextAction<DiagramViewModel> actions and use more modern @ActionRegistration to move away from manually defining actions in layer.xml
  • new addContextListener / removeContextListener function in ContextAction<T> enables context aware actions to define to which ChangedEvent they want to react to

Fixing minor Bugs

  • "Show empty blocks in control-flow graph view" is selected by default but only enabled in CFG view.
    This is distracting for the eye when we are not in CFG:

cfg_before

Now "Show empty blocks in control-flow graph view" is not selected anymore when disabled (greyed out)

cfg_node_disable

But still gets selected by default when enabled

cfg_now

  • "Extract current set of selected nodes", "Hide selected nodes" and "show all nodes" were always enabled, even when they didn't effect anything.

selection_before

Now "Extract current set of selected nodes", "Hide selected nodes" are disabled (greyed out) when no nodes are selected. And "show all nodes" is disabled (greyed out) when all nodes are already visible.

selection_now

  • "Reduce the difference selection" got stuck when at the last graphs in the group because it got greyed out.

reduce_stuck

duce the difference selection" Now "Reduce the difference selection" works as expected:

reduce_now


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8293364: IGV: Refactor Action in EditorTopComponent and fix minor bugs

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10170/head:pull/10170
$ git checkout pull/10170

Update a local copy of the PR:
$ git checkout pull/10170
$ git pull https://git.openjdk.org/jdk pull/10170/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10170

View PR using the GUI difftool:
$ git pr show -t 10170

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10170.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 5, 2022

👋 Welcome back tholenstein! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 5, 2022

@tobiasholenstein The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Sep 5, 2022
@tobiasholenstein tobiasholenstein marked this pull request as ready for review September 5, 2022 14:23
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 5, 2022
@mlbridge
Copy link

mlbridge bot commented Sep 5, 2022

Copy link
Contributor

@robcasloz robcasloz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changeset seems to disable the keyboard shortcuts for Extract, Show all nodes, and Hide right after a graph is opened. Interestingly, after clicking around for a while, the keyboard shortcuts start working again. Please let me know if you need more details to reproduce the problem, hopefully it is reproducible in other platforms than my own (Ubuntu 20.04).

@openjdk-notifier
Copy link

@tobiasholenstein Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information.

Copy link
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only have some code style specific comments. Otherwise, good cleanup!

@tobiasholenstein
Copy link
Contributor Author

@chhagedorn I integrated your suggestions now

@openjdk
Copy link

openjdk bot commented Sep 21, 2022

@tobiasholenstein this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JDK-8293364
git fetch https://git.openjdk.org/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch and removed ready Pull request is ready to be integrated labels Sep 21, 2022
@openjdk openjdk bot added ready Pull request is ready to be integrated and removed merge-conflict Pull request has merge conflict with target branch labels Sep 21, 2022
Copy link
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing the suggested updates. Apart from two small things, it looks good to me!

@tobiasholenstein
Copy link
Contributor Author

@chhagedorn and @robcasloz thanks for the reviews!

/integrate

@openjdk
Copy link

openjdk bot commented Sep 21, 2022

Going to push as commit e9401e6.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 21, 2022
@openjdk openjdk bot closed this Sep 21, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 21, 2022
@openjdk
Copy link

openjdk bot commented Sep 21, 2022

@tobiasholenstein Pushed as commit e9401e6.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@tobiasholenstein tobiasholenstein deleted the JDK-8293364 branch October 3, 2022 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
3 participants