Author: dgeraskov
Date: 2008-03-13 11:28:37 -0400 (Thu, 13 Mar 2008)
New Revision: 6913
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1668
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java 2008-03-13
15:28:25 UTC (rev 6912)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java 2008-03-13
15:28:37 UTC (rev 6913)
@@ -53,7 +53,6 @@
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.hibernate.HibernateException;
import org.hibernate.SessionFactory;
@@ -424,8 +423,7 @@
}
} catch(HibernateConsoleRuntimeException hcr) {
logErrorMessage("Error while reading console configuration", hcr);
- }
-
+ }
}
@@ -451,20 +449,19 @@
"Hibernate Console", message, s);
}
- public void openCriteriaEditor(String consoleName, String criteria) {
+ public IEditorPart openCriteriaEditor(String consoleName, String criteria) {
try {
- final IWorkbenchWindow activeWorkbenchWindow =
- PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage page = activeWorkbenchWindow.getActivePage();
+ IWorkbenchPage page = getActiveWorkbenchWindow().getActivePage();
CriteriaEditorStorage storage = new CriteriaEditorStorage(consoleName,
criteria==null?"":criteria);
final CriteriaEditorInput editorInput = new CriteriaEditorInput(storage);
- page.openEditor(editorInput,
"org.hibernate.eclipse.criteriaeditor.CriteriaEditor", true);
+ return page.openEditor(editorInput,
"org.hibernate.eclipse.criteriaeditor.CriteriaEditor", true);
//page.openEditor(editorInput,
"org.eclipse.jdt.ui.CompilationUnitEditor", true);
} catch (PartInitException ex) {
logErrorMessage("Could not open Criteria editor for console:" +
consoleName, ex);
+ return null;
}
}