|
From: <caw...@us...> - 2007-09-18 13:22:18
|
Revision: 3205
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3205&view=rev
Author: cawilliams
Date: 2007-09-18 06:22:15 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
fix handling when non ruby resourcves in a source folder change. (Need to wipe cached array of resources and recompute)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java 2007-09-18 13:00:36 UTC (rev 3204)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java 2007-09-18 13:22:15 UTC (rev 3205)
@@ -795,28 +795,41 @@
private void nonRubyResourcesChanged(Openable element, IResourceDelta delta)
throws RubyModelException {
- // reset non-java resources if element was open
- if (element.isOpen()) {
- RubyElementInfo info = (RubyElementInfo) element.getElementInfo();
- switch (element.getElementType()) {
- case IRubyElement.RUBY_MODEL:
- ((RubyModelInfo) info).nonRubyResources = null;
- currentDelta().addResourceDelta(delta);
- return;
- case IRubyElement.RUBY_PROJECT:
- ((RubyProjectElementInfo) info).setNonRubyResources(null);
- break;
- }
- }
+ // reset non-ruby resources if element was open
+ if (element.isOpen()) {
+ RubyElementInfo info = (RubyElementInfo)element.getElementInfo();
+ switch (element.getElementType()) {
+ case IRubyElement.RUBY_MODEL :
+ ((RubyModelInfo) info).nonRubyResources = null;
+ currentDelta().addResourceDelta(delta);
+ return;
+ case IRubyElement.RUBY_PROJECT :
+ ((RubyProjectElementInfo) info).setNonRubyResources(null);
+
+ // if a package fragment root is the project, clear it too
+ RubyProject project = (RubyProject) element;
+ SourceFolderRoot projectRoot =
+ (SourceFolderRoot) project.getSourceFolderRoot(project.getProject());
+ if (projectRoot.isOpen()) {
+ ((SourceFolderRootInfo) projectRoot.getElementInfo()).setNonRubyResources(
+ null);
+ }
+ break;
+ case IRubyElement.SOURCE_FOLDER :
+ ((SourceFolderInfo) info).setNonRubyResources(null);
+ break;
+ case IRubyElement.SOURCE_FOLDER_ROOT :
+ ((SourceFolderRootInfo) info).setNonRubyResources(null);
+ }
+ }
- RubyElementDelta current = currentDelta();
- RubyElementDelta elementDelta = current.find(element);
- if (elementDelta == null) {
- // don't use find after creating the delta as it can be null (see
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=63434)
- elementDelta = current.changed(element, IRubyElementDelta.F_CONTENT);
- }
- elementDelta.addResourceDelta(delta);
+ RubyElementDelta current = currentDelta();
+ RubyElementDelta elementDelta = current.find(element);
+ if (elementDelta == null) {
+ // don't use find after creating the delta as it can be null (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=63434)
+ elementDelta = current.changed(element, IRubyElementDelta.F_CONTENT);
+ }
+ elementDelta.addResourceDelta(delta);
}
/*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|