| Summary: | HandledMenuItems should respond to enabled state | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] e4 | Reporter: | Paul Webster <pwebster> | ||||||
| Component: | UI | Assignee: | Paul Webster <pwebster> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Paul Webster <pwebster> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | emoffatt, ob1.eclipse, remy.suen | ||||||
| Version: | 1.0 | ||||||||
| Target Milestone: | 1.0 RC0 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 170731 [details]
Enabled Menu Items v03
This creates a run and track that keeps the widget up to date.
PW
(In reply to comment #1) > Created an attachment (id=170731) [details] > Enabled Menu Items v03 Released to HEAD >20100601 The alternate to this would be if MenuItems were managed more in conjunction with their SWT Menu parent and SWT.Show and SWT.Hide. no one is looking at this AFAIK. PW Oleg, I've created a RunAndTrack that has code that looks like:
public boolean changed(IEclipseContext context) {
EHandlerService service = lclContext
.get(EHandlerService.class);
ParameterizedCommand cmd = item.getWbCommand();
if (cmd == null) {
cmd = generateParameterizedCommand(item, lclContext);
}
if (cmd == null) {
return false;
}
item.setEnabled(service.canExecute(cmd));
}
The service.canExecute(*) will use lclContext to find the appropriate handler. With the changes you made will this be updated when a context activeChild changes and a new handler is selected?
PW
Committed in >20100602. Allied a clone of the patch to the ToolItemRenderer. Released to RC0 |
Created attachment 170728 [details] Enabled Menu Items v02 My HandledMenuItem should query the command to see if it is disabled or enabled. The attachment only works on createGui(*), it won't respond to changes. PW