Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IResourceDelta


            if ( monitor != null && monitor.isCanceled() ) throw new OperationCanceledException();

            if ( kind == IncrementalProjectBuilder.FULL_BUILD ) {
                fullBuild( monitor );
            } else {
                IResourceDelta delta = getDelta( getProject() );
                if ( delta == null ) {
                    fullBuild( monitor );
                } else {
                    incrementalBuild( delta,
                                      monitor );
View Full Code Here


            if (webProject != null) {
              webProject.notifyProjectClosed();
              webProjects.remove((IProject) event.getResource());
            }
          } else if (event.getType() == IResourceChangeEvent.POST_CHANGE) {
            final IResourceDelta delta = event.getDelta();
            if (delta != null) {
              for (final PhpWebProject project : webProjects.values()) {
                final IResourceDelta settingsDelta = delta.findMember(project.getEclipseProject().getFile(SettingsPhpProjectStorage.SETTINGS_FILENAME).getFullPath());
                if (settingsDelta != null) {
                  project.notifySettingsChanged();
                }
              }
            }
View Full Code Here

            }
        }

        @Override
        public void resourceChanged(final IResourceChangeEvent event) {
            final IResourceDelta rootDelta = event.getDelta();
            final List<IResource> added = Lists.newArrayList();
            final List<IResource> changed = Lists.newArrayList();
            final List<IResource> removed = Lists.newArrayList();
            final Map<IResource, IResourceDelta> changedDelta = Maps.newHashMap();
            final IResourceDeltaVisitor visitor;
            switch (event.getType()) {
            case IResourceChangeEvent.POST_CHANGE:
                visitor = new PostChangeVisitor(removed, added, changed, changedDelta);
                break;
            case IResourceChangeEvent.PRE_CLOSE:
                visitor = new PreCloseVisitor(removed);
                final IResource resource = event.getResource();
                final boolean erlangProject = resource.getType() == IResource.PROJECT
                        && NatureUtil.hasErlangNature((IProject) resource);
                if (erlangProject) {
                    removed.add(resource);
                }
                break;
            default:
                visitor = new NoOpVisitor();
            }
            if (rootDelta != null) {
                try {
                    rootDelta.accept(visitor);
                } catch (final CoreException e) {
                    ErlLogger.warn(e);
                }
            }
            final Set<IProject> prjs = Sets.newHashSet();
View Full Code Here

        return serializer;
    }

    @Override
    public void resourceChanged(final IResourceChangeEvent event) {
        final IResourceDelta delta = event.getDelta();
        try {
            delta.accept(new IResourceDeltaVisitor() {

                @Override
                public boolean visit(final IResourceDelta aDelta) throws CoreException {
                    final IResource res = aDelta.getResource();
                    if (res.getLocation().equals(new Path(filePath))) {
View Full Code Here

    @Override
    public void resourceChanged(final IResourceChangeEvent event) {
        final HashSet<IResource> changedElements = new HashSet<IResource>();

        try {
            final IResourceDelta delta = event.getDelta();
            if (delta != null) {
                delta.accept(new ProjectErrorVisitor(changedElements));
            }
        } catch (final CoreException e) {
            ErlLogger.error(e);
        }
View Full Code Here

    if (_notEquals) {
      return;
    }
    final ErlDeltaProcessor deltaProcessor = new ErlDeltaProcessor();
    try {
      IResourceDelta _delta = event.getDelta();
      _delta.accept(deltaProcessor);
    } catch (final Throwable _t) {
      if (_t instanceof CoreException) {
        final CoreException e = (CoreException)_t;
        ErlLogger.error(e);
      } else {
View Full Code Here

        }
    }

    @Override
    public void resourceChanged(final IResourceChangeEvent event) {
        final IResourceDelta delta = event.getDelta();
        try {
            if (delta != null) {
                // ErlLogger.debug("change " + event.toString());
                delta.accept(this);
            }
        } catch (final CoreException e) {
            ErlLogger.warn(e);
        }
    }
View Full Code Here

    }

    @Override
    public void resourceChanged(final IResourceChangeEvent event) {
        // TODO keep 'paths' updated
        final IResourceDelta delta = event.getDelta();
        if (delta == null) {
            return;
        }

        try {
            final long time = System.currentTimeMillis();
            delta.accept(new IResourceDeltaVisitor() {
                @Override
                public boolean visit(final IResourceDelta theDelta) throws CoreException {
                    final IResource resource = theDelta.getResource();
                    if (!(resource instanceof IContainer)) {
                        return false;
View Full Code Here

      if (event.getType() != IResourceChangeEvent.POST_CHANGE
              || event.getResource() instanceof IWorkspaceRoot) {
        return;
      }

      final IResourceDelta rootDelta = event.getDelta();

      NlpModelDeltaImpl modelDelta = new NlpModelDeltaImpl(null, rootDelta);

      mEventDispatcher.notify(modelDelta.getKind(), modelDelta);
View Full Code Here

    /**
     * Executes the current action.
     */
    public void handle(final NlpModelDeltaImpl delta) {
      if ((delta.getResource() instanceof IProject)) {
        final IResourceDelta resourceDelta = delta.getResourceDelta();

        final IProject project = (IProject) delta.getResource();

        if ((resourceDelta.getFlags() & IResourceDelta.OPEN) != 0) {
          if (project.isOpen()) {
            // add the nlp project
            delta.setKind(Kind.ADDED);
            mEventDispatcher.notify(delta.getKind(), delta);

            // remove the old resource project
            IResourceDelta removeProjectResourceDelta = new AbstractResourceDelta() {
              @Override
              public IResource getResource() {
                return project;
              }

              @Override
              public int getKind() {
                return IResourceDelta.REMOVED;
              }

              @Override
              public IPath getFullPath() {
                return resourceDelta.getFullPath();
              }

              @Override
              public IPath getProjectRelativePath() {
                return resourceDelta.getProjectRelativePath();
              }

              @Override
              public IResourceDelta[] getAffectedChildren() {
                return new IResourceDelta[] {};
              }
            };

            NlpModelDeltaImpl removeProjectDelta = new NlpModelDeltaImpl((NlpModelDeltaImpl) delta
                    .getParent(), removeProjectResourceDelta);

            NlpModelDeltaImpl parent = (NlpModelDeltaImpl) delta.getParent();

            parent.addChild(removeProjectDelta);

            return;
          } else {
            // remove the nlp project
            delta.setKind(Kind.REMOVED);
            mEventDispatcher.notify(delta.getKind(), delta);

            // add the closed project resource
            IResourceDelta removeProjectResourceDelta = new AbstractResourceDelta() {
              @Override
              public IResource getResource() {
                return project;
              }

              @Override
              public int getKind() {
                return IResourceDelta.ADDED;
              }

              @Override
              public IPath getFullPath() {
                return resourceDelta.getFullPath();
              }

              @Override
              public IPath getProjectRelativePath() {
                return resourceDelta.getProjectRelativePath();
              }

              @Override
              public IResourceDelta[] getAffectedChildren() {
                return new IResourceDelta[] {};
              }
            };

            NlpModelDeltaImpl removeProjectDelta = new NlpModelDeltaImpl((NlpModelDeltaImpl) delta
                    .getParent(), removeProjectResourceDelta);

            NlpModelDeltaImpl parent = (NlpModelDeltaImpl) delta.getParent();

            parent.addChild(removeProjectDelta);
            return;
          }
        }
        // indicates that a nature was added to the project
        else if ((resourceDelta.getFlags() & IResourceDelta.DESCRIPTION) != 0) {
          if (project.isOpen()) {
            IResourceDelta removeProjectResourceDelta = new AbstractResourceDelta() {
              @Override
              public IResource getResource() {
                return project;
              }

View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IResourceDelta

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.