Example usage for org.eclipse.jdt.internal.core.hierarchy TypeHierarchy hasFineGrainChanges

List of usage examples for org.eclipse.jdt.internal.core.hierarchy TypeHierarchy hasFineGrainChanges

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core.hierarchy TypeHierarchy hasFineGrainChanges.

Prototype

public boolean hasFineGrainChanges() 

Source Link

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.DeltaProcessor.java

License:Open Source License

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) {
                Util.log(exception, "Exception occurred in listener of Java element change notification"); //$NON-NLS-1$
            }//  w  w w. java2 s  .co m

            public void run() throws Exception {
                TypeHierarchy typeHierarchy = (TypeHierarchy) listener;
                if (typeHierarchy.hasFineGrainChanges()) {
                    // case of changes in primary working copies
                    typeHierarchy.needsRefresh = true;
                    typeHierarchy.fireChange();
                }
            }
        });
    }
}