org.eclipse.jface.text.source.AnnotationModelEvent Java Examples

The following examples show how to use org.eclipse.jface.text.source.AnnotationModelEvent. 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: ProblemMarkerManager.java    From goclipse with Eclipse Public License 1.0 6 votes vote down vote up
@Override
	public void modelChanged(AnnotationModelEvent event) {
//		if (event instanceof CompilationUnitAnnotationModelEvent) {
//			CompilationUnitAnnotationModelEvent cuEvent= (CompilationUnitAnnotationModelEvent) event;
//			if (cuEvent.includesProblemMarkerAnnotationChanges()) {
//				boolean hasChanges= false;
//				synchronized (this) {
//					IResource changedResource= cuEvent.getUnderlyingResource();
//					hasChanges= fResourcesWithAnnotationChanges.add(changedResource);
//				}
//				if (hasChanges) {
//					fireChanges();
//				}
//			}
//		}
	}
 
Example #2
Source File: MarkOccurrencesTest.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void modelChanged(AnnotationModelEvent event) {
	if (sender == event.getAnnotationModel()) {
		if (event.isWorldChange()) {
			Assert.assertEquals("addAnnotationModelListener", Thread.currentThread().getStackTrace()[2].getMethodName());
		} else {
			if (event.getAddedAnnotations().length != event.getRemovedAnnotations().length) {
				Assert.assertNull(this.event);
				this.event = event;
			}
		}
	}
}
 
Example #3
Source File: CompilationUnitDocumentProvider.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * @see IAnnotationModelListenerExtension#modelChanged(AnnotationModelEvent)
 */
public void modelChanged(AnnotationModelEvent event) {
	Object[] listeners= fListenerList.getListeners();
	for (int i= 0; i < listeners.length; i++) {
		Object curr= listeners[i];
		if (curr instanceof IAnnotationModelListenerExtension) {
			((IAnnotationModelListenerExtension) curr).modelChanged(event);
		}
	}
}
 
Example #4
Source File: ProblemMarkerManager.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void modelChanged(AnnotationModelEvent event) {
	if (event instanceof CompilationUnitAnnotationModelEvent) {
		CompilationUnitAnnotationModelEvent cuEvent= (CompilationUnitAnnotationModelEvent) event;
		if (cuEvent.includesProblemMarkerAnnotationChanges()) {
			boolean hasChanges= false;
			synchronized (this) {
				IResource changedResource= cuEvent.getUnderlyingResource();
				hasChanges= fResourcesWithAnnotationChanges.add(changedResource);
			}
			if (hasChanges) {
				fireChanges();
			}
		}
	}
}
 
Example #5
Source File: CopiedOverviewRuler.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void modelChanged(AnnotationModelEvent event) {
    if (!event.isValid()) {
        return;
    }

    if (event.isWorldChange()) {
        update();
        return;
    }

    Annotation[] annotations = event.getAddedAnnotations();
    int length = annotations.length;
    for (int i = 0; i < length; i++) {
        if (!skip(annotations[i].getType())) {
            update();
            return;
        }
    }

    annotations = event.getRemovedAnnotations();
    length = annotations.length;
    for (int i = 0; i < length; i++) {
        if (!skip(annotations[i].getType())) {
            update();
            return;
        }
    }

    annotations = event.getChangedAnnotations();
    length = annotations.length;
    for (int i = 0; i < length; i++) {
        if (!skip(annotations[i].getType())) {
            update();
            return;
        }
    }

}
 
Example #6
Source File: CompilationUnitDocumentProvider.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected AnnotationModelEvent createAnnotationModelEvent() {
	return new CompilationUnitAnnotationModelEvent(this, getResource());
}