Package org.erlide.engine.model.root

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


                match = findMatch(deletedTuple, additions.keySet(), additions);
                addToDeletions = false;
            }

            if (match != null) {
                final IErlElement element = match.annotation.getElement();
                deleted.setElement(element);
                deletedPosition.setLength(match.position.getLength());
                if (deletedPosition instanceof ErlangElementPosition
                        && element instanceof IErlMember) {
                    final ErlangElementPosition eep = (ErlangElementPosition) deletedPosition;
View Full Code Here


                    : null;
            if (obj instanceof IResource) {
                return getErrorTicksFromMarkers((IResource) obj,
                        IResource.DEPTH_INFINITE, r);
            } else if (obj instanceof IErlElement) {
                final IErlElement e = (IErlElement) obj;
                return getErrorTicksFromMarkers(e.getResource(),
                        IResource.DEPTH_INFINITE, r);
            }
        } catch (final CoreException e) {
            if (e.getStatus().getCode() == IResourceStatus.MARKER_NOT_FOUND) {
                return 0;
            }
        }
        return 0;
    }
View Full Code Here

        @Override
        public boolean match(final ErlangProjectionAnnotation annotation) {
            if (stateMatch(annotation) && !annotation.isComment()
                    && !annotation.isMarkedDeleted()) {
                final IErlElement element = annotation.getElement();
                if (fSet.contains(element)) {
                    return true;
                }
            }
            return false;
View Full Code Here

    @Override
    public void run() {
        if (module == null) {
            return;
        }
        final IErlElement el = editor.getElementAt(
                editor.getViewer().getSelectedRange().x, false);
        IErlFunction f = null;
        if (el instanceof IErlFunction) {
            f = (IErlFunction) el;
        } else if (el instanceof IErlFunctionClause) {
            f = (IErlFunction) el.getParent();
        }
        if (f == null) {
            return;
        }
        String name = module.getName();
View Full Code Here

        @Override
        public boolean match(final ErlangProjectionAnnotation annotation) {
            if (stateMatch(annotation) && !annotation.isComment()
                    && !annotation.isMarkedDeleted()) {
                final IErlElement element = annotation.getElement();
                final ErlElementKind kind = element.getKind();
                return kind == ErlElementKind.FUNCTION || kind == ErlElementKind.CLAUSE;
            }
            return false;
        }
View Full Code Here

    @Override
    public IErlModule findIncludeFromModule(final IErlModule module,
            final String includeName, final String includePath,
            final IErlElementLocator.Scope scope) throws ErlModelException {
        final IErlElement parent = module.getParent();
        if (parent instanceof IErlFolder) {
            final IErlFolder folder = (IErlFolder) parent;
            folder.open(null);
            final IErlModule include = folder.findInclude(includeName, includePath);
            if (include != null) {
View Full Code Here

        } else {
            final int offset = sourceViewer.getVisibleRegion().getOffset();
            caret = offset + styledText.getCaretOffset();
        }

        final IErlElement element = getElementAt(caret, false);

        if (!(element instanceof ISourceReference)) {
            return null;
        }
View Full Code Here

                // the given delta is not the root or a child - illegal
                // Assert.isTrue(false);
            }
        } else {
            for (final IErlElement ancestor : ancestors) {
                final IErlElement element2 = ancestor;
                final ErlElementDelta ancestorDelta = new ErlElementDelta(0, 0, element2);
                ancestorDelta.addAffectedChild(childDelta);
                childDelta = ancestorDelta;
            }
        }
View Full Code Here

            }
        }
    }

    private List<IErlElement> getAncestors(final IErlElement element0) {
        IErlElement element = element0;
        IErlElement parent = element.getParent();
        if (parent == null) {
            return null;
        }
        final ArrayList<IErlElement> parents = Lists.newArrayList();
        while (!parent.equals(fElement)) {
            parents.add(parent);
            element = parent;
            parent = element.getParent();
            if (parent == null) {
                break;
View Full Code Here

    /**
     * Returns whether the two elements are equals and have the same parent.
     */
    protected boolean equalsAndSameParent(final IErlElement e1, final IErlElement e2) {
        final IErlElement parent1 = e1.getParent();
        return e1.equals(e2) && parent1 != null && parent1.equals(e2.getParent());
    }
View Full Code Here

TOP

Related Classes of org.erlide.engine.model.root.IErlElement

Copyright © 2018 www.massapicom. 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.