This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 213535 - ActionProvider cannot listen to details such as selected ProjectConfiguration
Summary: ActionProvider cannot listen to details such as selected ProjectConfiguration
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2012-06-04 12:43 UTC by Jan Becicka
Modified: 2016-07-07 08:38 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Becicka 2012-06-04 12:43:38 UTC
I have my own project type with my own ProjectConfigurations. Some projects actions needs to be enabled only for some ProjectConfigurations. The problem is, that those actions does not listen on active ProjectConfiguration and there is probably no easy way, how to implement it from client side.
Comment 1 Jesse Glick 2012-06-04 22:30:35 UTC
Not specific to ProjectConfiguration; there may be a variety of mutable aspects of the project according to which an ActionProvider (or ProjectActionPerformer) might plausibly adjust its enablement state. It is impossible for the infrastructure to refresh the action for every conceivable change in metadata, but a richer SPI could let the provider attach and detach a listener to the current selection - basically a poor man's functional reactive program.

User-level workaround is just to change the project selection to something else and back.

Not a high priority since it is not obvious that overly detailed enablement changes are really good UI to begin with. The general recommendation is to err on the side of enabling the action; if it is invoked when the current state of the project does not permit it to continue meaningfully, just print a message to the status line and exit. This is simpler to implement and also lets the user learn _why_ the action could not be run, rather than just being confronted with a disabled menu item and no further explanation.
Comment 2 Martin Balin 2016-07-07 08:38:58 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss