Examples of IErlElement


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

        return head;
    }

    @Override
    public String getFunctionName() {
        final IErlElement element = getParent();
        return element.getName();
    }
View Full Code Here

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

    private ElementChangedListener fListener;

    @Override
    public Object[] getChildren(final Object parent) {
        if (parent instanceof IErlElement) {
            final IErlElement p = (IErlElement) parent;
            try {
                return p.getChildren().toArray();
            } catch (final ErlModelException x) {
                ErlLogger.warn(x);
            }
        }
        return NO_CHILDREN;
View Full Code Here

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

    }

    @Override
    public Object getParent(final Object child) {
        if (child instanceof IErlElement) {
            final IErlElement e = (IErlElement) child;
            return e.getParent();
        }
        return null;
    }
View Full Code Here

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

    }

    @Override
    public boolean hasChildren(final Object parent) {
        if (parent instanceof IErlElement) {
            final IErlElement p = (IErlElement) parent;
            return p.hasChildren();
        }
        return false;
    }
View Full Code Here

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

     */
    public OpenEdocInExternalBrowserAction(final ErlangEditor editor) {
        this(editor.getEditorSite(), null);
        this.editor = editor;
        final ITextSelection selection = (ITextSelection) editor.getSelection();
        final IErlElement element = editor.getElementAt(selection.getOffset(), false);
        setEnabled(element != null);
    }
View Full Code Here

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

    /*
     * (non-Javadoc) Method declared on SelectionDispatchAction.
     */
    @Override
    public void run(final ITextSelection selection) {
        final IErlElement element = editor.getElementAt(selection.getOffset(), true);

        if (element != null) {
            run(element);
        }
    }
View Full Code Here

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

            return;
        }
        if (!canEnableFor(selection)) {
            return;
        }
        final IErlElement element = (IErlElement) selection.getFirstElement();
        run(element);
    }
View Full Code Here

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

        return entry;
    }

    @Override
    public boolean isOTP() {
        final IErlElement parent = getParent();
        if (parent instanceof IErlExternal) {
            final IErlExternal external = (IErlExternal) parent;
            return external.isOTP();
        }
        return false;
View Full Code Here

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

            return;
        }
        for (final IErlElement element : elements) {
            computeAdditions1(element, map);
            if (element != null) {
                final IErlElement parent = element;
                computeAdditions1(parent.getChildren(), map);
            }
        }
    }
View Full Code Here

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

        if ((delta.getFlags() & (IErlElementDelta.F_CONTENT | IErlElementDelta.F_CHILDREN)) == 0) {
            return;
        }

        final IErlElement de = delta.getElement();
        if (de instanceof IErlModule && de != fModule) {
            return;
        }

        final ProjectionAnnotationModel model = (ProjectionAnnotationModel) fEditor
                .getAdapter(ProjectionAnnotationModel.class);
        if (model == null) {
            return;
        }

        final IDocumentProvider provider = fEditor.getDocumentProvider();

        try {
            fCachedModel = model;
            fCachedDocument = provider.getDocument(fEditor.getEditorInput());
            if (fCachedDocument.getNumberOfLines() > PerformanceTuning.get()
                    .getFoldingLimit()) {
                // disable folding for files larger than this
                model.removeAllAnnotations();
                return;
            }

            final Map<ErlangProjectionAnnotation, Position> additions = new HashMap<ErlangProjectionAnnotation, Position>();
            final List<ErlangProjectionAnnotation> deletions = new ArrayList<ErlangProjectionAnnotation>();
            final List<ErlangProjectionAnnotation> updates = new ArrayList<ErlangProjectionAnnotation>();

            // use a linked map to maintain ordering of comments
            final Map<ErlangProjectionAnnotation, Position> updated = new LinkedHashMap<ErlangProjectionAnnotation, Position>();

            computeAdditions(fModule, updated);
            final Map<Object, List<Tuple>> previous = createAnnotationMap(model);

            for (final Entry<ErlangProjectionAnnotation, Position> entry : updated
                    .entrySet()) {
                final ErlangProjectionAnnotation newAnnotation = entry.getKey();
                final IErlElement element = newAnnotation.getElement();
                final Position newPosition = entry.getValue();

                final List<Tuple> annotations = previous.get(element);
                if (annotations == null) {
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.