Examples of IErlModule


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

    public IErlModule findModuleFromProject(final IErlProject project,
            final String moduleName, final String modulePath,
            final boolean checkExternals, final IErlElementLocator.Scope scope)
            throws ErlModelException {
        if (project != null) {
            final IErlModule module = getModuleFromCacheByNameOrPath(
                    (ErlProject) project, moduleName, modulePath, scope);
            if (module != null && module.isOnSourcePath()) {
                return module;
            }
        }
        final List<IErlModule> allModules = Lists.newArrayList();
        final Set<String> paths = Sets.newHashSet();
        try {
            for (int i = 0; i < 2; ++i) {
                final boolean externalModules = i > 0;
                if (externalModules && !checkExternals) {
                    break;
                }
                if (project != null) {
                    final IErlModule module = tryFindModule(Sets.newHashSet(project),
                            moduleName, modulePath, allModules, paths, externalModules);
                    if (module != null) {
                        return module;
                    }
                }
                if ((scope == Scope.REFERENCED_PROJECTS || scope == Scope.ALL_PROJECTS)
                        && project != null) {
                    final Collection<IErlProject> projects = project
                            .getReferencedProjects();
                    final IErlModule module = tryFindModule(projects, moduleName,
                            modulePath, allModules, paths, externalModules);
                    if (module != null) {
                        return module;
                    }
                }

                if (scope == Scope.ALL_PROJECTS) {
                    final Collection<IErlProject> projects = getErlangProjects();
                    final IErlModule module = tryFindModule(projects, moduleName,
                            modulePath, allModules, paths, externalModules);
                    if (module != null) {
                        return module;
                    }
                }
View Full Code Here

Examples of org.erlide.engine.new_model.IErlModule

      MatcherAssert.<Boolean>assertThat(Boolean.valueOf(_exists_3), _is_6);
      final Iterable<IErlModule> erlFiles = erlProject.getModules();
      int _length_2 = ((Object[])Conversions.unwrapArray(erlFiles, Object.class)).length;
      Matcher<Integer> _is_7 = Matchers.<Integer>is(Integer.valueOf(1));
      MatcherAssert.<Integer>assertThat(Integer.valueOf(_length_2), _is_7);
      final IErlModule erlFile = IterableExtensions.<IErlModule>head(erlFiles);
      String _name_1 = erlFile.getName();
      Matcher<String> _is_8 = Matchers.<String>is("nop.erl");
      MatcherAssert.<String>assertThat(_name_1, _is_8);
      final Iterable<IErlModule> erlFiles2 = erlProject2.getModules();
      int _length_3 = ((Object[])Conversions.unwrapArray(erlFiles2, Object.class)).length;
      Matcher<Integer> _is_9 = Matchers.<Integer>is(Integer.valueOf(1));
      MatcherAssert.<Integer>assertThat(Integer.valueOf(_length_3), _is_9);
      final IErlModule erlFile2 = IterableExtensions.<IErlModule>head(erlFiles2);
      String _name_2 = erlFile2.getName();
      Matcher<String> _is_10 = Matchers.<String>is("nop.erl");
      MatcherAssert.<String>assertThat(_name_2, _is_10);
      IFile _file = erlFile.getFile();
      _file.delete(true, null);
      boolean _exists_4 = erlFile.exists();
      Matcher<Boolean> _is_11 = Matchers.<Boolean>is(Boolean.valueOf(false));
      MatcherAssert.<Boolean>assertThat(Boolean.valueOf(_exists_4), _is_11);
      IHandle _parent = erlFile.getParent();
      IHandle[] _children = _parent.getChildren();
      int _length_4 = _children.length;
      Matcher<Integer> _is_12 = Matchers.<Integer>is(Integer.valueOf(0));
      MatcherAssert.<Integer>assertThat(Integer.valueOf(_length_4), _is_12);
      IFile _file_1 = erlFile2.getFile();
      Path _path = new Path("/Test001/nop.erl");
      _file_1.move(_path, true, null);
      boolean _exists_5 = erlFile2.exists();
      Matcher<Boolean> _is_13 = Matchers.<Boolean>is(Boolean.valueOf(false));
      MatcherAssert.<Boolean>assertThat(Boolean.valueOf(_exists_5), _is_13);
      Iterable<IErlModule> _modules = erlProject2.getModules();
      int _length_5 = ((Object[])Conversions.unwrapArray(_modules, Object.class)).length;
      Matcher<Integer> _is_14 = Matchers.<Integer>is(Integer.valueOf(0));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.