Package org.erlide.ui.editors.erl

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


     *            the selection range
     */
    protected void selectAndReveal(final int newOffset, final int newLength,
            final ITextEditor editor) {
        if (editor instanceof ErlangEditor) {
            final AbstractErlangEditor erlEditor = (AbstractErlangEditor) editor;
            erlEditor.selectAndReveal(newOffset, newLength);
        } else {
            // this is too intrusive, but will never get called anyway
            editor.selectAndReveal(newOffset, newLength);
        }

View Full Code Here


     * @return new {@link ITextSelection} with all text up to selection
     */
    protected ITextSelection getTextSelection(final IDocument document,
            final ITextSelection selection, final ITextEditor editor) {
        if (editor instanceof ErlangEditor) {
            final AbstractErlangEditor erlangEditor = (AbstractErlangEditor) editor;
            final IErlModule module = erlangEditor.getModule();
            if (module != null) {
                final int offset1 = selection.getOffset(), offset2 = offset1
                        + selection.getLength();
                try {
                    final IErlElement e1 = module.getElementAt(offset1);
View Full Code Here

    @Override
    public void launch(final IEditorPart editor, final String mode) {
        ErlLogger.debug("** Launch :: " + editor.getTitle());
        if (editor instanceof AbstractErlangEditor) {
            final AbstractErlangEditor erlangEditor = (AbstractErlangEditor) editor;
            final IErlProject project = erlangEditor.getProject();
            if (project != null) {
                try {
                    doLaunch(mode, Lists.newArrayList(project));
                } catch (final CoreException e) {
                    final IWorkbench workbench = PlatformUI.getWorkbench();
View Full Code Here

            IErlElement element = null;
            IErlProject project = null;
            IErlModule module = null;
            final IErlModel model = ErlangEngine.getInstance().getModel();
            if (activeEditor instanceof AbstractErlangEditor) {
                final AbstractErlangEditor editor = (AbstractErlangEditor) activeEditor;
                textEditor = editor;
                editor.reconcileNow();
                final String scannerName = editor.getScannerName();
                module = editor.getModule();
                project = editor.getProject();
                openResult = ErlangEngine
                        .getInstance()
                        .getService(OpenService.class)
                        .open(scannerName,
                                offset,
                                ErlangEngine.getInstance().getModelUtilService()
                                        .getImportsAsList(module),
                                project.getProperties().getExternalModules(),
                                model.getPathVars(module.getCorrespondingResource()));
                ErlLogger.debug("open " + openResult);
                element = editor.getElementAt(offset, true);
            } else if (activeEditor instanceof ITextEditor) {
                textEditor = (ITextEditor) activeEditor;
                final String text = textEditor.getDocumentProvider()
                        .getDocument(textEditor.getEditorInput()).get();
                openResult = ErlangEngine.getInstance().getService(OpenService.class)
View Full Code Here

public class ErlBreakpointAdapterFactory implements IAdapterFactory {

    @Override
    public Object getAdapter(final Object adaptableObject, final Class adapterType) {
        if (adaptableObject instanceof ErlangEditor) {
            final AbstractErlangEditor editorPart = (AbstractErlangEditor) adaptableObject;
            final IResource resource = (IResource) editorPart.getEditorInput()
                    .getAdapter(IResource.class);
            if (resource != null) {
                final String extension = resource.getFileExtension();
                if (extension != null && "erl".equals(extension)) {
                    return new ErlLineBreakpointAdapter();
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.