Package org.erlide.ui.editors.erl

Examples of org.erlide.ui.editors.erl.AbstractErlangEditor


        setSearchFor(initData.getSearchFor());
    }

    public SearchPatternData tryErlangTextSelection(final SearchPatternData initData0,
            final IEditorPart activePart) throws ErlModelException {
        final AbstractErlangEditor erlangEditor = (AbstractErlangEditor) activePart;
        final IErlModule module = erlangEditor.getModule();
        SearchPatternData initData = initData0;
        if (module != null) {
            final ISelection ssel = erlangEditor.getSite().getSelectionProvider()
                    .getSelection();
            final ITextSelection textSel = (ITextSelection) ssel;
            final int offset = textSel.getOffset();
            OpenResult res;
            try {
View Full Code Here


        }
        return detectHyperlinks(document, region.getOffset());
    }

    private IHyperlink[] detectHyperlinks(final IDocument doc, final int offset) {
        final AbstractErlangEditor editor = (AbstractErlangEditor) getAdapter(AbstractErlangEditor.class);
        if (editor == null) {
            return null;
        }
        final ErlToken token = editor.getScanner().getTokenAt(offset);
        if (token == null) {
            return null;
        }
        final int tokenKind = token.getKind();
        if (tokenKind != ErlToken.KIND_ATOM && tokenKind != ErlToken.KIND_STRING
View Full Code Here

            final ErlangSearchElement ese = (ErlangSearchElement) element;
            final IErlModule module = ese.getModule();
            final IEditorPart editor = EditorUtility.openInEditor(module);
            if (offset != 0) {
                if (editor instanceof ErlangEditor) {
                    final AbstractErlangEditor ee = (AbstractErlangEditor) editor;
                    ee.selectAndReveal(offset, length);
                } else if (editor != null) {
                    showWithMarker(editor, module, offset, length);
                }
            }
        }
View Full Code Here

    /**
     * Activate editor and select erlang function
     */
    public static boolean openFunctionInEditor(final ErlangFunction erlangFunction,
            final IEditorPart editor) throws CoreException {
        final AbstractErlangEditor erlangEditor = (AbstractErlangEditor) editor;
        final IErlModule module = erlangEditor.getModule();
        if (module == null) {
            return false;
        }
        module.open(null);
        final IErlFunction function = module.findFunction(erlangFunction);
View Full Code Here

        return true;
    }

    public static boolean openTypeInEditor(final String typeName, final IEditorPart editor)
            throws CoreException {
        final AbstractErlangEditor erlangEditor = (AbstractErlangEditor) editor;
        final IErlModule module = erlangEditor.getModule();
        if (module == null) {
            return false;
        }
        module.open(null);
        final IErlTypespec typespec = ErlangEngine.getInstance().getModelFindService()
View Full Code Here

    @Override
    public boolean isShownInEditor(final Match match, final IEditorPart editor) {
        final ErlangSearchElement ese = (ErlangSearchElement) match.getElement();
        final IFile file = ResourceUtil.getFileFromLocation(ese.getModuleName());
        if (editor instanceof ErlangEditor) {
            final AbstractErlangEditor erlangEditor = (AbstractErlangEditor) editor;
            final IErlModule module = erlangEditor.getModule();
            if (module != null) {
                if (file != null) {
                    return file.equals(module.getResource());
                }
                return ese.getModuleName().equals(module.getFilePath());
View Full Code Here

            }
        } else if (edocView != null) {
            input = edocView.getInput();
        }
        if (input != null) {
            final AbstractErlangEditor editor = input.getEditor();
            String moduleName = "";
            final Object inputElement = input.getInputElement();
            if (inputElement instanceof ExternalCallOpenResult) {
                final ExternalCallOpenResult or = (ExternalCallOpenResult) inputElement;
                moduleName = or.getMod();
            }
            final ErlangFunctionCall functionCall = HoverUtil.eventToErlangFunctionCall(
                    moduleName, event);
            if (functionCall != null) {
                final IErlProject project = ErlangEngine.getInstance()
                        .getModelUtilService().getProject(editor.getModule());
                if (project == null) {
                    return;
                }
                final IOtpRpc backend = BackendCore.getBuildBackend(project);
View Full Code Here

        }
    }

    @Override
    public void run() {
        final AbstractErlangEditor e = (AbstractErlangEditor) getTextEditor();
        e.gotoAnnotation(fForward);
    }
View Full Code Here

                if (element instanceof IErlElement) {
                    EditorUtility.openElementInEditor(element, true);
                } else if (element instanceof OpenResult) {
                    final OpenResult or = (OpenResult) element;
                    try {
                        final AbstractErlangEditor editor = input.getEditor();
                        new OpenUtils().openOpenResult(editor, editor.getModule(), -1,
                                null, or, null);
                    } catch (final Exception e) {
                        ErlLogger.error(e);
                    }
                }
View Full Code Here

        for (final IEditorPart editorPart : allErlangEditors) {
            if (inputElement instanceof IErlElement) {
                final IErlElement element = (IErlElement) inputElement;
                final IErlModule module = ErlangEngine.getInstance()
                        .getModelUtilService().getModule(element);
                final AbstractErlangEditor editor = (AbstractErlangEditor) editorPart;
                if (module.equals(editor.getModule())) {
                    return editorPart;
                }
            }
        }
        final IEditorInput input = getEditorInput(inputElement);
View Full Code Here

TOP

Related Classes of org.erlide.ui.editors.erl.AbstractErlangEditor

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.