Package org.erlide.engine.new_model

Examples of org.erlide.engine.new_model.IErlProject


        } else {
          boolean _hasNature = project.hasNature(IErlProject.NATURE_ID);
          _and = _hasNature;
        }
        if (_and) {
          final IErlProject erlProject = ErlModelCore.create(project);
          ErlDeltaProcessor.addToModel(erlProject);
          this.translateAddedDelta(delta, erlProject);
        } else {
          this.addResourceDelta(delta);
        }
View Full Code Here


    {
      IResource _resource = delta.getResource();
      final IProject project = ((IProject) _resource);
      boolean _wasErlProject = this.wasErlProject(project);
      if (_wasErlProject) {
        final IErlProject erlProject = ErlModelCore.create(project);
        ErlDeltaProcessor.removeFromModel(erlProject);
        this.translateRemovedDelta(delta, erlProject);
      } else {
        this.addResourceDelta(delta);
      }
View Full Code Here

 
  private boolean processChangedProject(final IResourceDelta delta) {
    try {
      IResource _resource = delta.getResource();
      final IProject project = ((IProject) _resource);
      final IErlProject erlProject = ErlModelCore.create(project);
      int _flags = delta.getFlags();
      int _bitwiseAnd = (_flags & IResourceDelta.OPEN);
      boolean _notEquals = (_bitwiseAnd != 0);
      if (_notEquals) {
        boolean _isOpen = project.isOpen();
        if (_isOpen) {
          boolean _hasNature = project.hasNature(IErlProject.NATURE_ID);
          if (_hasNature) {
            ErlDeltaProcessor.addToModel(erlProject);
            this.currentDelta.insertAdded(erlProject, IHandleDelta.F_OPEN);
          } else {
            this.addResourceDelta(delta);
          }
        } else {
          boolean _wasErlProject = this.wasErlProject(project);
          if (_wasErlProject) {
            ErlDeltaProcessor.removeFromModel(erlProject);
            this.currentDelta.insertRemoved(erlProject, IHandleDelta.F_OPEN);
          } else {
            this.addResourceDelta(delta);
          }
        }
        return false;
      }
      final boolean isErlProject = project.hasNature(IErlProject.NATURE_ID);
      int _flags_1 = delta.getFlags();
      int _bitwiseAnd_1 = (_flags_1 & IResourceDelta.DESCRIPTION);
      boolean _notEquals_1 = (_bitwiseAnd_1 != 0);
      if (_notEquals_1) {
        final boolean wasErlProject = this.wasErlProject(project);
        if ((wasErlProject != isErlProject)) {
          if (isErlProject) {
            ErlDeltaProcessor.addToModel(erlProject);
            this.currentDelta.insertAdded(erlProject, IHandleDelta.F_DESCRIPTION);
          } else {
            ErlDeltaProcessor.removeFromModel(erlProject);
            this.currentDelta.insertRemoved(erlProject, IHandleDelta.F_DESCRIPTION);
          }
          return false;
        } else {
          if (isErlProject) {
            this.currentDelta.insertChanged(erlProject, IHandleDelta.F_DESCRIPTION);
          }
        }
      }
      if (isErlProject) {
        int _flags_2 = delta.getFlags();
        int _bitwiseAnd_2 = (_flags_2 & IResourceDelta.MARKERS);
        boolean _notEquals_2 = (_bitwiseAnd_2 != 0);
        if (_notEquals_2) {
          IMarkerDelta[] _markerDeltas = delta.getMarkerDeltas();
          this.markersChanged(erlProject, _markerDeltas);
        }
        IHandle _parent = erlProject.getParent();
        final Body parentBody = ErlDeltaProcessor.findBody(_parent);
        final IHandle[] children = parentBody.getChildren();
        boolean _contains = ((List<IHandle>)Conversions.doWrapArray(children)).contains(erlProject);
        boolean _not = (!_contains);
        if (_not) {
View Full Code Here

      final IResource parent = _resource.getParent();
      if ((parent instanceof IWorkspaceRoot)) {
        handleDelta = this.currentDelta;
      } else {
        if ((parent instanceof IProject)) {
          final IErlProject erlProject = ErlModelCore.create(((IProject)parent));
          HandleDelta _deltaFor = this.currentDelta.getDeltaFor(erlProject);
          handleDelta = _deltaFor;
          boolean _tripleEquals = (handleDelta == null);
          if (_tripleEquals) {
            HandleDelta _handleDelta = new HandleDelta(erlProject);
View Full Code Here

  private IErlSource erlFile;
 
  @Before
  public void setup() throws Exception {
    IProject _setUpProject = this.setUpProject("Test002");
    final IErlProject erlProject = ErlModelCore.create(_setUpProject);
    IErlSource _sourceFile = erlProject.getSourceFile("src/nop.erl");
    this.erlFile = _sourceFile;
  }
View Full Code Here

      Iterable<IErlProject> erlProjects = erlModel.getProjects();
      final Iterable<IErlProject> _converted_erlProjects = (Iterable<IErlProject>)erlProjects;
      int _length = ((Object[])Conversions.unwrapArray(_converted_erlProjects, Object.class)).length;
      Matcher<Integer> _is = Matchers.<Integer>is(Integer.valueOf(1));
      MatcherAssert.<Integer>assertThat(Integer.valueOf(_length), _is);
      final IErlProject erlProject = IterableExtensions.<IErlProject>head(erlProjects);
      String _name = erlProject.getName();
      Matcher<String> _is_1 = Matchers.<String>is("Test001");
      MatcherAssert.<String>assertThat(_name, _is_1);
      final IErlProject erlProject2 = erlModel.getProject("Test002");
      boolean _exists = erlProject2.exists();
      Matcher<Boolean> _is_2 = Matchers.<Boolean>is(Boolean.valueOf(false));
      MatcherAssert.<Boolean>assertThat(Boolean.valueOf(_exists), _is_2);
      this.setUpProject("Test002");
      boolean _exists_1 = erlProject2.exists();
      Matcher<Boolean> _is_3 = Matchers.<Boolean>is(Boolean.valueOf(true));
      MatcherAssert.<Boolean>assertThat(Boolean.valueOf(_exists_1), _is_3);
      Iterable<IErlProject> _projects = erlModel.getProjects();
      erlProjects = _projects;
      final Iterable<IErlProject> _converted_erlProjects_1 = (Iterable<IErlProject>)erlProjects;
      int _length_1 = ((Object[])Conversions.unwrapArray(_converted_erlProjects_1, Object.class)).length;
      Matcher<Integer> _is_4 = Matchers.<Integer>is(Integer.valueOf(2));
      MatcherAssert.<Integer>assertThat(Integer.valueOf(_length_1), _is_4);
      final Function1<IErlProject, Boolean> _function = new Function1<IErlProject, Boolean>() {
        public Boolean apply(final IErlProject it) {
          return Boolean.valueOf(Objects.equal(it, erlProject));
        }
      };
      boolean _exists_2 = IterableExtensions.<IErlProject>exists(erlProjects, _function);
      Matcher<Boolean> _is_5 = Matchers.<Boolean>is(Boolean.valueOf(true));
      MatcherAssert.<Boolean>assertThat(Boolean.valueOf(_exists_2), _is_5);
      final Function1<IErlProject, Boolean> _function_1 = new Function1<IErlProject, Boolean>() {
        public Boolean apply(final IErlProject it) {
          return Boolean.valueOf(Objects.equal(it, erlProject2));
        }
      };
      boolean _exists_3 = IterableExtensions.<IErlProject>exists(erlProjects, _function_1);
      Matcher<Boolean> _is_6 = Matchers.<Boolean>is(Boolean.valueOf(true));
      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));
      MatcherAssert.<Integer>assertThat(Integer.valueOf(_length_5), _is_14);
      Iterable<IErlModule> _modules_1 = erlProject.getModules();
      int _length_6 = ((Object[])Conversions.unwrapArray(_modules_1, Object.class)).length;
View Full Code Here

 
  @Test
  public void testErlModelNotification() {
    try {
      final IErlModel erlModel = ErlModelCore.getErlModel();
      final IErlProject erlProject1 = erlModel.getProject("Test001");
      final IErlProject erlProject2 = erlModel.getProject("Test002");
      this.setUpProject("Test002");
      HandleDelta _newDelta = this.newDelta();
      HandleDelta _insertAdded = _newDelta.insertAdded(erlProject2);
      ErlNotificationTest.assertEquality(_insertAdded, this.listener.delta);
      final IErlSource erlFile1 = erlProject1.getSourceFile("src/nop.erl");
      IFile _file = erlFile1.getFile();
      _file.touch(null);
      HandleDelta _newDelta_1 = this.newDelta();
      HandleDelta _insertChanged = _newDelta_1.insertChanged(erlFile1, HandleDelta.F_CONTENT);
      ErlNotificationTest.assertEquality(_insertChanged, this.listener.delta);
      IFile _file_1 = erlFile1.getFile();
      Path _path = new Path("/Test002/test1.erl");
      _file_1.copy(_path, true, null);
      HandleDelta _newDelta_2 = this.newDelta();
      IErlSource _sourceFile = erlProject2.getSourceFile("test1.erl");
      HandleDelta _insertAdded_1 = _newDelta_2.insertAdded(_sourceFile);
      ErlNotificationTest.assertEquality(_insertAdded_1, this.listener.delta);
      IFile _file_2 = erlFile1.getFile();
      _file_2.delete(true, null);
      HandleDelta _newDelta_3 = this.newDelta();
      HandleDelta _insertRemoved = _newDelta_3.insertRemoved(erlFile1);
      ErlNotificationTest.assertEquality(_insertRemoved, this.listener.delta);
      final IErlSource erlFile2 = erlProject2.getSourceFile("nop.erl");
      final IErlSource movedErlFile2 = erlProject1.getSourceFile("test1.erl");
      IFile _file_3 = erlFile2.getFile();
      Path _path_1 = new Path("/Test001/test1.erl");
      _file_3.move(_path_1, true, null);
      HandleDelta _newDelta_4 = this.newDelta();
      HandleDelta _insertMovedTo = _newDelta_4.insertMovedTo(movedErlFile2, erlFile2);
      HandleDelta _insertMovedFrom = _insertMovedTo.insertMovedFrom(erlFile2, movedErlFile2);
      ErlNotificationTest.assertEquality(_insertMovedFrom,
        this.listener.delta);
      IProject _workspaceProject = erlProject2.getWorkspaceProject();
      _workspaceProject.close(null);
      HandleDelta _newDelta_5 = this.newDelta();
      HandleDelta _insertRemoved_1 = _newDelta_5.insertRemoved(erlProject2, HandleDelta.F_OPEN);
      ErlNotificationTest.assertEquality(_insertRemoved_1, this.listener.delta);
      IProject _workspaceProject_1 = erlProject2.getWorkspaceProject();
      _workspaceProject_1.open(null);
      HandleDelta _newDelta_6 = this.newDelta();
      HandleDelta _insertAdded_2 = _newDelta_6.insertAdded(erlProject2, HandleDelta.F_OPEN);
      ErlNotificationTest.assertEquality(_insertAdded_2, this.listener.delta);
      IProject _workspaceProject_2 = erlProject2.getWorkspaceProject();
      _workspaceProject_2.delete(true, null);
      HandleDelta _newDelta_7 = this.newDelta();
      HandleDelta _insertRemoved_2 = _newDelta_7.insertRemoved(erlProject2);
      ErlNotificationTest.assertEquality(_insertRemoved_2, this.listener.delta);
      IProject _workspaceProject_3 = erlProject1.getWorkspaceProject();
      final IProjectDescription description = _workspaceProject_3.getDescription();
      final String[] oldNatures = description.getNatureIds();
      description.setNatureIds(new String[] {});
      IProject _workspaceProject_4 = erlProject1.getWorkspaceProject();
      _workspaceProject_4.setDescription(description, null);
      HandleDelta _newDelta_8 = this.newDelta();
      HandleDelta _insertRemoved_3 = _newDelta_8.insertRemoved(erlProject1, HandleDelta.F_DESCRIPTION);
      ErlNotificationTest.assertEquality(_insertRemoved_3, this.listener.delta);
      description.setNatureIds(oldNatures);
      IProject _workspaceProject_5 = erlProject1.getWorkspaceProject();
      _workspaceProject_5.setDescription(description, null);
      HandleDelta _newDelta_9 = this.newDelta();
      int _bitwiseOr = (HandleDelta.F_DESCRIPTION | HandleDelta.F_CONTENT);
      HandleDelta _insertChanged_1 = _newDelta_9.insertChanged(erlProject1, _bitwiseOr);
      ErlNotificationTest.assertEquality(_insertChanged_1,
        this.listener.delta);
      final IErlProject movedErlProject1 = erlModel.getProject("Test");
      IProject _workspaceProject_6 = erlProject1.getWorkspaceProject();
      Path _path_2 = new Path("Test");
      _workspaceProject_6.move(_path_2, true, null);
      HandleDelta _newDelta_10 = this.newDelta();
      HandleDelta _insertMovedTo_1 = _newDelta_10.insertMovedTo(movedErlProject1, erlProject1);
View Full Code Here

  public static IErlModel getErlModel() {
    return ErlModelManager.INSTANCE.getErlModel();
  }
 
  public static IErlProject create(final IProject project) {
    IErlProject _xifexpression = null;
    boolean _tripleEquals = (project == null);
    if (_tripleEquals) {
      _xifexpression = null;
    } else {
      IErlModel _erlModel = ErlModelCore.getErlModel();
View Full Code Here

      boolean _notEquals = (_type != IResource.PROJECT);
      if (_notEquals) {
        return null;
      }
      IProject _project = file.getProject();
      final IErlProject project = ErlModelCore.create(_project);
      String _name = file.getName();
      _xblockexpression = project.getSourceFile(_name);
    }
    return _xblockexpression;
  }
View Full Code Here

TOP

Related Classes of org.erlide.engine.new_model.IErlProject

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.