Community
Participate
Working Groups
All variables in ExpressionContext are retrieved using this: public Object getVariable(String name) { Object obj = eclipseContext.getActiveLeaf().get(name); ... } This means that on every change of the active part all of the variables retrieved for commands evaluation (activeWhen, enabledWhen) are marked as invalid. This triggers a snowball causing all handler processing to be re-done from scratch. A lot of variables (such as, for instance, activeWorkbenchWindow) either do not depend on the active part, or are not affected by the switch in the particular active part. However, some variables might be affected by the active part switch. We need to get a list of common variables and start setting/updating them on their appropriate contexts, then remove the "getActiveLeaf()" from the code above.
Well when this clean up is done then bug 358020 is probably important as well (the patch there changes the logic a bit but I'm not sure what Paul is going to do with it)
The problem is architectural in nature, and so we should think about the solution as such. In 3.x there is the EvalutionService. It holds an EvaluationContext and the ISourceProviders update that one global context with variables. Asking for the state usually creates a child EvaluationContext off of the main one, but only to protect the global context from changes. The entire app sees the application state, so your window active part is visible to all windows (we just try and disable any visible UI changes in the non-active window). The number of application variables is extensible using the org.eclipse.ui.services extension point. In Eclipse 4 we have a hierarchy of IEclipseContexts that matches the part hierarchy. Its goal is "Ask your context for runtime state and you will get the correct answer, based on your place in the hierarchy and the active threads". For Eclipse 4 the lookup is "find the active leaf and then walk up the parent hierarchy". The current code is the simplest that will provide the correct answer. How can we make it performant? PW
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Nothing changed here.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.