Search in sources :

Example 1 with TypeHierarchy

use of org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy in project che by eclipse.

the class DeltaProcessor method notifyTypeHierarchies.

private void notifyTypeHierarchies(IElementChangedListener[] listeners, int listenerCount) {
    for (int i = 0; i < listenerCount; i++) {
        final IElementChangedListener listener = listeners[i];
        if (!(listener instanceof TypeHierarchy))
            continue;
        // wrap callbacks with Safe runnable for subsequent listeners to be called when some are causing grief
        SafeRunner.run(new ISafeRunnable() {

            public void handleException(Throwable exception) {
                //$NON-NLS-1$
                Util.log(exception, "Exception occurred in listener of Java element change notification");
            }

            public void run() throws Exception {
                TypeHierarchy typeHierarchy = (TypeHierarchy) listener;
                if (typeHierarchy.hasFineGrainChanges()) {
                    // case of changes in primary working copies
                    typeHierarchy.needsRefresh = true;
                    typeHierarchy.fireChange();
                }
            }
        });
    }
}
Also used : IElementChangedListener(org.eclipse.jdt.core.IElementChangedListener) ISafeRunnable(org.eclipse.core.runtime.ISafeRunnable) TypeHierarchy(org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy) JavaModelException(org.eclipse.jdt.core.JavaModelException) CoreException(org.eclipse.core.runtime.CoreException)

Aggregations

CoreException (org.eclipse.core.runtime.CoreException)1 ISafeRunnable (org.eclipse.core.runtime.ISafeRunnable)1 IElementChangedListener (org.eclipse.jdt.core.IElementChangedListener)1 JavaModelException (org.eclipse.jdt.core.JavaModelException)1 TypeHierarchy (org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy)1