|
From: <caw...@us...> - 2007-09-07 16:59:05
|
Revision: 3111
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3111&view=rev
Author: cawilliams
Date: 2007-09-07 09:59:03 -0700 (Fri, 07 Sep 2007)
Log Message:
-----------
make us able to open files inside external libraries (sort of).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/EditorUtility.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyFileEditorInput.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/EditorUtility.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/EditorUtility.java 2007-09-07 16:29:04 UTC (rev 3110)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/EditorUtility.java 2007-09-07 16:59:03 UTC (rev 3111)
@@ -34,6 +34,7 @@
import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.ISourceRange;
import org.rubypeople.rdt.core.ISourceReference;
+import org.rubypeople.rdt.core.LocalFileStorage;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.core.ExternalRubyScript;
@@ -46,7 +47,7 @@
public class EditorUtility {
/**
- * Opens a Ruby editor for an element (IJavaElement, IFile, IStorage...)
+ * Opens a Ruby editor for an element (IRubyElement, IFile, IStorage...)
* @return the IEditorPart or null if wrong element type or opening failed
*/
public static IEditorPart openInEditor(Object inputElement, boolean activate) throws RubyModelException, PartInitException {
@@ -134,6 +135,10 @@
if (input instanceof IFile)
return new FileEditorInput((IFile) input);
+
+ if (input instanceof LocalFileStorage) {
+ return new ExternalRubyFileEditorInput((LocalFileStorage)input);
+ }
return null;
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyFileEditorInput.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyFileEditorInput.java 2007-09-07 16:29:04 UTC (rev 3110)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyFileEditorInput.java 2007-09-07 16:59:03 UTC (rev 3111)
@@ -23,6 +23,10 @@
public ExternalRubyFileEditorInput(File file) {
storage = new LocalFileStorage(file);
}
+
+ public ExternalRubyFileEditorInput(LocalFileStorage file) {
+ storage = file;
+ }
public boolean exists() {
return storage.getFile().exists();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|