Community
Participate
Working Groups
1. Open the 'Variables' view. 2. Open the view menu > Java > Show References 3. Redo step 2, it is still unselected. In 3.x they are checked menu items.
The 'Java' submenu in the 'Debug' view's view menu also has the same problem.
Created attachment 197394 [details] Patch that enables functionality of the view action I have verified that the view action is not functioning as expected (for ex., ShowQualifiedNames in Debug view does not show qualified names in the stack trace) along with the visual representation does not appear checked/selected though they are clicked. The attached patch addresses the 1st issue - actions are functional now as they respond to user actions. However, they do not render selected. The reason being - when we are about to render the view actions, we are creating a copy of model and all the corresponding operations are based on the 'copied' model (like, if the action is selected, model is also set to selected etc). Since these are View Actions, they are recreated every time when the user open the View actions menu. So is the model being copied every time and thus, the previous state of (copied) model is lost. Due to this the MenuItem always appears unselected though the preference/action is actually selected. I will try to investigate further on this. I am not sure why do we need to Copy the model every time (at ContributionRecord.mergeIntoModel() line: 113). Meanwhile, can anyone please review this patch and post their comments ?
Created attachment 197753 [details] Final Patch v01 Further to my investigation earlier, I have fixed persisting the ViewMenuAction's state. The attached patch should cover all the issues mentioned in my previous comment. Please review the patch and put up your comments. Thanks.
*** Bug 351350 has been marked as a duplicate of this bug. ***
(In reply to comment #3) > Created attachment 197753 [details] > Final Patch v01 > Just a quick comment. An MMenuContribution can be placed in 2 or more locations. Each location must have its own copy of an MMenuItem, for example, as each MMenuItem can have only one parent. Won't stashing the copy in the MMenuContribution/MMenuItem invalidate that constraint? PW
This causes stuff like 'Show Monitors' to not do anything because the action is always unchecked. Thread [main] (Suspended (breakpoint at line 803 in ScopedPreferenceStore)) ScopedPreferenceStore.setValue(String, boolean) line: 803 ToggleBooleanPreferenceAction$1.run() line: 43 BusyIndicator.showWhile(Display, Runnable) line: 70 ShowMonitorThreadInformation(ToggleBooleanPreferenceAction).run(IAction) line: 39 ShowMonitorThreadInformation(ViewFilterAction).runWithEvent(IAction, Event) line: 85 ActionDelegateHandlerProxy.execute(ExecutionEvent) line: 281 E4HandlerProxy.execute(IEclipseContext, Map, Event, IEvaluationContext) line: 68 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 48 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 37 Method.invoke(Object, Object...) line: 600 MethodRequestor.execute() line: 56 InjectorImpl.invokeUsingClass(Object, Class<?>, Class<Annotation>, Object, PrimaryObjectSupplier, PrimaryObjectSupplier, boolean) line: 228 InjectorImpl.invoke(Object, Class<Annotation>, Object, PrimaryObjectSupplier, PrimaryObjectSupplier) line: 209 ContextInjectionFactory.invoke(Object, Class<Annotation>, IEclipseContext, IEclipseContext, Object) line: 123 HandlerServiceImpl.executeHandler(ParameterizedCommand, IEclipseContext) line: 161 HandledContributionItem.executeItem(Event) line: 717 HandledContributionItem.handleWidgetSelection(Event) line: 622 HandledContributionItem.access$6(HandledContributionItem, Event) line: 606 HandledContributionItem$3.handleEvent(Event) line: 565
Having only one copy in the transient data certainly seems problematic. I was going to say we could store the boolean value of whether it's selected or unselected in the transient data somehow but not quite sure how that would be implemented off-hand.
Comment on attachment 197753 [details] Final Patch v01 I get a lot of exceptions the moment I open a second workbench window.
(In reply to comment #8) > Comment on attachment 197753 [details] > Final Patch v01 Praveen's change to ActionDelegateHandlerProxy is still worthwhile though as it allows actions like the one described by comment 6 to work. So I'm going to release that diff.
(In reply to comment #9) > (In reply to comment #8) > > Comment on attachment 197753 [details] [details] > > Final Patch v01 > > Praveen's change to ActionDelegateHandlerProxy is still worthwhile though as it > allows actions like the one described by comment 6 to work. So I'm going to > release that diff. Pushed to R4_development. Thanks, Praveen! http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_development&id=3d21705d5007efb9915b8c2f01a650c8e3eda618
Was wondering how the 'Build Automatically menu item works but it seems it's because of our menu bar processing. Thread [main] (Suspended) MenuHelper.createItem(MApplication, ActionContributionItem) line: 949 WorkbenchWindow.fill(MenuManagerRenderer, MMenu, IMenuManager) line: 846 WorkbenchWindow.fill(MenuManagerRenderer, MMenu, IMenuManager) line: 835 WorkbenchWindow.setup() line: 539 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43 Method.invoke(Object, Object...) line: 601 MethodRequestor.execute() line: 56 InjectorImpl.processAnnotated(Class<Annotation>, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, ArrayList<Class<?>>) line: 838 InjectorImpl.inject(Object, PrimaryObjectSupplier, PrimaryObjectSupplier) line: 110 InjectorImpl.inject(Object, PrimaryObjectSupplier) line: 80 ContextInjectionFactory.inject(Object, IEclipseContext) line: 72 Workbench.createWorkbenchWindow(IAdaptable, IPerspectiveDescriptor, MWindow, boolean) line: 1213 Workbench.openWorkbenchWindow(IAdaptable, IPerspectiveDescriptor, MWindow, boolean) line: 2242 Workbench.openWorkbenchWindow(String, IAdaptable) line: 2234 OpenInNewWindowHandler.execute(ExecutionEvent) line: 58 HandlerProxy.execute(ExecutionEvent) line: 293 E4HandlerProxy.execute(IEclipseContext, Map, Event, IEvaluationContext) line: 68
Does this need to be retargetted for M4? PW
(In reply to comment #11) > Was wondering how the 'Build Automatically menu item works but it seems it's > because of our menu bar processing. Note that the 'Build Automatically' menu item is not completely problem-free. See bug 365081.
Fix pushed to master. http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=d8b1b3aed83c8b4f005767798d39b4f08b9faf4d
Verified with I20120123-2200 on Windows 7.