|
From: <caw...@us...> - 2007-02-23 16:01:29
|
Revision: 2013
http://svn.sourceforge.net/rubyeclipse/?rev=2013&view=rev
Author: cawilliams
Date: 2007-02-23 08:01:27 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
fix up the ruby browsing view
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolderInfo.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolderRoot.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolderRoot.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolderRootInfo.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryLabelProvider.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/viewsupport/RubyElementImageProvider.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.ui/icons/full/obj16/fldr_root_obj.gif
Removed Paths:
-------------
trunk/org.rubypeople.rdt.ui/icons/full/obj16/jar_lsrc_obj.gif
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-02-23 15:23:45 UTC (rev 2012)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java 2007-02-23 16:01:27 UTC (rev 2013)
@@ -8,6 +8,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.jruby.ast.Node;
import org.jruby.lexer.yacc.SyntaxException;
import org.rubypeople.rdt.core.IBuffer;
@@ -108,4 +109,9 @@
// TODO Auto-generated method stub
return null;
}
+
+ @Override
+ public IPath getPath() {
+ return getParent().getPath().append(getElementName());
+ }
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolder.java 2007-02-23 15:23:45 UTC (rev 2012)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolder.java 2007-02-23 16:01:27 UTC (rev 2013)
@@ -31,6 +31,10 @@
public boolean isReadOnly() {
return true;
}
+
+ protected Object[] storedNonRubyResources() throws RubyModelException {
+ return ((ExternalSourceFolderInfo) getElementInfo()).getNonRubyResources();
+ }
protected boolean computeChildren(OpenableElementInfo info) {
ArrayList<IRubyElement> vChildren = new ArrayList<IRubyElement>();
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolderInfo.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolderInfo.java 2007-02-23 15:23:45 UTC (rev 2012)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolderInfo.java 2007-02-23 16:01:27 UTC (rev 2013)
@@ -1,5 +1,10 @@
package org.rubypeople.rdt.internal.core;
public class ExternalSourceFolderInfo extends SourceFolderInfo {
-
+ /**
+ * Returns an array of non-ruby resources contained in the receiver.
+ */
+ Object[] getNonRubyResources() {
+ return this.nonRubyResources;
+ }
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolderRoot.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolderRoot.java 2007-02-23 15:23:45 UTC (rev 2012)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalSourceFolderRoot.java 2007-02-23 16:01:27 UTC (rev 2013)
@@ -26,6 +26,18 @@
super(null, project);
this.folderPath = resource;
}
+
+ public String getElementName() {
+ return this.folderPath.toPortableString();
+ }
+
+ /**
+ * Returns an array of non-ruby resources contained in the receiver.
+ */
+ public Object[] getNonRubyResources() throws RubyModelException {
+ // We want to show non ruby resources of the default src folder at the root (see PR #1G58NB8)
+ return ((ExternalSourceFolder) getSourceFolder(CharOperation.NO_STRINGS)).storedNonRubyResources();
+ }
@Override
protected boolean computeChildren(OpenableElementInfo info, Map newElements) throws RubyModelException {
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolderRoot.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolderRoot.java 2007-02-23 15:23:45 UTC (rev 2012)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolderRoot.java 2007-02-23 16:01:27 UTC (rev 2013)
@@ -178,6 +178,12 @@
public int getElementType() {
return IRubyElement.SOURCE_FOLDER_ROOT;
}
+
+ public String getElementName() {
+ if (this.resource instanceof IFolder)
+ return ((IFolder) this.resource).getName();
+ return ""; //$NON-NLS-1$
+ }
public ISourceFolder createSourceFolder(String names, boolean force, IProgressMonitor monitor) throws RubyModelException {
CreateSourceFolderOperation op = new CreateSourceFolderOperation(this, names, force);
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolderRootInfo.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolderRootInfo.java 2007-02-23 15:23:45 UTC (rev 2012)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolderRootInfo.java 2007-02-23 16:01:27 UTC (rev 2013)
@@ -149,24 +149,24 @@
* Returns an array of non-java resources contained in the receiver.
*/
synchronized Object[] getNonRubyResources(IRubyProject project, IResource underlyingResource, SourceFolderRoot handle) {
- Object[] nonJavaResources = this.fNonRubyResources;
- if (nonJavaResources == null) {
- nonJavaResources = this.computeNonRubyResources(project, underlyingResource, handle);
- this.fNonRubyResources = nonJavaResources;
+ Object[] nonRubyResources = this.fNonRubyResources;
+ if (nonRubyResources == null) {
+ nonRubyResources = this.computeNonRubyResources(project, underlyingResource, handle);
+ this.fNonRubyResources = nonRubyResources;
}
- return nonJavaResources;
+ return nonRubyResources;
}
- /**
- * Compute the non-package resources of this package fragment root.
+/**
+ * Compute the non-ruby resources of this source folder root.
*/
private Object[] computeNonRubyResources(IRubyProject project, IResource underlyingResource, SourceFolderRoot handle) {
- Object[] nonJavaResources = NO_NON_RUBY_RESOURCES;
+ Object[] nonRubyResources = NO_NON_RUBY_RESOURCES;
try {
// the underlying resource may be a folder or a project (in the case that the project folder
- // is actually the package fragment root)
+ // is actually the source folder root)
if (underlyingResource.getType() == IResource.FOLDER || underlyingResource.getType() == IResource.PROJECT) {
- nonJavaResources =
+ nonRubyResources =
computeFolderNonRubyResources(
(RubyProject)project,
(IContainer) underlyingResource,
@@ -176,6 +176,6 @@
} catch (RubyModelException e) {
// ignore
}
- return nonJavaResources;
+ return nonRubyResources;
}
}
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryLabelProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryLabelProvider.java 2007-02-23 15:23:45 UTC (rev 2012)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryLabelProvider.java 2007-02-23 16:01:27 UTC (rev 2013)
@@ -29,7 +29,7 @@
public Image getImage(Object element) {
if (element instanceof LibraryStandin) {
LibraryStandin library= (LibraryStandin) element;
- String key = ISharedImages.IMG_OBJS_EXTERNAL_ARCHIVE;
+ String key = ISharedImages.IMG_OBJS_LIBRARY;
IStatus status = library.validate();
if (!status.isOK()) {
ImageDescriptor base = RubyUI.getSharedImages().getImageDescriptor(key);
Added: trunk/org.rubypeople.rdt.ui/icons/full/obj16/fldr_root_obj.gif
===================================================================
(Binary files differ)
Property changes on: trunk/org.rubypeople.rdt.ui/icons/full/obj16/fldr_root_obj.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/org.rubypeople.rdt.ui/icons/full/obj16/jar_lsrc_obj.gif
===================================================================
(Binary files differ)
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java 2007-02-23 15:23:45 UTC (rev 2012)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java 2007-02-23 16:01:27 UTC (rev 2013)
@@ -38,8 +38,6 @@
public static final String IMG_MISC_PROTECTED= NAME_PREFIX + "methpro_obj.gif"; //$NON-NLS-1$
public static final String IMG_MISC_PRIVATE= NAME_PREFIX + "methpri_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJS_EXTJAR_WSRC= NAME_PREFIX + "jar_lsrc_obj.gif"; //$NON-NLS-1$
-
public static final String IMG_OBJS_ERROR = NAME_PREFIX + "error_obj.gif";
public static final String IMG_OBJS_WARNING = NAME_PREFIX + "warning_obj.gif";
public static final String IMG_OBJS_INFO = NAME_PREFIX + "info_obj.gif";
@@ -52,6 +50,7 @@
private static final String IMG_OBJS_MODULEALT= NAME_PREFIX + "modulefo_obj.gif"; //$NON-NLS-1$
private static final String IMG_OBJS_RUBY_MODEL= NAME_PREFIX + "ruby_model_obj.gif"; //$NON-NLS-1$
private static final String IMG_OBJS_SOURCE_FOLDER= NAME_PREFIX + "fldr_obj.gif"; //$NON-NLS-1$
+ private static final String IMG_OBJS_SOURCE_FOLDER_ROOT= NAME_PREFIX + "fldr_root_obj.gif"; //$NON-NLS-1$
private static final String IMG_OBJS_SCRIPT= NAME_PREFIX + "rscript_obj.gif"; //$NON-NLS-1$
private static final String IMG_OBJS_RUBY_RESOURCE= NAME_PREFIX + "rscript_resource_obj.gif"; //$NON-NLS-1$
private static final String IMG_OBJS_UNKNOWN= NAME_PREFIX + "unknown_obj.gif"; //$NON-NLS-1$
@@ -88,8 +87,7 @@
public static final ImageDescriptor DESC_OBJ_OVERRIDES= createUnManaged(T_OBJ, "over_co.gif"); //$NON-NLS-1$
public static final ImageDescriptor DESC_OBJ_IMPLEMENTS= createUnManaged(T_OBJ, "implm_co.gif"); //$NON-NLS-1$
public static final ImageDescriptor DESC_OBJS_LIBRARY= createManagedFromKey(T_OBJ, IMG_OBJS_LIBRARY);
- public static final ImageDescriptor DESC_OBJS_EXTJAR_WSRC= createManagedFromKey(T_OBJ, IMG_OBJS_EXTJAR_WSRC);
-
+
public static final ImageDescriptor DESC_OVR_STATIC= createUnManaged(T_OVR, "static_co.gif"); //$NON-NLS-1$
public static final ImageDescriptor DESC_OVR_FINAL= createUnManaged(T_OVR, "final_co.gif"); //$NON-NLS-1$
public static final ImageDescriptor DESC_OVR_ABSTRACT= createUnManaged(T_OVR, "abstract_co.gif"); //$NON-NLS-1$
@@ -113,6 +111,7 @@
public static final ImageDescriptor DESC_OBJS_RUBY_MODEL= createManagedFromKey(T_OBJ, IMG_OBJS_RUBY_MODEL);
public static final ImageDescriptor DESC_OBJS_SOURCE_FOLDER= createManagedFromKey(T_OBJ, IMG_OBJS_SOURCE_FOLDER);
+ public static final ImageDescriptor DESC_OBJS_SOURCE_FOLDER_ROOT= createManagedFromKey(T_OBJ, IMG_OBJS_SOURCE_FOLDER_ROOT);
public static final ImageDescriptor DESC_OBJS_LOCAL_VAR = createManagedFromKey(T_OBJ, IMG_CTOOLS_RUBY_LOCAL_VAR);
public static final ImageDescriptor DESC_OBJS_GLOBAL = createManagedFromKey(T_OBJ, IMG_CTOOLS_RUBY_GLOBAL);
public static final ImageDescriptor DESC_OBJS_MODULE = createManagedFromKey(T_OBJ, IMG_OBJS_MODULE);
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/viewsupport/RubyElementImageProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/viewsupport/RubyElementImageProvider.java 2007-02-23 15:23:45 UTC (rev 2012)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/viewsupport/RubyElementImageProvider.java 2007-02-23 16:01:27 UTC (rev 2013)
@@ -26,6 +26,7 @@
import org.rubypeople.rdt.core.IMethod;
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyProject;
+import org.rubypeople.rdt.core.ISourceFolderRoot;
import org.rubypeople.rdt.core.IType;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
@@ -209,6 +210,15 @@
case IRubyElement.SOURCE_FOLDER:
return RubyPluginImages.DESC_OBJS_SOURCE_FOLDER;
+
+ case IRubyElement.SOURCE_FOLDER_ROOT:
+ ISourceFolderRoot root= (ISourceFolderRoot) element;
+ if (root.isExternal()) {
+ return RubyPluginImages.DESC_OBJS_LIBRARY;
+ } else {
+ return RubyPluginImages.DESC_OBJS_SOURCE_FOLDER_ROOT;
+ }
+
case IRubyElement.RUBY_PROJECT:
IRubyProject jp = (IRubyProject) element;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java 2007-02-23 15:23:45 UTC (rev 2012)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java 2007-02-23 16:01:27 UTC (rev 2013)
@@ -11,12 +11,6 @@
*/
public static final String IMG_OBJS_LIBRARY= RubyPluginImages.IMG_OBJS_LIBRARY;
- /**
- * Key to access the shared image or image descriptor for external archives with source.
- * @since 0.9.0
- */
- public static final String IMG_OBJS_EXTERNAL_ARCHIVE= RubyPluginImages.IMG_OBJS_EXTJAR_WSRC;
-
Image getImage(String key);
ImageDescriptor getImageDescriptor(String key);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|