Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329206 - [CommonNavigator] Problem with enablement on navigatorContent extension point
Summary: [CommonNavigator] Problem with enablement on navigatorContent extension point
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4.2+   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 296728
Blocks:
  Show dependency tree
 
Reported: 2010-11-01 13:14 EDT by Paul Webster CLA
Modified: 2010-11-10 11:10 EST (History)
5 users (show)

See Also:


Attachments
Use the IEvaluationService to provide a context (13.27 KB, patch)
2010-11-01 13:16 EDT, Paul Webster CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2010-11-01 13:14:02 EDT
+++ This bug was initially created as a clone of Bug #296728 +++

If I use the enablement node with the expression "WITH", no variable was found because no real context is given.

example : 
<extension
         point="org.eclipse.ui.navigator.navigatorContent">
<commonWizard
  type="new"
  wizardId="com.mywizard">
  <enablement>
    <with
      variable="activeWorkbenchWindow.activePerspective">
      <equals
        value="com.myperpective">
      </equals>
    </with>
  </enablement>
</commonWizard>

make this error :
org.eclipse.core.runtime.CoreException: The variable activeWorkbenchWindow.activePerspective is not defined
	at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:65)
	at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
	at org.eclipse.core.internal.expressions.EnablementExpression.evaluate(EnablementExpression.java:53)
	at org.eclipse.ui.internal.navigator.wizards.CommonWizardDescriptor.isEnabledFor(CommonWizardDescriptor.java:145)
	at org.eclipse.ui.internal.navigator.wizards.CommonWizardDescriptorManager.getEnabledCommonWizardDescriptors(CommonWizardDescriptorManager.java:158)
	at org.eclipse.ui.navigator.WizardActionGroup.setContext(WizardActionGroup.java:193)
	at org.eclipse.ui.internal.navigator.resources.actions.NewActionProvider.fillContextMenu(NewActionProvider.java:107)



You could do use the currentState of the IEvaluationService.
(see WorkbenchWindow line 3035)
Comment 1 Paul Webster CLA 2010-11-01 13:15:02 EDT
There was a request to patch this back to 3.4.2+

PW
Comment 2 Paul Webster CLA 2010-11-01 13:16:16 EDT
Created attachment 182158 [details]
Use the IEvaluationService to provide a context

Francis, could you please have a look at my port to 3.4.2?  With one minor change, it was the same as the 3.5.2 patch.

PW
Comment 3 Paul Webster CLA 2010-11-09 08:13:52 EST
Boris, can I get a +1 for 3.4.2+?
pW
Comment 4 Francis Upton IV CLA 2010-11-09 10:10:39 EST
(In reply to comment #2)
> Created an attachment (id=182158) [details]

> Francis, could you please have a look at my port to 3.4.2?  With one minor
> change, it was the same as the 3.5.2 patch. 

+1 for 3.4.2, this looks identical except that it does not have the test changes which is fine of course.
Comment 5 Boris Bokowski CLA 2010-11-09 13:01:20 EST
(In reply to comment #3)
> Boris, can I get a +1 for 3.4.2+?
> pW

Do we have someone who can test that the changes are actually fixing a problem? If we can get them to say here that the patch does work as intended, +1 from me. (If it's an IBM team, relayed through Paul is good enough.)
Comment 6 Paul Webster CLA 2010-11-09 13:15:08 EST
(In reply to comment #5)
> 
> Do we have someone who can test that the changes are actually fixing a problem?
> If we can get them to say here that the patch does work as intended, +1 from
> me. (If it's an IBM team, relayed through Paul is good enough.)

I got the requesters to test this and it definitely solves their problem.

PW
Comment 7 Boris Bokowski CLA 2010-11-10 10:15:58 EST
(In reply to comment #6)
> I got the requesters to test this and it definitely solves their problem.
> 
> PW

Great, thanks!

+1 for 3.4.2+
Comment 8 Paul Webster CLA 2010-11-10 11:10:18 EST
Released to R3_4_maintenance.

PW