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

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

Introduction

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

Prototype

public void fireChange() 

Source Link

Document

Notifies listeners that this hierarchy has changed and needs refreshing.

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 ww  .ja v  a 2 s . c  o  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();
                }
            }
        });
    }
}