Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IResourceDelta


    }

    public void resourceChanged(IResourceChangeEvent event) {
        IResource myResource = ResourceUtil.getResource(getEditorInput());

        IResourceDelta delta = event.getDelta();
        if (delta == null)
            return;
        IPath fullPath = myResource.getFullPath();
        delta = delta.findMember(fullPath);
        if (delta == null)
            return;

        // Delegate to any interested pages
        for (Object page : pages) {
            if (page instanceof IResourceChangeListener) {
                ((IResourceChangeListener) page).resourceChanged(event);
            }
        }

        // Close editor if file removed or switch to new location if file moved
        if (delta.getKind() == IResourceDelta.REMOVED) {
            if ((delta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
                IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(delta.getMovedToPath());
                final FileEditorInput newInput = new FileEditorInput(file);

                setInput(newInput);
                Display display = getEditorSite().getShell().getDisplay();
                if (display != null) {
                    SWTConcurrencyUtil.execForDisplay(display, true, new Runnable() {
                        public void run() {
                            setPartNameForInput(newInput);
                            sourcePage.setInput(newInput);
                        }
                    });
                }
            } else {
                close(false);
            }

        }
        // File content updated externally => reload all pages
        else if ((delta.getKind() & IResourceDelta.CHANGED) > 0 && (delta.getFlags() & IResourceDelta.CONTENT) > 0) {
            if (!saving.get()) {
                final IDocumentProvider docProvider = sourcePage.getDocumentProvider();
                final IDocument document = docProvider.getDocument(getEditorInput());
                SWTConcurrencyUtil.execForControl(getEditorSite().getShell(), true, new Runnable() {
                    public void run() {
View Full Code Here


     */
    public synchronized void resourceChanged(IResourceChangeEvent event) {
        if (event.getType() != IResourceChangeEvent.POST_CHANGE)
            return;

        IResourceDelta rootDelta = event.getDelta();
        try {
            final Set<Project> changed = new HashSet<Project>();
            rootDelta.accept(new IResourceDeltaVisitor() {
                @Override
                public boolean visit(IResourceDelta delta) throws CoreException {
                    try {

                        IPath location = delta.getResource().getLocation();
View Full Code Here

            @Override
            public void resourceChanged(IResourceChangeEvent event) {
                if (event.getType() != IResourceChangeEvent.POST_CHANGE)
                    return;

                IResourceDelta rootDelta = event.getDelta();
                if (isCnfChanged(rootDelta)) {
                    workspace.refresh();
                }
            }
        });
View Full Code Here

    }

    public void resourceChanged(IResourceChangeEvent event) {
        IFile file = getEditorFile();
        if (file != null) {
            IResourceDelta delta = event.getDelta();
            delta = delta.findMember(file.getFullPath());
            if (delta != null) {
                IFormPage page = (IFormPage) getManagedForm().getContainer();
                if (page.isActive())
                    refresh();
                else
View Full Code Here

    }

    public void resourceChanged(IResourceChangeEvent event) {
        IResource resource = ResourceUtil.getResource(getEditorInput());
        IResourceDelta delta = event.getDelta();
        if (delta == null)
            return;

        IPath path = resource.getFullPath();
        delta = delta.findMember(path);
        if (delta == null)
            return;

        if ((delta.getFlags() & IResourceDelta.MARKERS) != 0)
            SWTConcurrencyUtil.execForControl(getEditorSite().getShell(), true, new Runnable() {
                public void run() {
                    updateTitleIcon();
                }
            });
View Full Code Here

        refreshView();
    }

    private void handleChange(IResourceChangeEvent event) throws CoreException
    {
        IResourceDelta delta = event.getDelta();
        final IFile editorFile = ((IFileEditorInput) getEditorInput()).getFile();
        delta.accept(new IResourceDeltaVisitor()
        {
            public boolean visit(IResourceDelta delta) throws CoreException
            {
                int kind = delta.getKind();
                IResource resource = delta.getResource();
                if (resource instanceof IProject)
                {
                    int flags = delta.getFlags();
                    return handleProjectChange(editorFile, (IProject) resource, kind,
                        flags);
                }

                if (resource instanceof IFile)
View Full Code Here

        }
    }

    private void handleRefresh(IResourceChangeEvent event) throws CoreException
    {
        IResourceDelta delta = event.getDelta();
        if (delta != null)
        {
            delta.accept(new IResourceDeltaVisitor()
            {
                public boolean visit(IResourceDelta delta) throws CoreException
                {
                    IResource resource = delta.getResource();
                    if (resource instanceof IProject)
                    {
                        IProject project = (IProject) resource;
                        if (SigilCore.isSigilProject(project))
                        {
View Full Code Here

    private LinkedList<ICapabilityModelElement> capabilities = new LinkedList<ICapabilityModelElement>();

    private void handlePostChange(IResourceChangeEvent event) throws CoreException
    {
        IResourceDelta delta = event.getDelta();
        if (delta != null)
        {
            delta.accept(new IResourceDeltaVisitor()
            {
                public boolean visit(IResourceDelta delta) throws CoreException
                {
                    IResource resource = delta.getResource();
                    if (resource instanceof IProject)
                    {
                        IProject project = (IProject) resource;
                        if (SigilCore.isSigilProject(project))
                        {
                            switch (delta.getKind())
                            {
                                case IResourceDelta.REMOVED:
                                case IResourceDelta.ADDED:
                                    readCapabilities(project);
                                    break;
View Full Code Here

     * @throws CoreException
     */
    private void autoBuild(IProject project, IProgressMonitor monitor)
        throws CoreException
    {
        IResourceDelta delta = getDelta(project);
        final boolean[] changed = new boolean[1];
        ISigilProjectModel sigil = SigilCore.create(project);
        final IPath bldRoot = sigil.findBundleLocation().removeLastSegments(1);

        delta.accept(new IResourceDeltaVisitor()
        {
            public boolean visit(IResourceDelta delta) throws CoreException
            {
                if (!changed[0])
                {
                    IResource res = delta.getResource();
                    if (res.getType() == IResource.FILE)
                    {
                        changed[0] = !bldRoot.isPrefixOf(res.getLocation());
                    }
                }
View Full Code Here

  @Override
  protected IProject[] build(int kind, @SuppressWarnings("rawtypes") Map args, IProgressMonitor monitor) throws CoreException {
//    refreshJapidviews(monitor);
   
    IResourceDelta delta = getDelta(getProject());
    switch (kind) {
    case FULL_BUILD:
      System.out.println("-- full build");
      fullBuild(monitor);
      break;
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.