Author: vyemialyanchyk
Date: 2010-01-18 09:27:12 -0500 (Mon, 18 Jan 2010)
New Revision: 19791
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5674 - fixed
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2010-01-18
14:08:43 UTC (rev 19790)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2010-01-18
14:27:12 UTC (rev 19791)
@@ -13,6 +13,7 @@
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Map;
import java.util.Set;
import org.eclipse.core.internal.filebuffers.SynchronizableDocument;
@@ -33,6 +34,7 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.swt.widgets.Shell;
@@ -125,7 +127,9 @@
}
}
if (getSelectionCUSize() == 0) {
- processor.modify(new HashMap<String, EntityInfo>(), true,
createSelection2Update());
+ Map<String, EntityInfo> mapCUs_Info = new HashMap<String, EntityInfo>();
+ IStructuredSelection selection2Update = createSelection2Update();
+ processor.modify(mapCUs_Info, true, selection2Update);
return;
}
Iterator<ICompilationUnit> it = compileUnitCollector.setSelectionCUIterator();
@@ -137,7 +141,9 @@
collector.resolveRelations();
if (collector.getNonInterfaceCUNumber() > 0) {
processor.setAnnotationStylePreference(collector.getAnnotationStylePreference());
- processor.modify(collector.getMapCUs_Info(), true, createSelection2Update());
+ Map<String, EntityInfo> mapCUs_Info = collector.getMapCUs_Info();
+ IStructuredSelection selection2Update = createSelection2Update();
+ processor.modify(mapCUs_Info, true, selection2Update);
} else {
MessageDialog.openInformation(getShell(),
JdtUiMessages.JPAMapToolActor_message_title,
@@ -176,14 +182,14 @@
CompilationUnitEditor cue = (CompilationUnitEditor)editor;
ICompilationUnit cu = (ICompilationUnit)cue.getViewPartInput();
if (cu != null) {
- //IJavaProject javaProject = cu.getJavaProject();
- //collector.initCollector(javaProject);
+ addCompilationUnit(cu);
collector.initCollector();
collector.collect(cu, depth);
collector.resolveRelations();
if (collector.getNonInterfaceCUNumber() > 0) {
- //processor.modify(javaProject, collector.getMapCUs_Info(), true,
createSelection2Update());
- processor.modify(collector.getMapCUs_Info(), true, createSelection2Update());
+ Map<String, EntityInfo> mapCUs_Info = collector.getMapCUs_Info();
+ IStructuredSelection selection2Update = createSelection2Update();
+ processor.modify(mapCUs_Info, true, selection2Update);
} else {
MessageDialog.openInformation(getShell(),
JdtUiMessages.JPAMapToolActor_message_title,