Bug 296728 [CommonNavigator] Problem with enablement on navigatorContent extension point
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)
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/actions/CommonActionProviderDescriptor.java
/**
	 * Only nested Action Providers have priority (as of 3.2.1). 
	 * 
	 * @return The priority associated with this Action Provider Descriptor. 
	 */
	public Priority getPriority() {
		return priority;
	}
	public int hashCode() {
		final int PRIME = 31;
		int result = 1;
		result = PRIME * result + ((definedId == null) ? 0 : definedId.hashCode());
		result = PRIME * result + ((visibilityId == null) ? 0 : visibilityId.hashCode());
		return result;
	}
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		final CommonActionProviderDescriptor other = (CommonActionProviderDescriptor) obj;
		if (definedId == null) {
			if (other.definedId != null)
				return false;
		} else if (!definedId.equals(other.definedId))
			return false;
		if (visibilityId == null) {
			if (other.visibilityId != null)