Examples of IErlElementDelta


Examples of org.erlide.engine.model.root.IErlElementDelta

            try {
                structureKnown = fModule.isStructureKnown();
            } catch (final ErlModelException e1) {
            }
            if (structureKnown) {
                final IErlElementDelta d = ErlangEngine
                        .getInstance()
                        .getModel()
                        .createElementDelta(IErlElementDelta.CHANGED,
                                IErlElementDelta.F_CONTENT, fModule);
                processDelta(d);
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementDelta

            }
            fCachedModel = model;
            if (element instanceof IErlModule && element != fModule) {
                return;
            }
            final IErlElementDelta d = ErlangEngine
                    .getInstance()
                    .getModel()
                    .createElementDelta(IErlElementDelta.CHANGED,
                            IErlElementDelta.F_CONTENT, fModule);
            processDelta(d);
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementDelta

    @Override
    public IErlElementDelta[] getChildren(final int kind) {
        final ArrayList<IErlElementDelta> children = new ArrayList<IErlElementDelta>(0);
        for (int i = 0; i < fChildren.size(); ++i) {
            final IErlElementDelta c = fChildren.get(i);
            if (c.getKind() == kind || kind == ALL) {
                children.add(c);
            }
        }
        return children.toArray(new IErlElementDelta[children.size()]);
    }
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementDelta

            fFlags |= F_CHILDREN;
            break;
        }

        // Check if we already have the delta.
        IErlElementDelta existingChild = null;
        int existingChildIndex = -1;
        for (int i = 0; i < fChildren.size(); i++) {
            // handle case of two jars that can be equals but not in the same
            // project
            if (equalsAndSameParent(fChildren.get(i).getElement(), child.getElement())) {
                existingChild = fChildren.get(i);
                existingChildIndex = i;
                break;
            }
        }

        if (existingChild == null) { // new affected child
            fChildren.add(child);
        } else {
            switch (existingChild.getKind()) {
            case ADDED:
                switch (child.getKind()) {
                // child was added then added -> it is added
                case ADDED:
                    // child was added then changed -> it is added
                case CHANGED:
                    return;

                    // child was added then removed -> noop
                case REMOVED:
                    fChildren.remove(existingChildIndex);
                    return;
                }
                break;
            case REMOVED:
                switch (child.getKind()) {
                // child was removed then added -> it is changed
                case ADDED:
                    child.fKind = CHANGED;
                    fChildren.set(existingChildIndex, child);
                    return;

                    // child was removed then changed -> it is removed
                case CHANGED:
                    // child was removed then removed -> it is removed
                case REMOVED:
                    return;
                }
                break;
            case CHANGED:
                switch (child.getKind()) {
                // child was changed then added -> it is added
                case ADDED:
                    // child was changed then removed -> it is removed
                case REMOVED:
                    fChildren.set(existingChildIndex, child);
                    return;

                    // child was changed then changed -> it is changed
                case CHANGED:
                    final IErlElementDelta[] children = child.getChildren(ALL);
                    for (final IErlElementDelta element : children) {
                        final ErlElementDelta childsChild = (ErlElementDelta) element;
                        ((ErlElementDelta) existingChild).addAffectedChild(childsChild);
                    }
                    // add the non-erlang resource deltas if needed
                    // note that the child delta always takes
                    // precedence over this existing child delta
                    // as non-erlang resource deltas are always
                    // created last (by the DeltaProcessor)
                    ((ErlElementDelta) existingChild).fResourceDeltas = child.fResourceDeltas;
                    return;
                }
                break;
            default:
                // unknown -> existing child becomes the child with the existing
                // child's
                // flags
                final int flags = existingChild.getFlags();
                fChildren.set(existingChildIndex, child);
                child.fFlags |= flags;
            }
        }
    }
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementDelta

    public IErlElementDelta findElement(final IErlElement element) {
        if (fElement.equals(element)) {
            return this;
        }
        for (int i = 0; i < fChildren.size(); ++i) {
            final IErlElementDelta d = fChildren.get(i).findElement(element);
            if (d != null) {
                return d;
            }
        }
        return null;
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementDelta

     * Fire Model deltas, flushing them after the fact. If the firing mode has
     * been turned off, this has no effect.
     */
    protected void fire(final IErlElementDelta customDeltas, final int eventType) {
        if (fFire) {
            IErlElementDelta deltaToNotify;
            if (customDeltas == null) {
                deltaToNotify = mergeDeltas(erlModelDeltas);
            } else {
                deltaToNotify = customDeltas;
            }
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementDelta

        }
    }

    private void fireReconcileDelta(final IElementChangedListener[] listeners,
            final int[] listenerMask, final int listenerCount) {
        final IErlElementDelta deltaToNotify = mergeDeltas(reconcileDeltas.values());
        if (verbose) {
            System.out
                    .println("FIRING POST_RECONCILE Delta [" + Thread.currentThread() + "]:"); //$NON-NLS-1$//$NON-NLS-2$
            System.out
                    .println(deltaToNotify == null ? "<NONE>" : deltaToNotify.toString()); //$NON-NLS-1$
        }
        if (deltaToNotify != null) {
            // flush now so as to keep listener reactions to post their own
            // deltas for
            // subsequent iteration
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.