Author: dgeraskov
Date: 2008-03-05 03:04:27 -0500 (Wed, 05 Mar 2008)
New Revision: 6685
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMReverseEngineeringDefinition.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1846
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingView.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingView.java 2008-03-05
01:09:56 UTC (rev 6684)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingView.java 2008-03-05
08:04:27 UTC (rev 6685)
@@ -23,6 +23,7 @@
import java.util.Iterator;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
@@ -202,6 +203,12 @@
rightTable
.setSelection( Math.min( sel, rightTable.getItemCount() - 1 ) );
}
+
+ protected void doRemoveAll() {
+ if(MessageDialog.openQuestion( getShell(), "Remove all mappings" , "Do
you want to remove all mappings?")) {
+ revEngDef.removeAllTypeMappings();
+ }
+ }
protected void doMoveDown() {
TableItem[] selection = rightTable.getSelection();
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMReverseEngineeringDefinition.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMReverseEngineeringDefinition.java 2008-03-05
01:09:56 UTC (rev 6684)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMReverseEngineeringDefinition.java 2008-03-05
08:04:27 UTC (rev 6685)
@@ -287,6 +287,14 @@
}
}
}
+
+ public void removeAllTypeMappings() {
+ List list = getTypeMappingsList();
+ for (java.util.Iterator it = list.iterator(); it.hasNext(); ) {
+ ITypeMapping filter = (ITypeMapping)it.next();
+ removeTypeMapping(filter);
+ }
+ }
public void removeTypeMapping(ITypeMapping item) {
if ( item instanceof TypeMappingAdapter) {