Package org.erlide.engine.new_model

Examples of org.erlide.engine.new_model.IErlModel


    return _xifexpression;
  }
 
  public void init(final IViewSite site) throws PartInitException {
    super.init(site);
    IErlModel _erlModel = ErlModelCore.getErlModel();
    _erlModel.addElementChangeListener(this);
  }
View Full Code Here


    IErlModel _erlModel = ErlModelCore.getErlModel();
    _erlModel.addElementChangeListener(this);
  }
 
  public void dispose() {
    IErlModel _erlModel = ErlModelCore.getErlModel();
    _erlModel.removeElementChangeListener(this);
    super.dispose();
  }
View Full Code Here

      this.initOldErlProjectNames();
      int _flags = delta.getFlags();
      int _bitwiseAnd = (_flags & IResourceDelta.MARKERS);
      boolean _notEquals = (_bitwiseAnd != 0);
      if (_notEquals) {
        IErlModel _erlModel = ErlModelCore.getErlModel();
        IMarkerDelta[] _markerDeltas = delta.getMarkerDeltas();
        this.markersChanged(_erlModel, _markerDeltas);
      }
      _xblockexpression = true;
    }
View Full Code Here

    }
  }
 
  private void initOldErlProjectNames() {
    try {
      IErlModel _erlModel = ErlModelCore.getErlModel();
      final Iterable<IErlProject> erlProjects = _erlModel.getProjects();
      final Function1<IErlProject, String> _function = new Function1<IErlProject, String>() {
        public String apply(final IErlProject it) {
          return it.getName();
        }
      };
View Full Code Here

  }
 
  @Test
  public void testErlModel() {
    try {
      final IErlModel erlModel = ErlModelCore.getErlModel();
      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);
View Full Code Here

 
  @Before
  public void setup() {
    try {
      this.setUpProject("Test001");
      final IErlModel erlModel = ErlModelCore.getErlModel();
      erlModel.addElementChangeListener(this.listener);
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
  }
View Full Code Here

    }
  }
 
  @After
  public void teardown() {
    final IErlModel erlModel = ErlModelCore.getErlModel();
    erlModel.removeElementChangeListener(this.listener);
  }
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

      throw Exceptions.sneakyThrow(_e);
    }
  }
 
  private HandleDelta newDelta() {
    final IErlModel erlModel = ErlModelCore.getErlModel();
    return new HandleDelta(erlModel);
  }
View Full Code Here

    IErlProject _xifexpression = null;
    boolean _tripleEquals = (project == null);
    if (_tripleEquals) {
      _xifexpression = null;
    } else {
      IErlModel _erlModel = ErlModelCore.getErlModel();
      String _name = project.getName();
      _xifexpression = _erlModel.getProject(_name);
    }
    return _xifexpression;
  }
View Full Code Here

TOP

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

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.