类org.eclipse.jface.text.source.AnnotationModelEvent源码实例Demo

下面列出了怎么用org.eclipse.jface.text.source.AnnotationModelEvent的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: goclipse   文件: ProblemMarkerManager.java
@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();
//				}
//			}
//		}
	}
 
源代码2 项目: xtext-eclipse   文件: MarkOccurrencesTest.java
@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;
			}
		}
	}
}
 
/**
 * @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);
		}
	}
}
 
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();
			}
		}
	}
}
 
源代码5 项目: Pydev   文件: CopiedOverviewRuler.java
@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;
        }
    }

}
 
@Override
protected AnnotationModelEvent createAnnotationModelEvent() {
	return new CompilationUnitAnnotationModelEvent(this, getResource());
}
 
 类所在包
 类方法
 同包方法