Add ability to dynamically disable a right click popup menu item for Tree
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
Originally by andrewv
Hi,
Currently (as I understand it), right click popup menu items on a Tree popup are rendered, based on the Action getIcon() and getCaption() values. I am unable to find any way to disable the individual menu items, like I can for items in the new MenuBar (by calling MenuItem.setCommand(null).
The only workaround I can think of for the moment, is to use HTML for the caption, and change the caption text colour to be (say grey - to "look" disabled), and perform no processing in the Action.Handler.handleAction() when the right click menu item is clicked.
Are you planning to add an explicit isEnabled(), or similar mechanism to the Action interface, to allow a menu item in the right click popup menu to be dynamically disabled ? If not, can you think of any better workarounds ?
Thanks
Andrew
Imported from https://dev.vaadin.com/ issue #2461
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Tree right-click popup implementation and the Action interface, then compare it with MenuBar's MenuItem.setCommand(null) behavior. Done means individual Tree popup menu items can be dynamically disabled and render as disabled rather than merely ignoring clicks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100