Package org.erlide.engine.model.erlang

Examples of org.erlide.engine.model.erlang.ISourceReference

Source reference elements may be working copies if they were created from a compilation unit that is a working copy.

@noimplement This interface is not intended to be implemented by clients.


        return ErlangEngine.getInstance().getModel()
                .innermostThat(this, new Predicate<IErlElement>() {
                    @Override
                    public boolean apply(final IErlElement e) {
                        if (e instanceof ISourceReference) {
                            final ISourceReference ch = (ISourceReference) e;
                            ISourceRange r;
                            r = ch.getSourceRange();
                            if (r != null && r.hasPosition(position)) {
                                return true;
                            }
                        }
                        return false;
View Full Code Here


        return (IErlMember) ErlangEngine.getInstance().getModel()
                .innermostThat(this, new Predicate<IErlElement>() {
                    @Override
                    public boolean apply(final IErlElement e) {
                        if (e instanceof ISourceReference) {
                            final ISourceReference sr = (ISourceReference) e;
                            if (sr.getLineStart() <= lineNumber
                                    && sr.getLineEnd() >= lineNumber) {
                                return true;
                            }
                        }
                        return false;
                    }
View Full Code Here

        if (element instanceof IErlModule) {
            final IErlModule m = (IErlModule) element;
            length = doc.getLength();
            name = m.getModuleName();
        } else if (element instanceof ISourceReference) {
            final ISourceReference sourceReference = (ISourceReference) element;
            final ISourceRange sr = sourceReference.getSourceRange();
            start = sr.getOffset();
            length = sr.getLength();
        }
        return new ErlNode(parent, element.getKind(), name,
                ErlangCompareUtilities.getErlElementID(element), doc, start, length);
View Full Code Here

     *            the erlang element that can be folded
     * @return the regions to be folded, or <code>null</code> if there are none
     */
    private IRegion computeProjectionRanges(final IErlElement element) {
        if (element instanceof ISourceReference) {
            final ISourceReference reference = (ISourceReference) element;
            final ISourceRange range = reference.getSourceRange();
            return new Region(range.getOffset(), range.getLength());
        }
        return null;
    }
View Full Code Here

     *
     * @return the adornment flags
     */
    protected int computeAdornmentFlags(final Object obj) {
        try {
            final ISourceReference r = obj instanceof ISourceReference ? (ISourceReference) obj
                    : null;
            if (obj instanceof IResource) {
                return getErrorTicksFromMarkers((IResource) obj,
                        IResource.DEPTH_INFINITE, r);
            } else if (obj instanceof IErlElement) {
View Full Code Here

     * (...).new OpenAndLinkWithEditorHelper() {...}.linkToEditor(ISelection)
     *
     * @param selection
     */
    public void doSelectionChanged(final ISelection selection) {
        ISourceReference reference = null;
        if (selection instanceof IStructuredSelection) {
            final IStructuredSelection ss = (IStructuredSelection) selection;
            for (final Object o : ss.toArray()) {
                if (o instanceof ISourceReference) {
                    reference = (ISourceReference) o;
View Full Code Here

    protected void selectionChanged() {
        if (getSelectionProvider() == null) {
            return;
        }
        final ISourceReference element = computeHighlightRangeSourceReference();
        if (isLinkedToOutlinePage()) {
            synchronizeOutlinePage(element);
        }
        setSelection(element, false);
        // updateStatusLine();
View Full Code Here

        if (element == null || element instanceof IErlModule) {
            return;
        }

        if (element instanceof ISourceReference) {
            final ISourceReference reference = (ISourceReference) element;
            // set highlight range
            setSelection(reference, true);
            if (myOutlinePage != null) {
                myOutlinePage.select(reference);
            }
View Full Code Here

                        + selection.getLength();
                try {
                    final IErlElement e1 = module.getElementAt(offset1);
                    final IErlElement e2 = module.getElementAt(offset2);
                    if (e1 instanceof ISourceReference) {
                        final ISourceReference ref1 = (ISourceReference) e1;
                        final ISourceRange r1 = ref1.getSourceRange();
                        final int offset = r1.getOffset();
                        int length = r1.getLength();
                        if (e1 == e2) {
                            final int docLength = document.getLength();
                            if (offset + length > docLength) {
                                length = docLength - offset;
                            }
                            return extendSelectionToWholeLines(document,
                                    new TextSelection(document, offset, length));
                        } else if (e2 == null) {
                            return extendSelectionToWholeLines(
                                    document,
                                    new TextSelection(document, offset, selection
                                            .getLength() + selection.getOffset() - offset));
                        } else if (e2 instanceof ISourceReference) {
                            final ISourceReference ref2 = (ISourceReference) e2;
                            final ISourceRange r2 = ref2.getSourceRange();
                            return extendSelectionToWholeLines(document,
                                    new TextSelection(document, offset, r2.getOffset()
                                            - offset + r2.getLength()));
                        }
                    }
View Full Code Here

        try {
            if (module != null) {
                try {
                    final IErlElement element = module.getElementAt(offset);
                    if (element instanceof ISourceReference) {
                        final ISourceReference sr = (ISourceReference) element;
                        final int start = sr.getSourceRange().getOffset();
                        if (start <= offset) {
                            return doc.get(start, offset - start);
                        }
                    }
                } catch (final ErlModelException e) {
View Full Code Here

TOP

Related Classes of org.erlide.engine.model.erlang.ISourceReference

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.