Author: dgeraskov
Date: 2008-01-16 03:19:43 -0500 (Wed, 16 Jan 2008)
New Revision: 5731
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1502
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java 2008-01-15
20:25:42 UTC (rev 5730)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java 2008-01-16
08:19:43 UTC (rev 5731)
@@ -24,12 +24,14 @@
import java.util.Iterator;
import java.util.List;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.actions.SelectionListenerAction;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.utils.ProjectUtils;
/**
* @author max
@@ -47,14 +49,23 @@
public void run() {
List selectedNonResources = getSelectedNonResources();
+ String question = "Do you wish to delete the selected console
configuration";
+ String title = "Delete console configuration";
+ if (selectedNonResources.size() > 1){
+ question += "s";
+ title += "s";
+ }
+ question += "?";
- Iterator iter = selectedNonResources.iterator();
- while (iter.hasNext() ) {
- ConsoleConfiguration element = (ConsoleConfiguration) iter.next();
- KnownConfigurations.getInstance().removeConfiguration(element, false);
+ if( MessageDialog.openConfirm( null, title, question)) {
+ Iterator iter = selectedNonResources.iterator();
+ while (iter.hasNext() ) {
+ ConsoleConfiguration element = (ConsoleConfiguration) iter.next();
+ KnownConfigurations.getInstance().removeConfiguration(element, false);
+ }
+
+ part.refresh();
}
-
- part.refresh();
}
protected boolean updateSelection(IStructuredSelection selection) {