|
From: Christopher W. <caw...@us...> - 2006-02-22 20:04:09
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4101/src/org/rubypeople/rdt/internal/core/util Modified Files: Util.java Log Message: extend RubyModelOperation Index: Util.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Util.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Util.java 10 Feb 2006 18:33:18 -0000 1.6 --- Util.java 22 Feb 2006 20:04:04 -0000 1.7 *************** *** 14,17 **** --- 14,18 ---- import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; + import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.core.RubyConventions; import org.rubypeople.rdt.core.RubyCore; *************** *** 319,322 **** --- 320,347 ---- } + /* + * Returns whether the given ruby element is exluded from its root's classpath. + * It doesn't check whether the root itself is on the classpath or not + */ + public static final boolean isExcluded(IRubyElement element) { + int elementType = element.getElementType(); + switch (elementType) { + case IRubyElement.RUBY_MODEL: + case IRubyElement.PROJECT: + return false; + case IRubyElement.SCRIPT: + IResource resource = element.getResource(); + if (resource == null) + return false; + // if (isExcluded(resource, root.fullInclusionPatternChars(), root.fullExclusionPatternChars())) + // return true; + return isExcluded(element.getParent()); + + default: + IRubyElement cu = element.getAncestor(IRubyElement.SCRIPT); + return cu != null && isExcluded(cu); + } + } + } |