Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 324553

Summary: The type org.eclipse.core.expressions.Expression cannot be resolved. It is indirectly referenced from
Product: [Eclipse Project] PDE Reporter: Rahul Shukla <rahul.shukla>
Component: BuildAssignee: pde-build-inbox <pde-build-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: major    
Priority: P3    
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Rahul Shukla CLA 2010-09-06 04:51:36 EDT
Build Identifier: I20100608-0911

/**
 * 
 */
package rcp.intro.runtime.command;

import java.beans.Expression;

import org.eclipse.swt.SWT;
import org.eclipse.ui.menus.CommandContributionItem;
import org.eclipse.ui.menus.CommandContributionItemParameter;
import org.eclipse.ui.menus.ExtensionContributionFactory;
import org.eclipse.ui.menus.IContributionRoot;

import org.eclipse.ui.services.IServiceLocator;

/**
 * @author shuklara
 *
 */
public class DeefineCommands extends ExtensionContributionFactory {

	/**
	 * 
	 */
	public DeefineCommands() {
		// TODO Auto-generated constructor stub
	}

	/* (non-Javadoc)
	 * @see org.eclipse.ui.menus.AbstractContributionFactory#createContributionItems(org.eclipse.ui.services.IServiceLocator, org.eclipse.ui.menus.IContributionRoot)
	 */
	@Override
	public void createContributionItems(IServiceLocator serviceLocator,
			IContributionRoot additions) {
		CommandContributionItemParameter p = new CommandContributionItemParameter(
				serviceLocator, "",
				"org.eclipse.ui.file.exit",
				SWT.PUSH);
		p.label = "Exit the application";
		p.icon = Activator.getImageDescriptor("icons/alt_window_16.gif");

		CommandContributionItem item = new CommandContributionItem(p);
		item.setVisible(true);
	additions.addContributionItem(item,null);

	}

}


Reproducible: Always

Steps to Reproduce:
1.above is the snap shot of code and error occur in the line 
additions.addContributionItem(item,null);

let me know the way to resolve this error as soon as possible
Comment 1 DJ Houghton CLA 2010-09-07 09:06:15 EDT
Like the error message says, the org.eclipse.core.expressions.Expression class isn't visible. You need to adjust your bundle manifest. If you add that package (or its bundle) to the manifest's imports then it will work.

In the future please use the bug reporting system to report bugs only. If you have a question or need help please use IRC [1] or the Eclipse newsgroups [2].

[1] http://wiki.eclipse.org/IRC
[2] http://eclipse.org/forums/