One thing that annoyed me for some months is that I'm unable to delete files
directly from  the PyDev package explorer when using Eclipse 3.4 (M7, had the
problem with M4, too).

Symptoms: After click on delete in the context menu in the PyDev package
explorer nothing happens (no window, no message, nothing). The same action the
resource navigator works as expected.

I found out that the problem is in PyDeleteResourceAction because
getStructuredSelection is empty when called by Eclipse. I was able to fix that
just by overriding getStructuredSelection but maybe you can just stop to
subclass DeleteResourceAction.

--
Felix Schwarz
Dipl.-Informatiker

Gubener Str. 38
10243 Berlin
Germany

www.schwarz.eu - software development and consulting

### Eclipse Workspace Patch 1.0
#P org.python.pydev
Index: src_navigator/org/python/pydev/navigator/actions/PyDeleteResourceAction.java
===================================================================
RCS file: /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator/actions/PyDeleteResourceAction.java,v
retrieving revision 1.2
diff -u -r1.2 PyDeleteResourceAction.java
--- src_navigator/org/python/pydev/navigator/actions/PyDeleteResourceAction.java	24 Mar 2007 11:48:29 -0000	1.2
+++ src_navigator/org/python/pydev/navigator/actions/PyDeleteResourceAction.java	12 May 2008 10:42:53 -0000
@@ -9,6 +9,7 @@
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.actions.DeleteResourceAction;
 
@@ -69,6 +70,17 @@
         return true;
     }
     
+
+	@Override
+	public IStructuredSelection getStructuredSelection() {
+		ISelection selection = provider.getSelection();
+		if (!selection.isEmpty()) {
+			IStructuredSelection sSelection = (IStructuredSelection) selection;
+			return sSelection;
+		}
+		return new StructuredSelection();
+	}
+	
     @Override
     protected List getSelectedResources() {
         return selected;


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
pydev-code mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pydev-code

Reply via email to