Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 package org.eclipse.jdt.internal.core;
 
 import  org.eclipse.core.resources.IResourceRuleFactory;
 import  org.eclipse.core.resources.ResourcesPlugin;
 import  org.eclipse.core.runtime.IPath;
 import  org.eclipse.core.runtime.jobs.ISchedulingRule;
 import  org.eclipse.core.runtime.jobs.MultiRule;
This operation sets an IJavaProject's classpath.

See also:
IJavaProject
 
 
 
 		JavaProject project,
 		IClasspathEntry[] newRawClasspath,
 		IPath newOutputLocation,
 		boolean canChangeResource) {
 
 		this(projectnewRawClasspathnullnewOutputLocationcanChangeResource);
 	}

When executed, this operation sets the raw classpath and output location of the given project.
 
 		JavaProject project,
 		IClasspathEntry[] newRawClasspath,
 		IClasspathEntry[] referencedEntries,
 		IPath newOutputLocation,
 		boolean canChangeResource) {
 
 		super(new IJavaElement[] { project }, canChangeResource);
 		this. = project;
 		this. = newRawClasspath;
 		this. = referencedEntries;
 		this. = newOutputLocation;
 	}

Sets the classpath of the pre-specified project.
 
 	protected void executeOperation() throws JavaModelException {
 		try {
 			// set raw classpath and null out resolved info
 			PerProjectInfo perProjectInfo = this..getPerProjectInfo();
 			ClasspathChange classpathChange = perProjectInfo.setRawClasspath(this.this.this../*format is ok*/);
 
 			// if needed, generate delta, update project ref, create markers, ...
 			classpathChanged(classpathChangetrue/*refresh if external linked folder already exists*/);
 
 			// write .classpath file
 			if (this. && perProjectInfo.writeAndCacheClasspath(this.this.this.))
 				setAttribute(HAS_MODIFIED_RESOURCE_ATTR, TRUE);
 		} finally {
 			done();
 		}
 	}
 	
 	protected ISchedulingRule getSchedulingRule() {
 		if (this.) {
 			IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
 			return new MultiRule(new ISchedulingRule[] {
 				// use project modification rule as this is needed to create the .classpath file if it doesn't exist yet, or to update project references
 				ruleFactory.modifyRule(this..getProject()),
 				
 				// and external project modification rule in case the external folders are modified
 				ruleFactory.modifyRule(JavaModelManager.getExternalManager().getExternalFoldersProject())
 			});
 		}
 		return super.getSchedulingRule();
 	}
 
 	public String toString(){
 		StringBuffer buffer = new StringBuffer(20);
		buffer.append("SetClasspathOperation\n"); //$NON-NLS-1$
		buffer.append(" - classpath : "); //$NON-NLS-1$
		buffer.append("{"); //$NON-NLS-1$
		for (int i = 0; i < this..lengthi++) {
			if (i > 0) buffer.append(","); //$NON-NLS-1$
			IClasspathEntry element = this.[i];
			buffer.append(" ").append(element.toString()); //$NON-NLS-1$
		}
		buffer.append("\n - output location : ");  //$NON-NLS-1$
		buffer.append(this..toString());
		return buffer.toString();
	}
		IJavaModelStatus status = super.verify();
		if (!status.isOK())
			return status;
		this..flushClasspathProblemMarkers(falsefalsetrue);
		return ClasspathEntry.validateClasspath(this.this.this.);
	}
New to GrepCode? Check out our FAQ X