|
From: <caw...@us...> - 2007-03-12 15:14:19
|
Revision: 2135
http://svn.sourceforge.net/rubyeclipse/?rev=2135&view=rev
Author: cawilliams
Date: 2007-03-12 08:14:15 -0700 (Mon, 12 Mar 2007)
Log Message:
-----------
support more functionality for external ruby scripts that may be on the loadpath (so "external" meaning outside the workspace, but also part of libraries used by the project) -
this allows us to provide outlines for these extneral library scripts. (there's still a disconnect between extnerl off the loadpath and external on the loadpath).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java
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/ExternalRubyDocumentProvider.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/IRubyScriptEditorInput.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyScriptDocumentProvider.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyScriptEditorInput.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java 2007-03-12 14:34:14 UTC (rev 2134)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java 2007-03-12 15:14:15 UTC (rev 2135)
@@ -92,15 +92,14 @@
}
private char[] findSource() {
- File file = getFile();
- byte[] bytes;
+ String source = null;
try {
- bytes = Util.getFileByteContent(file);
- } catch (IOException e) {
+ source = getSource();
+ } catch (RubyModelException e) {
RubyCore.log(e);
- return new char[0];
}
- return new String(bytes).toCharArray();
+ if (source == null) return new char[0];
+ return source.toCharArray();
}
@Override
@@ -113,4 +112,17 @@
public IPath getPath() {
return getParent().getPath().append(getElementName());
}
+
+ @Override
+ public String getSource() throws RubyModelException {
+ File file = getFile();
+ byte[] bytes;
+ try {
+ bytes = Util.getFileByteContent(file);
+ } catch (IOException e) {
+ RubyCore.log(e);
+ return null;
+ }
+ return new String(bytes);
+ }
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java 2007-03-12 14:34:14 UTC (rev 2134)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java 2007-03-12 15:14:15 UTC (rev 2135)
@@ -53,6 +53,7 @@
import org.rubypeople.rdt.internal.ui.rdocexport.RDocUtility;
import org.rubypeople.rdt.internal.ui.rubyeditor.DocumentAdapter;
import org.rubypeople.rdt.internal.ui.rubyeditor.RubyDocumentProvider;
+import org.rubypeople.rdt.internal.ui.rubyeditor.RubyScriptDocumentProvider;
import org.rubypeople.rdt.internal.ui.rubyeditor.WorkingCopyManager;
import org.rubypeople.rdt.internal.ui.symbols.BlockingSymbolFinder;
import org.rubypeople.rdt.internal.ui.text.IRubyColorConstants;
@@ -93,6 +94,7 @@
private boolean new060ViewsOpened;
private ImageDescriptorRegistry fImageDescriptorRegistry;
private MembersOrderPreferenceCache fMembersOrderPreferenceCache;
+ private RubyScriptDocumentProvider fExternalRubyDocumentProvider;
public RubyPlugin() {
super();
@@ -494,4 +496,10 @@
// initialized on startup
return fMembersOrderPreferenceCache;
}
+
+ public synchronized RubyScriptDocumentProvider getExternalDocumentProvider() {
+ if (fExternalRubyDocumentProvider == null)
+ fExternalRubyDocumentProvider= new RubyScriptDocumentProvider();
+ return fExternalRubyDocumentProvider;
+ }
}
\ No newline at end of file
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-03-12 14:34:14 UTC (rev 2134)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/EditorUtility.java 2007-03-12 15:14:15 UTC (rev 2135)
@@ -143,7 +143,7 @@
return new FileEditorInput((IFile) resource);
}
if (element instanceof ExternalRubyScript)
- return new ExternalRubyFileEditorInput(((ExternalRubyScript) element).getFile());
+ return new RubyScriptEditorInput(((ExternalRubyScript) element));
element= element.getParent();
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyDocumentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyDocumentProvider.java 2007-03-12 14:34:14 UTC (rev 2134)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyDocumentProvider.java 2007-03-12 15:14:15 UTC (rev 2135)
@@ -65,8 +65,7 @@
IDocument document,
boolean overwrite)
throws CoreException {
-
-
+ // do nothing
}
protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/IRubyScriptEditorInput.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/IRubyScriptEditorInput.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/IRubyScriptEditorInput.java 2007-03-12 15:14:15 UTC (rev 2135)
@@ -0,0 +1,8 @@
+package org.rubypeople.rdt.internal.ui.rubyeditor;
+
+import org.eclipse.ui.IEditorInput;
+import org.rubypeople.rdt.core.IRubyScript;
+
+public interface IRubyScriptEditorInput extends IEditorInput {
+ public IRubyScript getRubyScript();
+}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java 2007-03-12 14:34:14 UTC (rev 2134)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java 2007-03-12 15:14:15 UTC (rev 2135)
@@ -87,7 +87,6 @@
import org.rubypeople.rdt.internal.ui.text.IRubyPartitions;
import org.rubypeople.rdt.internal.ui.text.PreferencesAdapter;
import org.rubypeople.rdt.internal.ui.text.RubyPairMatcher;
-import org.rubypeople.rdt.ui.IWorkingCopyManager;
import org.rubypeople.rdt.ui.PreferenceConstants;
import org.rubypeople.rdt.ui.RubyUI;
import org.rubypeople.rdt.ui.text.RubySourceViewerConfiguration;
@@ -341,15 +340,24 @@
* @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)
*/
protected void doSetInput(IEditorInput input) throws CoreException {
+ if (input instanceof IRubyScriptEditorInput) {
+ setDocumentProvider(RubyPlugin.getDefault().getExternalDocumentProvider());
+ } else {
+ setDocumentProvider(RubyPlugin.getDefault().getRubyDocumentProvider());
+ }
super.doSetInput(input);
setOutlinePageInput(fOutlinePage, input);
}
protected void setOutlinePageInput(RubyOutlinePage page, IEditorInput input) {
- if (page != null) {
- IWorkingCopyManager manager = RubyPlugin.getDefault().getWorkingCopyManager();
- page.setInput(manager.getWorkingCopy(input));
- }
+ if (page == null)
+ return;
+
+ IRubyElement re= getInputRubyElement();
+ if (re != null && re.exists())
+ page.setInput(re);
+ else
+ page.setInput(null);
}
protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
@@ -437,8 +445,6 @@
}
}
-
-
/**
* Returns the Ruby element wrapped by this editors input.
*
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyScriptDocumentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyScriptDocumentProvider.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyScriptDocumentProvider.java 2007-03-12 15:14:15 UTC (rev 2135)
@@ -0,0 +1,341 @@
+package org.rubypeople.rdt.internal.ui.rubyeditor;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ISynchronizable;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.editors.text.FileDocumentProvider;
+import org.rubypeople.rdt.core.ElementChangedEvent;
+import org.rubypeople.rdt.core.IElementChangedListener;
+import org.rubypeople.rdt.core.IRubyElement;
+import org.rubypeople.rdt.core.IRubyElementDelta;
+import org.rubypeople.rdt.core.IRubyProject;
+import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.ISourceFolderRoot;
+import org.rubypeople.rdt.core.RubyCore;
+import org.rubypeople.rdt.core.RubyModelException;
+import org.rubypeople.rdt.internal.ui.RubyPlugin;
+import org.rubypeople.rdt.internal.ui.text.IRubyPartitions;
+import org.rubypeople.rdt.ui.text.RubyTextTools;
+
+public class RubyScriptDocumentProvider extends FileDocumentProvider {
+ /**
+ * An input change listener to request the editor to reread the input.
+ */
+ public interface InputChangeListener {
+ void inputChanged(IRubyScriptEditorInput input);
+ }
+
+ /**
+ * Synchronizes the document with external resource changes.
+ */
+ protected class RubyScriptSynchronizer implements IElementChangedListener {
+
+ protected IRubyScriptEditorInput fInput;
+ protected ISourceFolderRoot fSourceFolderRoot;
+
+ /**
+ * Default constructor.
+ */
+ public RubyScriptSynchronizer(IRubyScriptEditorInput input) {
+
+ fInput= input;
+
+ IRubyElement parent= fInput.getRubyScript().getParent();
+ while (parent != null && !(parent instanceof ISourceFolderRoot)) {
+ parent= parent.getParent();
+ }
+ fSourceFolderRoot= (ISourceFolderRoot) parent;
+ }
+
+ /**
+ * Installs the synchronizer.
+ */
+ public void install() {
+ RubyCore.addElementChangedListener(this);
+ }
+
+ /**
+ * Uninstalls the synchronizer.
+ */
+ public void uninstall() {
+ RubyCore.removeElementChangedListener(this);
+ }
+
+ /*
+ * @see IElementChangedListener#elementChanged
+ */
+ public void elementChanged(ElementChangedEvent e) {
+ check(fSourceFolderRoot, e.getDelta());
+ }
+
+ /**
+ * Recursively check whether the class file has been deleted.
+ * Returns true if delta processing can be stopped.
+ */
+ protected boolean check(ISourceFolderRoot input, IRubyElementDelta delta) {
+ IRubyElement element= delta.getElement();
+
+ if ((delta.getKind() & IRubyElementDelta.REMOVED) != 0 || (delta.getFlags() & IRubyElementDelta.F_CLOSED) != 0) {
+ // http://dev.eclipse.org/bugs/show_bug.cgi?id=19023
+ if (element.equals(input.getRubyProject()) || element.equals(input)) {
+ handleDeleted(fInput);
+ return true;
+ }
+ }
+
+ if (((delta.getFlags() & IRubyElementDelta.F_ARCHIVE_CONTENT_CHANGED) != 0) && input.equals(element)) {
+ handleDeleted(fInput);
+ return true;
+ }
+
+ if (((delta.getFlags() & IRubyElementDelta.F_REMOVED_FROM_CLASSPATH) != 0) && input.equals(element)) {
+ handleDeleted(fInput);
+ return true;
+ }
+
+ IRubyElementDelta[] subdeltas= delta.getAffectedChildren();
+ for (int i= 0; i < subdeltas.length; i++) {
+ if (check(input, subdeltas[i]))
+ return true;
+ }
+
+ if ((delta.getFlags() & IRubyElementDelta.F_SOURCEDETACHED) != 0 ||
+ (delta.getFlags() & IRubyElementDelta.F_SOURCEATTACHED) != 0)
+ {
+ IRubyScript file= fInput != null ? fInput.getRubyScript() : null;
+ IRubyProject project= input != null ? input.getRubyProject() : null;
+
+ boolean isOnClasspath= false;
+ if (file != null && project != null)
+ isOnClasspath= project.isOnLoadpath(file);
+
+ if (isOnClasspath) {
+ fireInputChanged(fInput);
+ return false;
+ } else {
+ handleDeleted(fInput);
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+
+ /**
+ * Correcting the visibility of <code>FileSynchronizer</code>.
+ */
+ protected class _FileSynchronizer extends FileSynchronizer {
+ public _FileSynchronizer(IFileEditorInput fileEditorInput) {
+ super(fileEditorInput);
+ }
+ }
+
+ /**
+ * Bundle of all required informations.
+ */
+ protected class RubyScriptInfo extends FileInfo {
+
+ RubyScriptSynchronizer fRubyScriptSynchronizer= null;
+
+ RubyScriptInfo(IDocument document, IAnnotationModel model, _FileSynchronizer fileSynchronizer) {
+ super(document, model, fileSynchronizer);
+ }
+
+ RubyScriptInfo(IDocument document, IAnnotationModel model, RubyScriptSynchronizer classFileSynchronizer) {
+ super(document, model, null);
+ fRubyScriptSynchronizer= classFileSynchronizer;
+ }
+ }
+
+ /** Input change listeners. */
+ private List fInputListeners= new ArrayList();
+
+ /**
+ * Creates a new document provider.
+ */
+ public RubyScriptDocumentProvider() {
+ super();
+ }
+
+ /*
+ * @see StorageDocumentProvider#setDocumentContent(IDocument, IEditorInput)
+ */
+ protected boolean setDocumentContent(IDocument document, IEditorInput editorInput, String encoding) throws CoreException {
+ if (editorInput instanceof IRubyScriptEditorInput) {
+ IRubyScript rubyScript= ((IRubyScriptEditorInput) editorInput).getRubyScript();
+ document.set(rubyScript.getSource());
+ return true;
+ }
+ return super.setDocumentContent(document, editorInput, encoding);
+ }
+
+ /**
+ * Creates an annotation model derived from the given class file editor input.
+ *
+ * @param classFileEditorInput the editor input from which to query the annotations
+ * @return the created annotation model
+ * @exception CoreException if the editor input could not be accessed
+ */
+ protected IAnnotationModel createRubyScriptAnnotationModel(IRubyScriptEditorInput classFileEditorInput) throws CoreException {
+// IResource resource= null;
+// IRubyScript classFile= classFileEditorInput.getRubyScript();
+//
+// IResourceLocator locator= (IResourceLocator) classFile.getAdapter(IResourceLocator.class);
+// if (locator != null)
+// resource= locator.getContainingResource(classFile);
+//
+// if (resource != null) {
+// RubyScriptMarkerAnnotationModel model= new RubyScriptMarkerAnnotationModel(resource);
+// model.setRubyScript(classFile);
+// return model;
+// }
+//
+// return null;
+ return new ExternalFileRubyAnnotationModel();
+ }
+
+ /*
+ * @see org.eclipse.ui.editors.text.StorageDocumentProvider#createEmptyDocument()
+ * @since 3.1
+ */
+ protected IDocument createEmptyDocument() {
+ IDocument document= FileBuffers.getTextFileBufferManager().createEmptyDocument(null);
+ if (document instanceof ISynchronizable)
+ ((ISynchronizable)document).setLockObject(new Object());
+ return document;
+ }
+
+ /*
+ * @see AbstractDocumentProvider#createDocument(Object)
+ */
+ protected IDocument createDocument(Object element) throws CoreException {
+ IDocument document= super.createDocument(element);
+ if (document != null) {
+ RubyTextTools tools= RubyPlugin.getDefault().getRubyTextTools();
+ tools.setupRubyDocumentPartitioner(document, IRubyPartitions.RUBY_PARTITIONING);
+ }
+ return document;
+ }
+
+ /*
+ * @see AbstractDocumentProvider#createElementInfo(Object)
+ */
+ protected ElementInfo createElementInfo(Object element) throws CoreException {
+
+ if (element instanceof IRubyScriptEditorInput) {
+
+ IRubyScriptEditorInput input = (IRubyScriptEditorInput) element;
+// ExternalRubyScriptEditorInput external= null;
+// if (input instanceof ExternalRubyScriptEditorInput)
+// external= (ExternalRubyScriptEditorInput) input;
+//
+// if (external != null) {
+// try {
+// refreshFile(external.getFile());
+// } catch (CoreException x) {
+// handleCoreException(x, JavaEditorMessages.RubyScriptDocumentProvider_error_createElementInfo);
+// }
+// }
+
+ IDocument d= createDocument(input);
+ IAnnotationModel m= createRubyScriptAnnotationModel(input);
+
+// if (external != null) {
+// RubyScriptInfo info= new RubyScriptInfo(d, m, (_FileSynchronizer) null);
+// info.fModificationStamp= computeModificationStamp(external.getFile());
+// info.fEncoding= getPersistedEncoding(element);
+// return info;
+// } else
+ if (input instanceof RubyScriptEditorInput) {
+ RubyScriptSynchronizer s= new RubyScriptSynchronizer(input);
+ s.install();
+ RubyScriptInfo info= new RubyScriptInfo(d, m, s);
+ info.fEncoding= getPersistedEncoding(element);
+ return info;
+ }
+ }
+
+ return null;
+ }
+
+ /*
+ * @see FileDocumentProvider#disposeElementInfo(Object, ElementInfo)
+ */
+ protected void disposeElementInfo(Object element, ElementInfo info) {
+ RubyScriptInfo classFileInfo= (RubyScriptInfo) info;
+ if (classFileInfo.fRubyScriptSynchronizer != null) {
+ classFileInfo.fRubyScriptSynchronizer.uninstall();
+ classFileInfo.fRubyScriptSynchronizer= null;
+ }
+
+ super.disposeElementInfo(element, info);
+ }
+
+ /*
+ * @see AbstractDocumentProvider#doSaveDocument(IProgressMonitor, Object, IDocument)
+ */
+ protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document) throws CoreException {
+ }
+
+
+ /*
+ * @see org.eclipse.ui.texteditor.IDocumentProviderExtension3#isSynchronized(java.lang.Object)
+ * @since 3.0
+ */
+ public boolean isSynchronized(Object element) {
+ Object elementInfo= getElementInfo(element);
+ if (elementInfo instanceof RubyScriptInfo) {
+ IRubyScriptEditorInput input= (IRubyScriptEditorInput)element;
+ IResource resource;
+ try {
+ resource= input.getRubyScript().getUnderlyingResource();
+ } catch (RubyModelException e) {
+ return true;
+ }
+ return resource == null || resource.isSynchronized(IResource.DEPTH_ZERO);
+ }
+ return false;
+ }
+
+ /**
+ * Handles the deletion of the element underlying the given class file editor input.
+ * @param input the editor input
+ */
+ protected void handleDeleted(IRubyScriptEditorInput input) {
+ fireElementDeleted(input);
+ }
+
+ /**
+ * Fires input changes to input change listeners.
+ */
+ protected void fireInputChanged(IRubyScriptEditorInput input) {
+ List list= new ArrayList(fInputListeners);
+ for (Iterator i = list.iterator(); i.hasNext();)
+ ((InputChangeListener) i.next()).inputChanged(input);
+ }
+
+ /**
+ * Adds an input change listener.
+ */
+ public void addInputChangeListener(InputChangeListener listener) {
+ fInputListeners.add(listener);
+ }
+
+ /**
+ * Removes an input change listener.
+ */
+ public void removeInputChangeListener(InputChangeListener listener) {
+ fInputListeners.remove(listener);
+ }
+}
Property changes on: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyScriptDocumentProvider.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyScriptEditorInput.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyScriptEditorInput.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyScriptEditorInput.java 2007-03-12 15:14:15 UTC (rev 2135)
@@ -0,0 +1,92 @@
+package org.rubypeople.rdt.internal.ui.rubyeditor;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPersistableElement;
+import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.internal.core.ExternalRubyScript;
+import org.rubypeople.rdt.internal.ui.RubyPluginImages;
+
+public class RubyScriptEditorInput implements IRubyScriptEditorInput, IPersistableElement {
+
+ private ExternalRubyScript fScript;
+
+ public RubyScriptEditorInput(ExternalRubyScript script) {
+ this.fScript = script;
+ }
+
+ public IRubyScript getRubyScript() {
+ return fScript;
+ }
+
+ /*
+ * @see Object#equals(Object)
+ */
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!(obj instanceof RubyScriptEditorInput))
+ return false;
+ RubyScriptEditorInput other= (RubyScriptEditorInput) obj;
+ return fScript.equals(other.fScript);
+ }
+
+ /*
+ * @see Object#hashCode
+ */
+ public int hashCode() {
+ return fScript.hashCode();
+ }
+
+ /*
+ * @see IEditorInput#getPersistable()
+ */
+ public IPersistableElement getPersistable() {
+ return this;
+ }
+
+ /*
+ * @see IEditorInput#getName()
+ */
+ public String getName() {
+ return fScript.getElementName();
+ }
+
+ /*
+ * @see IEditorInput#getToolTipText()
+ */
+ public String getToolTipText() {
+ return fScript.getElementName();
+ }
+
+ /*
+ * @see IEditorInput#getImageDescriptor()
+ */
+ public ImageDescriptor getImageDescriptor() {
+ return RubyPluginImages.DESC_OBJS_SCRIPT;
+ }
+
+ /*
+ * @see IEditorInput#exists()
+ */
+ public boolean exists() {
+ return fScript.exists();
+ }
+
+ /*
+ * @see IAdaptable#getAdapter(Class)
+ */
+ public Object getAdapter(Class adapter) {
+ if (adapter == IRubyScript.class)
+ return fScript;
+ return fScript.getAdapter(adapter);
+ }
+
+ public String getFactoryId() {
+ return RubyExternalEditorFactory.FACTORY_ID;
+ }
+
+ public void saveState(IMemento memento) {
+ // TODO Auto-generated method stub
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|