Author: max.andersen(a)jboss.com
Date: 2007-07-30 11:45:18 -0400 (Mon, 30 Jul 2007)
New Revision: 2722
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/actions/AddConfigurationAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyViewAdapter.java
Log:
Fixed JBIDE-620 so add hibernaet console config shortcut works
+ reduced some of the error logging to warning.
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 2007-07-30
15:45:04 UTC (rev 2721)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java 2007-07-30
15:45:18 UTC (rev 2722)
@@ -50,6 +50,7 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.hibernate.HibernateException;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.hibernate.console.KnownConfigurations;
@@ -273,10 +274,14 @@
* @param message the error message to log
*/
public void logErrorMessage(String message, Throwable t) {
+ logMessage(IStatus.ERROR, message, t);
+ }
+
+ public void logMessage(int lvl, String message, Throwable t) {
if(t==null) {
log(message);
} else {
- log(new MultiStatus(HibernateConsolePlugin.ID, IStatus.ERROR , new IStatus[] {
throwableToStatus(t) }, message, null) );
+ log(new MultiStatus(HibernateConsolePlugin.ID, lvl , new IStatus[] {
throwableToStatus(t) }, message, null));
}
}
@@ -560,6 +565,12 @@
return javaTextTools;
}
+
+
+ public void logWarning(HibernateException he) {
+ logMessage(IStatus.WARNING, he==null?null:he.getMessage(), he);
+ }
+
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java 2007-07-30
15:45:04 UTC (rev 2721)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java 2007-07-30
15:45:18 UTC (rev 2722)
@@ -23,17 +23,19 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jface.action.Action;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
import org.hibernate.console.ImageConstants;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.eclipse.console.wizards.ConsoleConfigurationCreationWizard;
/**
*
@@ -47,7 +49,7 @@
public AddConfigurationAction(IViewPart part) {
this.part = part;
- setText("Add Configuration");
+ setText("Add Configuration...");
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.ADD) );
}
@@ -59,16 +61,20 @@
/*ConsoleConfigurationCreationWizard wizard = new
ConsoleConfigurationCreationWizard();
wizard.init(PlatformUI.getWorkbench(), null); // initializes the wizard
WizardDialog dialog = new WizardDialog(part.getSite().getShell(), wizard);
- dialog.open(); // This opens a dialog*/
+ dialog.open(); // This opens a dialog
+ */
try {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType =
launchManager.getLaunchConfigurationType(
"org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType" );
String launchName =
launchManager.generateUniqueLaunchConfigurationNameFrom("hibernate");
- ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(
launchConfigurationType );
+ //ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(
launchConfigurationType );
ILaunchConfigurationWorkingCopy wc = launchConfigurationType.newInstance(null,
launchName);
int i = DebugUITools.openLaunchConfigurationPropertiesDialog(
part.getSite().getShell(), wc, "org.eclipse.debug.ui.launchGroup.run" );
+ if(i==Window.OK) {
+ wc.doSave();
+ }
} catch (CoreException ce) {
HibernateConsolePlugin.getDefault().showError( part.getSite().getShell(),
"Problem adding a console configuration", ce);
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java 2007-07-30
15:45:04 UTC (rev 2721)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java 2007-07-30
15:45:18 UTC (rev 2722)
@@ -28,6 +28,7 @@
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
import org.eclipse.ui.progress.IElementCollector;
@@ -102,7 +103,7 @@
}
protected void handleError(IElementCollector collector, Exception e) {
- HibernateConsolePlugin.getDefault().logErrorMessage(e.toString(), e);
+ HibernateConsolePlugin.getDefault().logMessage(IStatus.WARNING, e.toString(), e);
HibernateConsolePlugin.openError(null, "Lazy tree error", "Error while
fetching children", e, HibernateConsolePlugin.PERFORM_SYNC_EXEC);
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyViewAdapter.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyViewAdapter.java 2007-07-30
15:45:04 UTC (rev 2721)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyViewAdapter.java 2007-07-30
15:45:18 UTC (rev 2722)
@@ -98,7 +98,7 @@
target.addTargetAssociation( pava );
}
} catch(HibernateException he) {
- HibernateConsolePlugin.getDefault().log( he );
+ HibernateConsolePlugin.getDefault().logWarning( he );
}
}