Package org.erlide.engine.model.erlang

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


        if (element instanceof IErlFolder) {
            final IErlFolder folder = (IErlFolder) element;
            folder.open(null);
            result.addAll(folder.getModules());
        } else if (element instanceof IErlModule) {
            final IErlModule module = (IErlModule) element;
            result.add(module);
        } else if (element instanceof IErlProject) {
            final IErlProject project = (IErlProject) element;
            project.open(null);
            result.addAll(project.getModules());
View Full Code Here


  }
 
  public IErlModule createModule(final IErlProject project, final String moduleName, final String moduleContents) throws CoreException {
    IProject _workspaceProject = project.getWorkspaceProject();
    final IFolder folder = _workspaceProject.getFolder("src");
    final IErlModule module = this.createModule(folder, moduleName, moduleContents);
    return module;
  }
View Full Code Here

  }
 
  public IErlModule createInclude(final IErlProject project, final String moduleName, final String moduleContents) throws CoreException {
    IProject _workspaceProject = project.getWorkspaceProject();
    final IFolder folder = _workspaceProject.getFolder("include");
    final IErlModule module = this.createModule(folder, moduleName, moduleContents);
    return module;
  }
View Full Code Here

  }
 
  private IErlModule createModule(final IFolder folder, final String moduleName, final String moduleContents) throws CoreException {
    final IFile file = this.createFile(folder, moduleName, moduleContents);
    final IErlModel model = this.getModel();
    IErlModule module = model.findModule(file);
    boolean _tripleNotEquals = (module != null);
    if (_tripleNotEquals) {
      module.close();
    }
    boolean _tripleEquals = (module == null);
    if (_tripleEquals) {
      IPath _location = file.getLocation();
      final String path = _location.toPortableString();
      String _name = file.getName();
      Charset _defaultCharset = Charset.defaultCharset();
      String _name_1 = _defaultCharset.name();
      IErlModule _moduleFromFile = model.getModuleFromFile(model, _name, path, _name_1, path);
      module = _moduleFromFile;
    }
    return module;
  }
View Full Code Here

  }
 
  public IErlModule createModuleFromText(final String name, final String initialText) {
    IErlModel _model = this.getModel();
    IErlModel _model_1 = this.getModel();
    final IErlModule module = _model.getModuleFromText(_model_1, name, initialText, name);
    return module;
  }
View Full Code Here

    protected void resetClauseHead(final int lineNumber, final IResource resource) {
        clauseHead = "";
        if (resource instanceof IFile) {
            final IFile file = (IFile) resource;
            final IErlModule m = ErlangEngine.getInstance().getModel().findModule(file);
            if (m != null) {
                try {
                    m.open(null);
                    final IErlElement e = m.getElementAtLine(lineNumber);
                    if (e instanceof IErlFunctionClause) {
                        final IErlFunctionClause clause = (IErlFunctionClause) e;
                        clauseHead = clause.getName() + clause.getHead();
                    }
                } catch (final ErlModelException e1) {
View Full Code Here

                final IStructuredSelection s = (IStructuredSelection) event
                        .getSelection();
                final Object o = s.getFirstElement();
                if (o instanceof IErlModule) {
                    final IErlModule m = (IErlModule) o;
                    WranglerUtils.openFile((IFile) m.getResource());
                } else if (o instanceof IErlFunctionClause) {
                    WranglerUtils.highlightSelection((IErlFunctionClause) o);
                }

            }
View Full Code Here

    class ViewLabelProvider extends LabelProvider implements ITableLabelProvider {
        @Override
        public String getColumnText(final Object obj, final int index) {
            final IErlElement e = (IErlElement) obj;
            if (e instanceof IErlModule) {
                final IErlModule m = (IErlModule) e;
                return m.getModuleName() + "\t\t- "
                        + e.getResource().getFullPath().toString();
            } else if (e instanceof IErlFunctionClause) {
                final IErlFunctionClause fc = (IErlFunctionClause) e;
                return ErlangEngine.getInstance().getModelUtilService().getModule(fc)
                        .getModuleName()
View Full Code Here

    public static IErlElement getElement(final ILineBreakpoint breakpoint) {
        final IErlElementLocator model = ErlangEngine.getInstance().getModel();
        final IErlElement element = model.findElement(breakpoint.getMarker()
                .getResource());
        if (element instanceof IErlModule) {
            final IErlModule m = (IErlModule) element;
            try {
                m.open(null);
                final int lineNumber = breakpoint.getLineNumber();
                return m.getElementAtLine(lineNumber - 1);
            } catch (final Exception e) {
                ErlLogger.warn(e);
            }
        }
        return null;
View Full Code Here

        // a project with an include dir outside the model, the include file
        // contains a record def
        try {
            final String projectName = "testprojectx";
            project = createProject(projectName, getTmpPath(projectName));
            final IErlModule module = createModule(project, "a.erl",
                    "-include(\"x.hrl\").\n");
            final String includeName = "x.hrl";
            externalInclude = createTmpFile(includeName,
                    "-record(rec2, {field, another=def}.");
            final String includePath = externalInclude.getAbsolutePath();
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.