Author: vyemialyanchyk
Date: 2008-10-24 13:34:10 -0400 (Fri, 24 Oct 2008)
New Revision: 11173
Modified:
branches/jbosstools-3.0.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
Log:
menu item enable - bugfix
Modified:
branches/jbosstools-3.0.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2008-10-24
16:47:44 UTC (rev 11172)
+++
branches/jbosstools-3.0.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2008-10-24
17:34:10 UTC (rev 11173)
@@ -39,6 +39,7 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbench;
@@ -166,7 +167,7 @@
return res;
}
- private void updateSelectedItems(ISelection sel) {
+ synchronized private void updateSelectedItems(ISelection sel) {
//System.out.println("Blah! " + selection); //$NON-NLS-1$
if (sel instanceof TextSelection) {
String fullyQualifiedName = ""; //$NON-NLS-1$
@@ -315,7 +316,12 @@
}
synchronized public void setSelection(ISelection selection) {
+ if ((selection instanceof StructuredSelection) && selection.isEmpty()) {
+ // just miss this selection
+ return;
+ }
this.selection = selection;
+ //System.out.println("Blah! " + selection); //$NON-NLS-1$
}
}
Show replies by date