Package org.erlide.engine.model.erlang

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


    public void performApply(final ILaunchConfigurationWorkingCopy config) {
        config.setAttribute(ErlRuntimeAttributes.DEBUG_FLAGS,
                ErlDebugFlags.getFlag(getFlagCheckboxes()));
        final List<String> r = new ArrayList<String>();
        for (final Object o : contentProvider.getElements(null)) {
            final IErlModule module = (IErlModule) o;
            r.add(ErlangEngine.getInstance().getModelUtilService().getProject(module)
                    .getName()
                    + ":" + module.getName());
        }
        config.setAttribute(ErlRuntimeAttributes.DEBUG_INTERPRET_MODULES, r);
    }
View Full Code Here


            ((IPostSelectionProvider) selectionProvider)
                    .addPostSelectionChangedListener(fPostSelectionListener);

            if (forceUpdate) {
                fForcedMarkOccurrencesSelection = selectionProvider.getSelection();
                final IErlModule module = editor.getModule();
                if (module != null) {
                    editor.markOccurencesHandler.updateOccurrenceAnnotations(
                            (ITextSelection) fForcedMarkOccurrencesSelection, module);
                }
            }
View Full Code Here

     */
    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);
                    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();
View Full Code Here

                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) {
View Full Code Here

    private IEditorPart openInEditor(final String name) {

        // search

        IErlModule module;
        try {
            module = ErlangEngine.getInstance().getModel().findModule(name);
        } catch (final ErlModelException e1) {
            e1.printStackTrace();
            return null;
        }

        log.info(module.getFilePath());

        final File fileToOpen = new File(module.getFilePath());

        final IFileStore fileStore = EFS.getLocalFileSystem()
                .getStore(fileToOpen.toURI());
        final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
                .getActivePage();
View Full Code Here

        return fCachedPathVars;
    }

    @Override
    public IErlFunction findFunction(final FunctionRef r) throws ErlModelException {
        final IErlModule module = findModule(r.module);
        if (module == null) {
            return null;
        }
        module.open(null);
        return module.findFunction(new ErlangFunction(r.function, r.arity));
    }
View Full Code Here

    }

    private IErlModule getModuleWithoutResource(final IErlElement parent,
            final String name, final String path, final String encoding,
            final String initialText, final String key) {
        IErlModule m = moduleMap.get(key);
        if (m == null) {
            final IErlElement parent2 = parent == null ? this : parent;
            m = new ErlModule(parent2, name, path, encoding, initialText);
            if (key != null) {
                moduleMap.put(key, m);
View Full Code Here

        if (file == null) {
            return null;
        }
        final String name = file.getName();
        if (CommonUtils.isErlangFileContentFileName(name)) {
            final IErlModule module = new ErlModule(parent, name, file);
            if (parent != null) {
                parent.addChild(module);
            }
            return module;
        }
View Full Code Here

    private static IErlModule getModuleFromCacheByNameOrPath(final ErlProject project,
            final String moduleName, final String modulePath,
            final IErlElementLocator.Scope scope) {
        final ErlModelCache erlModelCache = ErlModelCache.getDefault();
        if (modulePath != null) {
            final IErlModule module = erlModelCache.getModuleByPath(modulePath);
            if (module != null && (project == null || project.moduleInProject(module))) {
                return module;
            }
        }
        return null;
View Full Code Here

    private IErlModule findIncludeFromProject(final IErlProject project,
            final String includeName, final String includePath,
            final boolean checkExternals, final IErlElementLocator.Scope scope)
            throws ErlModelException {
        if (project != null) {
            final IErlModule module = getModuleFromCacheByNameOrPath(
                    (ErlProject) project, includeName, includePath, scope);
            if (module != null && module.isOnIncludePath()) {
                return module;
            }
        }
        final Collection<IErlModule> includes = getAllIncludes(project, checkExternals,
                scope);
View Full Code Here

TOP

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

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.