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

Disable File Open menu item #217

Merged
merged 1 commit into from
Aug 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ public JMenu getFileMenu() {
openMenu.add(menuItem("New Window", 'N', KeyStroke.getKeyStroke(KeyEvent.VK_N, CMD_CTRL_KEY_MASK),
this.actionPool.blankWindowAction));
openMenu.add(menuItem("Cloned Window", 'C', this.actionPool.clonedWindowAction));
openMenu.add(menuItem("File...", 'F', KeyStroke.getKeyStroke(KeyEvent.VK_O, CMD_CTRL_KEY_MASK), this.actionPool.openFileAction));
final JMenuItem fileMenuItem = menuItem("File...", 'F', KeyStroke.getKeyStroke(KeyEvent.VK_O, CMD_CTRL_KEY_MASK), this.actionPool.openFileAction);
// TODO enable the menu item once access control UI is implemented
fileMenuItem.setEnabled(false);
Copy link
Contributor Author

@chetankothari chetankothari Aug 24, 2016

Choose a reason for hiding this comment

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

Was thinking if we should pass in a flag to menuItem to return a disabled item, or use disabled action. Let me know what you think about it.

Copy link
Member

Choose a reason for hiding this comment

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

A flag to menuItem would be more "functional", yeah. But if it is used only in this one case, I would leave it aside as a minor thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Will check for usage and see if we can get that done.

openMenu.add(fileMenuItem);

final JMenu menu = new JMenu("File");
menu.setMnemonic('F');
Expand Down