|
From: <caw...@us...> - 2007-02-27 14:37:42
|
Revision: 2048
http://svn.sourceforge.net/rubyeclipse/?rev=2048&view=rev
Author: cawilliams
Date: 2007-02-27 06:37:40 -0800 (Tue, 27 Feb 2007)
Log Message:
-----------
fix some stuff around grabbing source folders for a project and grabbing script from a member
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceRefElement.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-02-27 12:21:13 UTC (rev 2047)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-02-27 14:37:40 UTC (rev 2048)
@@ -867,13 +867,33 @@
}
public ISourceFolder[] getSourceFolders() throws RubyModelException {
- Object[] children;
- int length;
- ISourceFolder[] roots;
+ ISourceFolderRoot[] roots = getSourceFolderRoots();
+ return getSourceFoldersInRoots(roots);
+ }
+
+ /**
+ * Returns all the source folders found in the specified
+ * source folder roots.
+ * @param roots ISourceFolderRoot[]
+ * @return ISourceFolder[]
+ */
+ public ISourceFolder[] getSourceFoldersInRoots(ISourceFolderRoot[] roots) {
- System.arraycopy(children = getChildren(), 0, roots = new ISourceFolder[length = children.length], 0, length);
-
- return roots;
+ ArrayList frags = new ArrayList();
+ for (int i = 0; i < roots.length; i++) {
+ ISourceFolderRoot root = roots[i];
+ try {
+ IRubyElement[] rootFragments = root.getChildren();
+ for (int j = 0; j < rootFragments.length; j++) {
+ frags.add(rootFragments[j]);
+ }
+ } catch (RubyModelException e) {
+ // do nothing
+ }
+ }
+ ISourceFolder[] fragments = new ISourceFolder[frags.size()];
+ frags.toArray(fragments);
+ return fragments;
}
/*
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java 2007-02-27 12:21:13 UTC (rev 2047)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java 2007-02-27 14:37:40 UTC (rev 2048)
@@ -158,15 +158,6 @@
return new RubyType(this, typeName);
}
- /*
- * (non-Rubydoc)
- *
- * @see org.rubypeople.rdt.core.IMember#getRubyScript()
- */
- public IRubyScript getRubyScript() {
- return ((RubyElement) getParent()).getRubyScript();
- }
-
public boolean equals(Object o) {
if (!(o instanceof RubyType)) return false;
return super.equals(o);
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceRefElement.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceRefElement.java 2007-02-27 12:21:13 UTC (rev 2047)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceRefElement.java 2007-02-27 14:37:40 UTC (rev 2048)
@@ -13,6 +13,7 @@
import org.rubypeople.rdt.core.IBuffer;
import org.rubypeople.rdt.core.IOpenable;
import org.rubypeople.rdt.core.IRubyElement;
+import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.ISourceRange;
import org.rubypeople.rdt.core.ISourceReference;
import org.rubypeople.rdt.core.RubyModelException;
@@ -40,6 +41,15 @@
super(parent);
}
+ /*
+ * (non-Rubydoc)
+ *
+ * @see org.rubypeople.rdt.core.IMember#getRubyScript()
+ */
+ public IRubyScript getRubyScript() {
+ return ((RubyElement) getParent()).getRubyScript();
+ }
+
/**
* Returns the <code>ASTNode</code> that corresponds to this <code>RubyElement</code>
* or <code>null</code> if there is no corresponding node.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|