Author: dgeraskov
Date: 2010-03-18 09:42:33 -0400 (Thu, 18 Mar 2010)
New Revision: 20905
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/IRevEngGenerator.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/GeneratorDetailsPage.java
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/RevEngGeneratorAdapter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6075
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/IRevEngGenerator.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/IRevEngGenerator.java 2010-03-18
11:35:56 UTC (rev 20904)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/IRevEngGenerator.java 2010-03-18
13:42:33 UTC (rev 20905)
@@ -28,4 +28,6 @@
IRevEngParameter[] getParameters();
void setGeneratorClassName(String value);
+
+ void addParameter();
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.java 2010-03-18
11:35:56 UTC (rev 20904)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.java 2010-03-18
13:42:33 UTC (rev 20905)
@@ -34,6 +34,7 @@
public static String CounterFormPart_debug_counter_for_property_changes;
public static String CounterFormPart_zero;
public static String GeneratorDetailsPage_class;
+ public static String GeneratorDetailsPage_add_param;
public static String GeneratorDetailsPage_id_generator_details;
public static String GeneratorDetailsPage_set_the_properties_of_the_selected_generator;
public static String HibernateConfigurationForm_hibernate_configuration;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.properties
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.properties 2010-03-18
11:35:56 UTC (rev 20904)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.properties 2010-03-18
13:42:33 UTC (rev 20905)
@@ -28,6 +28,7 @@
CounterFormPart_debug_counter_for_property_changes=debug counter for property changes
CounterFormPart_zero=Zero
GeneratorDetailsPage_class=Class:
+GeneratorDetailsPage_add_param=Add parameter
GeneratorDetailsPage_id_generator_details=Id Generator details
GeneratorDetailsPage_set_the_properties_of_the_selected_generator=Set the properties of
the selected generator.
HibernateConfigurationForm_hibernate_configuration=Hibernate Configuration
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/GeneratorDetailsPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/GeneratorDetailsPage.java 2010-03-18
11:35:56 UTC (rev 20904)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/GeneratorDetailsPage.java 2010-03-18
13:42:33 UTC (rev 20905)
@@ -27,6 +27,9 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.IDetailsPage;
import org.eclipse.ui.forms.IFormPart;
@@ -53,9 +56,21 @@
generator.setGeneratorClassName(entry.getValue());
}
});
+
+ Button button = toolkit.createButton(client,
MapperMessages.GeneratorDetailsPage_add_param, SWT.NULL);
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleAddParameter();
+ }
+
+ });
}
+ protected void handleAddParameter() {
+ generator.addParameter();
+ }
+
public void selectionChanged(IFormPart part, ISelection selection) {
IRevEngGenerator newTable = (IRevEngGenerator)
((IStructuredSelection)selection).getFirstElement();
if(generator!=null) {
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 2010-03-18
11:35:56 UTC (rev 20904)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMReverseEngineeringDefinition.java 2010-03-18
13:42:33 UTC (rev 20905)
@@ -32,9 +32,9 @@
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.hibernate.dialect.FirebirdDialect;
import org.hibernate.eclipse.console.model.IRevEngColumn;
import org.hibernate.eclipse.console.model.IRevEngGenerator;
+import org.hibernate.eclipse.console.model.IRevEngParameter;
import org.hibernate.eclipse.console.model.IRevEngPrimaryKey;
import org.hibernate.eclipse.console.model.IRevEngTable;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
@@ -45,7 +45,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
public class DOMReverseEngineeringDefinition implements IReverseEngineeringDefinition {
@@ -392,5 +391,9 @@
public IRevEngGenerator createGenerator() {
return (IRevEngGenerator) factory.adapt((INodeNotifier)
getDocument().createElement("generator")); //$NON-NLS-1$
}
+
+ public IRevEngParameter createParameter() {
+ return (IRevEngParameter) factory.adapt((INodeNotifier)
getDocument().createElement("param")); //$NON-NLS-1$
+ }
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/RevEngGeneratorAdapter.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/RevEngGeneratorAdapter.java 2010-03-18
11:35:56 UTC (rev 20904)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/RevEngGeneratorAdapter.java 2010-03-18
13:42:33 UTC (rev 20905)
@@ -50,5 +50,11 @@
public void setGeneratorClassName(String value) {
setAttribute("class", value, null); //$NON-NLS-1$
}
+
+ public void addParameter() {
+ DOMAdapter key = (DOMAdapter) getModel().createParameter();
+ getNode().insertBefore(key.getNode(), getNode().getFirstChild());
+ DOMModelUtil.formatNode(getNode().getParentNode());
+ }
}