Search in sources :

Example 1 with JavaWorkspaceScope

use of org.eclipse.jdt.internal.core.search.JavaWorkspaceScope in project che by eclipse.

the class DeltaProcessor method fire.

/*
     * Fire Java Model delta, flushing them after the fact after post_change notification.
     * If the firing mode has been turned off, this has no effect.
     */
public void fire(IJavaElementDelta customDelta, int eventType) {
    if (!this.isFiring)
        return;
    if (DEBUG) {
        System.out.println(//$NON-NLS-1$
        "-----------------------------------------------------------------------------------------------------------------------");
    }
    IJavaElementDelta deltaToNotify;
    if (customDelta == null) {
        deltaToNotify = mergeDeltas(this.javaModelDeltas);
    } else {
        deltaToNotify = customDelta;
    }
    // Refresh internal scopes
    if (deltaToNotify != null) {
        Iterator scopes = this.manager.searchScopes.keySet().iterator();
        while (scopes.hasNext()) {
            AbstractSearchScope scope = (AbstractSearchScope) scopes.next();
            scope.processDelta(deltaToNotify, eventType);
        }
        JavaWorkspaceScope workspaceScope = this.manager.workspaceScope;
        if (workspaceScope != null)
            workspaceScope.processDelta(deltaToNotify, eventType);
    }
    // Notification
    // Important: if any listener reacts to notification by updating the listeners list or mask, these lists will
    // be duplicated, so it is necessary to remember original lists in a variable (since field values may change under us)
    IElementChangedListener[] listeners;
    int[] listenerMask;
    int listenerCount;
    synchronized (this.state) {
        listeners = this.state.elementChangedListeners;
        listenerMask = this.state.elementChangedListenerMasks;
        listenerCount = this.state.elementChangedListenerCount;
    }
    switch(eventType) {
        case DEFAULT_CHANGE_EVENT:
        case ElementChangedEvent.POST_CHANGE:
            firePostChangeDelta(deltaToNotify, listeners, listenerMask, listenerCount);
            fireReconcileDelta(listeners, listenerMask, listenerCount);
            break;
    }
}
Also used : IElementChangedListener(org.eclipse.jdt.core.IElementChangedListener) Iterator(java.util.Iterator) AbstractSearchScope(org.eclipse.jdt.internal.core.search.AbstractSearchScope) IJavaElementDelta(org.eclipse.jdt.core.IJavaElementDelta) JavaWorkspaceScope(org.eclipse.jdt.internal.core.search.JavaWorkspaceScope)

Aggregations

Iterator (java.util.Iterator)1 IElementChangedListener (org.eclipse.jdt.core.IElementChangedListener)1 IJavaElementDelta (org.eclipse.jdt.core.IJavaElementDelta)1 AbstractSearchScope (org.eclipse.jdt.internal.core.search.AbstractSearchScope)1 JavaWorkspaceScope (org.eclipse.jdt.internal.core.search.JavaWorkspaceScope)1