Package org.erlide.ui.editors.erl

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


    @Override
    protected Object getInfoForSelection(final IWorkbenchPart part,
            final ISelection selection) {
        if (selection instanceof ITextSelection && part instanceof ErlangEditor) {
            final ITextSelection sel = (ITextSelection) selection;
            final ErlangEditor editor = (ErlangEditor) part;
            return ErlTextHover.getHoverInfoForOffset(sel.getOffset(), editor);
        }
        return null;
    }
View Full Code Here


        final IEditorPart editorPart = PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getActivePage().getActiveEditor();
        if (!(editorPart instanceof ErlangEditor)) {
            return false;
        }
        final ErlangEditor editor = (ErlangEditor) editorPart;
        if (editor.getViewer() != viewer) {
            return false;
        }

        final IErlModule module = editor.getModule();

        final int offset = invocationContext.getOffset();
        final ErlToken token = module.getScanner().getTokenAt(offset);
        if (token == null || token.getKind() != ErlToken.KIND_STRING) {
            return false;
View Full Code Here

                    try {
                        final List<IEditorReference> editorRefs = getWorkbenchEditorReferences();
                        for (final IEditorReference editorRef : editorRefs) {
                            final IEditorPart editor = editorRef.getEditor(false);
                            if (editor instanceof ErlangEditor) {
                                final ErlangEditor erlangEditor = (ErlangEditor) editor;
                                ClearCacheAction.resetCacheForEditor(erlangEditor);
                            }
                        }
                    } catch (final Exception e) {
                        // ignore
View Full Code Here

    }

    @Override
    public void run() {
        if (getTextEditor() instanceof ErlangEditor) {
            final ErlangEditor editor = (ErlangEditor) getTextEditor();
            final Shell parent = getTextEditor().getSite().getShell();
            final QuickOutlinePopupDialog quickOutlinePopupDialog = new QuickOutlinePopupDialog(
                    parent, SWT.NONE, editor, editor, editor);

            quickOutlinePopupDialog.open();
View Full Code Here

    public Object execute(final ExecutionEvent event) throws ExecutionException {
        final IEditorPart activeEditor = HandlerUtil.getActiveEditor(event);
        if (!(activeEditor instanceof ErlangEditor)) {
            return null;
        }
        final ErlangEditor editor = (ErlangEditor) activeEditor;
        final boolean collapse = event.getParameter(
                "org.erlide.ui.commands.expandCollapseParameter").equals("collapse");
        final boolean comments = event.getParameter(
                "org.erlide.ui.commands.foldWhatParameter").equals("comments");
        editor.expandCollapseFunctionsOrComments(collapse, comments);
        return null;
    }
View Full Code Here

            if (p == null || !(p instanceof ErlangEditor)) {
                return;
            }

            final ErlangEditor editor = (ErlangEditor) p;

            IErlModule module;
            try {
                module = ErlangEngine.getInstance().getModel().findModule(moduleName);

                final IErlFunction f = module.findFunction(new ErlangFunction(fs
                        .getLabel(), fs.getArity()));

                editor.setSelection(f);

            } catch (final ErlModelException e) {
                ErlLogger.error(e);
            }
View Full Code Here

                }
            }
        }
        if (part instanceof ErlangEditor) {
            part.setFocus();
            final ErlangEditor ee = (ErlangEditor) part;
            final IDocument d = ee.getDocument();
            int lineStart, lineLength;
            try {
                lineStart = d.getLineOffset(line - 1);
                lineLength = d.getLineLength(line - 1);
                EditorUtility.revealInEditor(ee, lineStart, lineLength - 1);
View Full Code Here

TOP

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

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.