org.eclipse.jdt.core.compiler.ReconcileContext Java Examples

The following examples show how to use org.eclipse.jdt.core.compiler.ReconcileContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReconcileWorkingCopyOperation.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void notifyParticipants(final CompilationUnit workingCopy) {
	IJavaProject javaProject = getWorkingCopy().getJavaProject();
	CompilationParticipant[] participants = JavaModelManager.getJavaModelManager().compilationParticipants.getCompilationParticipants(javaProject);
	if (participants == null) return;

	final ReconcileContext context = new ReconcileContext(this, workingCopy);
	for (int i = 0, length = participants.length; i < length; i++) {
		final CompilationParticipant participant = participants[i];
		SafeRunner.run(new ISafeRunnable() {
			public void handleException(Throwable exception) {
				if (exception instanceof Error) {
					throw (Error) exception; // errors are not supposed to be caught
				} else if (exception instanceof OperationCanceledException)
					throw (OperationCanceledException) exception;
				else if (exception instanceof UnsupportedOperationException) {
					// might want to disable participant as it tried to modify the buffer of the working copy being reconciled
					Util.log(exception, "Reconcile participant attempted to modify the buffer of the working copy being reconciled"); //$NON-NLS-1$
				} else
					Util.log(exception, "Exception occurred in reconcile participant"); //$NON-NLS-1$
			}
			public void run() throws Exception {
				participant.reconcile(context);
			}
		});
	}
}
 
Example #2
Source File: CompPlugin.java    From junion with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
	public void reconcile(ReconcileContext context) {
		super.reconcile(context);
//		ICompilationUnit cu = context.getWorkingCopy();
		log("reconcile");
		
	}
 
Example #3
Source File: AbstractJtxtUMLCompilationParticipant.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void reconcile(ReconcileContext context) {
	try {
		CompilationUnit unit = context.getAST8();
		ProblemCollector collector = new ProblemCollector(getMarkerType(), context);
		validate(unit, collector);
		collector.refreshProblems();
	} catch (Exception e) {
		Logger.sys.error("Error while checking for problems", e); //$NON-NLS-1$
	}
}
 
Example #4
Source File: ModelTest.java    From txtUML with Eclipse Public License 1.0 4 votes vote down vote up
public ModelProblemCollector(ReconcileContext context) throws JavaModelException {
	super(JtxtUMLModelCompilationParticipant.JTXTUML_MODEL_MARKER_TYPE, context);
}
 
Example #5
Source File: ProblemCollector.java    From txtUML with Eclipse Public License 1.0 4 votes vote down vote up
public ProblemCollector(String markerType, ReconcileContext context) throws JavaModelException {
	this(markerType, context.getAST8(), context.getWorkingCopy().getResource());
}