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

NETBEANS-888 Open Recent file not working #1216

Conversation

@michaelsembwever
Copy link
Member

commented Apr 24, 2019

  • update menuItems under RecentFileAction via a RecentFiles property change listener, rather than popup menu listener
@geertjanw

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

Wow, cool. Why was this needed, why did it work in earlier releases but not anymore requiring this PR? Thanks for this great work.

@michaelsembwever

This comment has been minimized.

Copy link
Member Author

commented Apr 25, 2019

@geertjanw ,

Wow, cool. Why was this needed, why did it work in earlier releases but not anymore requiring this PR? Thanks for this great work.

I suspect it never worked on the combination of

  • macos
  • apple.laf.useScreenMenuBar=true
  • jdk >1.8 (currently experiencing it with 11.0.3)

and that these users using Java9 or above is a relatively new phenomena.

@geertjanw

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

So it was macos specific, didn't know that. And also related to some change in the JDK after 1.8, but what could it be (just curious really).

@michaelsembwever

This comment has been minimized.

Copy link
Member Author

commented Apr 25, 2019

@geertjanw ,

So it was macos specific, didn't know that. And also related to some change in the JDK after 1.8, but what could it be (just curious really).

I didn't (don't) have the time to hunt that down.
The existing code was recreating the menuItems every time the popup menu listener declared (notified) that the jmenuitem was made visible. The ScreenMenuItems was then without reference back to these menuItems, and so there's was no actionListener and the event was not enabled.

Changing it so that the menuItems were only recreated when the history in RecentFiles changed, solved the problem, probably because the ScreenMenuItems <-> menuItem referencing is done before the popup menu change support kicks in, but that's just a guess.

There's a bit more of my analysis info in https://issues.apache.org/jira/browse/NETBEANS-888

NETBEANS-888 Open Recent file not working
 - update menuItems under RecentFileAction via a RecentFiles property change listener, rather than popup menu listener

@michaelsembwever michaelsembwever force-pushed the michaelsembwever:mck/NETBEANS-888-open-recent-file-not-working branch from 472ac61 to d95c095 May 2, 2019

@michaelsembwever

This comment has been minimized.

Copy link
Member Author

commented May 2, 2019

@geertjanw ping.

@GeertjanWielenga

This comment has been minimized.

Copy link

commented May 2, 2019

Sure, how ready is this for merging? Happy to merge if you’re confident about this pr.

@michaelsembwever

This comment has been minimized.

Copy link
Member Author

commented May 2, 2019

I've been using it now the past week.
I don't have the swing/netbeans expertise in this area to see all the possible side-cases, but it comes across as relatively straight-forward and fixed.

@geertjanw geertjanw merged commit c450d14 into apache:master May 2, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@geertjanw

This comment has been minimized.

Copy link
Member

commented May 2, 2019

OK, merged.

@matthiasblaesing

This comment has been minimized.

Copy link
Contributor

commented May 4, 2019

@michaelsembwever please update your git settings. I just noticed, that the history does not reflect your real name. For commits valid realname and email information should be present.

@michaelsembwever

This comment has been minimized.

Copy link
Member Author

commented May 4, 2019

@matthiasblaesing , thanks for the heads up. Has been set to Author: Mick Semb Wever <mck@apache.org>

@matthiasblaesing

This comment has been minimized.

Copy link
Contributor

commented May 5, 2019

@michaelsembwever thank you, we welcome your future changesets :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.