NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #1161 (closed enhancement: fixed)

Opened 2012-05-09T13:06:32-05:00

Last modified 2012-06-18T15:24:02-05:00

Use Application default JMenuBar on Mac

Reported by: curtis Owned by: bdezonia
Priority: major Milestone: imagej2-b3-headless
Component: UI Framework Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1162, #1182

Description

The com.apple.eawt.Application class has a nice  setDefaultMenuBar(JMenuBar) command, which is used when no window is active, as well as when a window lacking a menu bar is active.

Unfortunately, this menu bar does not have any support for shortcut keys—they simply do not work. But now that we have the AcceleratorHandler tool, this may not be an issue for ImageJ.

See attached DefaultMacMenuBar.java for an illustration.

Attachments

DefaultMacMenuBar.java (1.4 KB) - added by curtis 2012-05-09T13:06:38-05:00.

Change History

Changed 2012-05-09T13:06:38-05:00 by curtis

comment:1 Changed 2012-05-09T13:08:10-05:00 by curtis

  • Blocking 1162 added

comment:2 Changed 2012-05-09T13:24:11-05:00 by curtis

  • Component changed from other to ij-ui

comment:3 Changed 2012-05-09T13:37:27-05:00 by curtis

The main thing to test is whether shortcut keys still work; e.g., for Command Finder, does L bring it up? Does Cmd+L bring it up? Etc.

If not, then check AcceleratorHandler to see if it's getting the keystroke at all, and improve it to launch the right plugin in both cases.

If it works, we may not need to clone menu bars anymore at all... can try commenting out platformService.setMenuBarDuplicated(true) in the MacOSXPlatform configuration.

comment:4 Changed 2012-05-14T09:45:49-05:00 by bdezonia

There is a initial implementation in the fix-menus branch. Waiting for Curtis to look at. It only ever creates menus once. The current implementation works but needs enhancement. We need to allow menus to be surgically altered before we could consider this ticket closed. Once that code is in place then handling Image Type checkboxes and active Window checkbox should be fairly simple. The plan would to have a default menu and then separate context menus for things like the script editor.

comment:5 Changed 2012-05-14T09:50:53-05:00 by bdezonia

  • Milestone changed from imagej-2.0.0-beta3 to imagej-2.0.0-beta2

comment:6 Changed 2012-05-16T10:21:06-05:00 by bdezonia

  • Milestone changed from imagej-2.0.0-beta2 to imagej-2.0.0-beta3

comment:7 Changed 2012-05-16T10:33:30-05:00 by bdezonia

  • Blocking 1182 added

comment:8 Changed 2012-06-15T13:55:16-05:00 by bdezonia

Currently code to do this is committed to master. There are some niggling issues that need to be ironed out and should be soon.

comment:9 Changed 2012-06-18T15:24:02-05:00 by bdezonia

  • Status changed from new to closed
  • Resolution set to fixed

The niggling outstanding bugs have recently been fixed.