The Eclipse Foundation makes available all content in this plug-in
+("Content"). Unless otherwise indicated below, the Content is provided to you
+under the terms and conditions of the Eclipse Public License Version 1.0
+("EPL"). A copy of the EPL is available at
+http://www.eclipse.org/org/documents/epl-v10.php.
+For purposes of the EPL, "Program" will mean the Content.
+
+
If you did not receive this Content directly from the Eclipse Foundation, the
+Content is being redistributed by another party ("Redistributor") and different
+terms and conditions may apply to your use of any object code in the Content.
+Check the Redistributor's license that was provided with the Content. If no such
+license exists, contact the Redistributor. Unless otherwise indicated below, the
+terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at
+http://www.eclipse.org/.
+
+
+
diff --git a/jpa/plugins/org.eclipse.jpt.ui/build.properties b/jpa/plugins/org.eclipse.jpt.ui/build.properties
new file mode 100644
index 0000000000..83fdfc70e1
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/build.properties
@@ -0,0 +1,26 @@
+################################################################################
+# Copyright (c) 2006, 2009 Oracle. All rights reserved.
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0, which accompanies this distribution
+# and is available at http://www.eclipse.org/legal/epl-v10.html.
+#
+# Contributors:
+# Oracle - initial API and implementation
+################################################################################
+javacSource = 1.5
+javacTarget = 1.5
+source.. = src/,\
+ property_files/
+output.. = bin/
+bin.includes = .,\
+ META-INF/,\
+ about.html,\
+ icons/,\
+ plugin.xml,\
+ plugin.properties,\
+ templates/,\
+ images/
+jars.compile.order = .
+src.includes = templates/,\
+ schema/
+
diff --git a/jpa/plugins/org.eclipse.jpt.ui/component.xml b/jpa/plugins/org.eclipse.jpt.ui/component.xml
new file mode 100644
index 0000000000..228345981f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/component.xml
@@ -0,0 +1,12 @@
+
+
+
+
\ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_entity_wiz.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_entity_wiz.gif
new file mode 100644
index 0000000000..55f7cc932f
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_entity_wiz.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_jpa_file_wiz.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_jpa_file_wiz.gif
new file mode 100644
index 0000000000..610f6042d0
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_jpa_file_wiz.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_jpaproject_wiz.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_jpaproject_wiz.gif
new file mode 100644
index 0000000000..633768f35d
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_jpaproject_wiz.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/jpa_facet.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/jpa_facet.gif
new file mode 100644
index 0000000000..c0ab917511
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/jpa_facet.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_entity_wiz.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_entity_wiz.gif
new file mode 100644
index 0000000000..8533ca10fb
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_entity_wiz.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_jpa_file_wiz.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_jpa_file_wiz.gif
new file mode 100644
index 0000000000..6e0042e98c
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_jpa_file_wiz.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_jpaproject_wiz.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_jpaproject_wiz.gif
new file mode 100644
index 0000000000..12da8074ae
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_jpaproject_wiz.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_details.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_details.gif
new file mode 100644
index 0000000000..3280138b67
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_details.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_perspective.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_perspective.gif
new file mode 100644
index 0000000000..c0ab917511
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_perspective.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_structure.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_structure.gif
new file mode 100644
index 0000000000..682c90a589
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_structure.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/basic.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/basic.gif
new file mode 100644
index 0000000000..a547d743e7
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/basic.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/element-collection.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/element-collection.gif
new file mode 100644
index 0000000000..64706d215f
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/element-collection.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embeddable.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embeddable.gif
new file mode 100644
index 0000000000..8856f78874
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embeddable.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded-id.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded-id.gif
new file mode 100644
index 0000000000..c1c8e210e7
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded-id.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded.gif
new file mode 100644
index 0000000000..c2ae66497a
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity-mappings.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity-mappings.gif
new file mode 100644
index 0000000000..c349c962e2
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity-mappings.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity.gif
new file mode 100644
index 0000000000..d606f482e2
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/id.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/id.gif
new file mode 100644
index 0000000000..a205ec38ab
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/id.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-content.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-content.gif
new file mode 100644
index 0000000000..c0ab917511
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-content.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-file.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-file.gif
new file mode 100644
index 0000000000..b4e9f4724b
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-file.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-jar-file.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-jar-file.gif
new file mode 100644
index 0000000000..e92828d2d9
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-jar-file.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-many.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-many.gif
new file mode 100644
index 0000000000..48885b21fe
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-many.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-one.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-one.gif
new file mode 100644
index 0000000000..2e1e2b9387
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-one.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/mapped-superclass.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/mapped-superclass.gif
new file mode 100644
index 0000000000..8cc37645c0
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/mapped-superclass.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-attribute-mapping.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-attribute-mapping.gif
new file mode 100644
index 0000000000..70a9c23541
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-attribute-mapping.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-type-mapping.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-type-mapping.gif
new file mode 100644
index 0000000000..6279478c51
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-type-mapping.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-many.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-many.gif
new file mode 100644
index 0000000000..1e90027861
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-many.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-one.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-one.gif
new file mode 100644
index 0000000000..578ec36aa3
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-one.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence-unit.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence-unit.gif
new file mode 100644
index 0000000000..9cc45f6945
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence-unit.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence.gif
new file mode 100644
index 0000000000..d1f616d64f
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/transient.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/transient.gif
new file mode 100644
index 0000000000..cc5d83db20
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/transient.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/version.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/version.gif
new file mode 100644
index 0000000000..202a8104f4
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/version.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/warning.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/warning.gif
new file mode 100644
index 0000000000..14009e9974
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/warning.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/jpa_facet_wizban.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/jpa_facet_wizban.gif
new file mode 100644
index 0000000000..8ce181f606
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/jpa_facet_wizban.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/new_entity_wizban.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/new_entity_wizban.gif
new file mode 100644
index 0000000000..b1d934cb87
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/new_entity_wizban.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/new_jpa_file_wizban.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/new_jpa_file_wizban.gif
new file mode 100644
index 0000000000..e84622322a
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/new_jpa_file_wizban.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/add-connection.gif b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/add-connection.gif
new file mode 100644
index 0000000000..864034f74e
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/add-connection.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/add.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/add.png
new file mode 100644
index 0000000000..6bd3486b7a
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/add.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/browse-mini.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/browse-mini.png
new file mode 100644
index 0000000000..1f64f24965
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/browse-mini.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/browse.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/browse.png
new file mode 100644
index 0000000000..8081fd9293
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/browse.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/collapse-all.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/collapse-all.png
new file mode 100644
index 0000000000..3582d18d5b
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/collapse-all.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/delete.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/delete.png
new file mode 100644
index 0000000000..afba8b4463
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/delete.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/deselect-all.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/deselect-all.png
new file mode 100644
index 0000000000..49544f5703
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/deselect-all.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/dot.gif b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/dot.gif
new file mode 100644
index 0000000000..57a514d649
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/dot.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/edit.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/edit.png
new file mode 100644
index 0000000000..306d6a1c5f
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/edit.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/expand-all.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/expand-all.png
new file mode 100644
index 0000000000..db729a3990
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/expand-all.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/list-of-values.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/list-of-values.png
new file mode 100644
index 0000000000..8081fd9293
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/list-of-values.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/move-down.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/move-down.png
new file mode 100644
index 0000000000..f6e5281b70
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/move-down.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/move-up.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/move-up.png
new file mode 100644
index 0000000000..7c8b1ccf79
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/move-up.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/reconnect.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/reconnect.png
new file mode 100644
index 0000000000..df009468ab
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/reconnect.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/restore-defaults.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/restore-defaults.png
new file mode 100644
index 0000000000..2d74ae4e01
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/restore-defaults.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/select-all.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/select-all.png
new file mode 100644
index 0000000000..4eaff2beab
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/select-all.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/buttons/warningstd.png b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/warningstd.png
new file mode 100644
index 0000000000..a7b471c2d3
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/buttons/warningstd.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/diagram/export-as-img-hover.png b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/export-as-img-hover.png
new file mode 100644
index 0000000000..0751b3267c
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/export-as-img-hover.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/diagram/export-as-img.png b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/export-as-img.png
new file mode 100644
index 0000000000..5fb4dc2a2c
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/export-as-img.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/diagram/header_left_bg.png b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/header_left_bg.png
new file mode 100644
index 0000000000..abfffe4bc7
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/header_left_bg.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/diagram/header_mid_bg.png b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/header_mid_bg.png
new file mode 100644
index 0000000000..caa828d3c0
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/header_mid_bg.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/diagram/header_right_bg.png b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/header_right_bg.png
new file mode 100644
index 0000000000..bd7414470c
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/header_right_bg.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/diagram/print-hover.png b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/print-hover.png
new file mode 100644
index 0000000000..468a09b5de
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/print-hover.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/diagram/print.png b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/print.png
new file mode 100644
index 0000000000..ee15ba107e
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/print.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-bottom.png b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-bottom.png
new file mode 100644
index 0000000000..d84b339401
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-bottom.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-lower-left.png b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-lower-left.png
new file mode 100644
index 0000000000..fa25df32e8
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-lower-left.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-lower-right.png b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-lower-right.png
new file mode 100644
index 0000000000..a58c953f1a
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-lower-right.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-side.png b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-side.png
new file mode 100644
index 0000000000..585ed6a9e4
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-side.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-upper-right.png b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-upper-right.png
new file mode 100644
index 0000000000..ccabb96f5c
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/shadow-upper-right.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/diagram/toolbar_bg.png b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/toolbar_bg.png
new file mode 100644
index 0000000000..c483a49336
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/diagram/toolbar_bg.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/objects/column.gif b/jpa/plugins/org.eclipse.jpt.ui/images/objects/column.gif
new file mode 100644
index 0000000000..5f1551ba96
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/objects/column.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/objects/columnKey.gif b/jpa/plugins/org.eclipse.jpt.ui/images/objects/columnKey.gif
new file mode 100644
index 0000000000..4f385155d6
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/objects/columnKey.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/objects/file.png b/jpa/plugins/org.eclipse.jpt.ui/images/objects/file.png
new file mode 100644
index 0000000000..f5c1810a63
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/objects/file.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/objects/folder.png b/jpa/plugins/org.eclipse.jpt.ui/images/objects/folder.png
new file mode 100644
index 0000000000..9759da4e20
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/objects/folder.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/objects/forward.gif b/jpa/plugins/org.eclipse.jpt.ui/images/objects/forward.gif
new file mode 100644
index 0000000000..562bd70b5c
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/objects/forward.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/objects/moveRight.gif b/jpa/plugins/org.eclipse.jpt.ui/images/objects/moveRight.gif
new file mode 100644
index 0000000000..7a1511dd8e
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/objects/moveRight.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/objects/package.png b/jpa/plugins/org.eclipse.jpt.ui/images/objects/package.png
new file mode 100644
index 0000000000..471cc4367d
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/objects/package.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/objects/table.gif b/jpa/plugins/org.eclipse.jpt.ui/images/objects/table.gif
new file mode 100644
index 0000000000..a99388a9af
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/objects/table.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/objects/table_obj.gif b/jpa/plugins/org.eclipse.jpt.ui/images/objects/table_obj.gif
new file mode 100644
index 0000000000..e2ccabb383
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/objects/table_obj.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/overlays/error.gif b/jpa/plugins/org.eclipse.jpt.ui/images/overlays/error.gif
new file mode 100644
index 0000000000..119dcccd5a
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/overlays/error.gif differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/overlays/warning.png b/jpa/plugins/org.eclipse.jpt.ui/images/overlays/warning.png
new file mode 100644
index 0000000000..8c1e86c479
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/overlays/warning.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/images/save-image-16.png b/jpa/plugins/org.eclipse.jpt.ui/images/save-image-16.png
new file mode 100644
index 0000000000..eca4774fec
Binary files /dev/null and b/jpa/plugins/org.eclipse.jpt.ui/images/save-image-16.png differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.ui/plugin.properties
new file mode 100644
index 0000000000..3140500741
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/plugin.properties
@@ -0,0 +1,73 @@
+###############################################################################
+# Copyright (c) 2006, 2009 Oracle. All rights reserved.
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0, which accompanies this distribution
+# and is available at http://www.eclipse.org/legal/epl-v10.html.
+#
+# Contributors:
+# Oracle - initial API and implementation
+###############################################################################
+
+# ====================================================================
+# To code developer:
+# Do NOT change the properties between this line and the
+# "%%% END OF TRANSLATED PROPERTIES %%%" line.
+# Make a new property name, append to the end of the file and change
+# the code to use the new property.
+# ====================================================================
+
+# ====================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# ====================================================================
+pluginName= Dali Java Persistence Tools - UI
+providerName=Eclipse Web Tools Platform
+
+JPA_PLATFORM_UI="JPA Platform UI"
+
+jpaNavigatorContent=JPA Content
+
+jpaWizardCategoryName = JPA
+newJpaProjectWizardName = JPA Project
+newJpaProjectWizardDesc = Create a JPA project
+newJpaEntityWizardName = Entity
+newJpaEntityWizardDesc = Create a JPA Entity
+newJpaMappingFileWizardName = Mapping File
+newJpaMappingFileWizardDesc = Create a JPA Mapping File
+newJpaEntityFromTableWizardName = Entities from Tables
+newJpaEntityFromTableWizardDesc = Create JPA Entities from database tables
+
+upgradeToLatestVersion = Upgrade Document Version
+jpaStructureViewCommandCategory = JPA Structure View
+addPersistentClass = Add Class ...
+removePersistentClass = Remove Class
+addPersistentAttributeToXml = Add Attribute to XML
+addPersistentAttributeToXmlAndMap = Add Attribute to XML and Map ...
+removePersistentAttributeFromXml = Remove Attribute from XML
+mapAs=Map As
+mapAsMnemonic=M
+mapAsSpecifiedMappingParameterName=specified mapping key
+mapAsDefaultMappingParameterName=default mapping key
+
+jpaMenuName = JPA Tools
+generateEntities = Generate Entities from Tables...
+generateDDL = Generate Tables from Entities...
+convertToJPAProject = Convert to JPA Project ...
+synchronizeClasses = Synchronize Class List
+
+persistenceEditor=Persistence XML Editor
+
+jpaProblemSeveritiesPageName=Errors/Warnings
+jpaPreferencePage = Java Persistence
+
+jpaProjectPropertiesPage = Java Persistence
+
+jpaPerspective = JPA
+jpaPerspectiveDescription = This perspective is designed to support Java Persistence (JPA) development. It offers a Project Explorer, JPA Details, JPA Structure and a Data Source Explorer.
+jpaDetails = JPA Details
+jpaStructure = JPA Structure
+JpaProposalCategory = JPA Proposals
+
+JptCreationActionSet.label = Jpt Creation
+JptCreationActionSet.description = Jpt Creation Action Set
+
+NewEntityAction.label = New Entity
\ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/plugin.xml b/jpa/plugins/org.eclipse.jpt.ui/plugin.xml
new file mode 100644
index 0000000000..10c5cc7b8e
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/plugin.xml
@@ -0,0 +1,994 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ %newJpaProjectWizardDesc
+
+
+
+
+
+
+
+ %newJpaEntityWizardDesc
+
+
+
+
+
+
+
+
+ %newJpaEntityFromTableWizardDesc
+
+
+
+
+ %newJpaMappingFileWizardDesc
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ %jpaPerspectiveDescription
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties
new file mode 100644
index 0000000000..304aacf4ac
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties
@@ -0,0 +1,140 @@
+################################################################################
+# Copyright (c) 2006, 2010 Oracle. All rights reserved.
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0, which accompanies this distribution
+# and is available at http://www.eclipse.org/legal/epl-v10.html.
+#
+# Contributors:
+# Oracle - initial API and implementation
+################################################################################
+
+ChooserPane_browseButton=Browse...
+
+AccessTypeComposite_access=Access:
+AccessTypeComposite_field=Field
+AccessTypeComposite_property=Property
+
+AddPersistentAttributeDialog_title=Add Attribute
+AddPersistentAttributeDialog_attributeLabel=Attribute:
+AddPersistentAttributeDialog_mappingLabel=Map as:
+AddPersistentAttributeDialog_noMappingKeyError=You must specify a mapping type
+
+AddPersistentClassDialog_title=Add Class
+AddPersistentClassDialog_classLabel=Class:
+AddPersistentClassDialog_classDialog_title=Persistent Class Selection
+AddPersistentClassDialog_classDialog_message=Choose a class:
+AddPersistentClassDialog_mappingLabel=Map as:
+AddPersistentClassDialog_noClassError=You must specify a class
+AddPersistentClassDialog_duplicateClassWarning=File already contains that persistent class
+AddPersistentClassDialog_classNotFoundWarning=Cannot resolve class
+AddPersistentClassDialog_noMappingKeyError=You must specify a mapping type
+
+AddRemovePane_AddButtonText=Add...
+AddRemovePane_RemoveButtonText=Remove
+
+ClassChooserPane_dialogMessage=&Enter type name prefix or pattern (*, ?, or camel case):
+ClassChooserPane_dialogTitle=Class Selection
+
+DatabaseSchemaWizardPage_title=Database Schema
+DatabaseSchemaWizardPage_desc=Select a database schema
+DatabaseSchemaWizardPage_schemaSettings=Schema settings
+DatabaseSchemaWizardPage_addConnectionToProject=Add a connection to JPA project...
+DatabaseSchemaWizardPage_connectLink=Connect
+DatabaseSchemaWizardPage_schema=Schema:
+DatabaseSchemaWizardPage_connectionInfo=(Note: JPA project must have a connection and it must be active to select a schema)
+DatabaseSchemaWizardPage_schemaInfo=(Note: Must have active connection to select schema)
+
+EnumComboViewer_default=Default ()
+EnumComboViewer_defaultWithDefault=Default ({0})
+
+Error_openingEditor=Error Opening Editor
+
+General_browse=Br&owse...
+General_revert=Revert
+General_deselectAll=Deselect All
+General_selectAll=Select All
+
+GenerateDDLWizard_title=DDL Generation
+
+GenerateEntitiesWizard_generateEntities=Generate Entities
+GenerateEntitiesWizardPage_chooseEntityTable=Choose tables to generate entities from.
+GenerateEntitiesWizardPage_generateEntities=Generate Entities from Tables
+GenerateEntitiesWizardPage_synchronizeClasses=Synchronize classes in persistence.xml
+GenerateEntitiesWizardPage_tables=Tables:
+GenerateEntitiesWizardPage_tableColumn=Table
+GenerateEntitiesWizardPage_entityNameColumn=Entity Name
+
+EntitiesGenerator_jobName=Generating Entities
+
+GenericPlatformUiDialog_notSupportedMessageTitle=DDL Generation
+GenericPlatformUiDialog_notSupportedMessageText=DDL Generation is not supported by the Generic Platform.
+
+JpaContent_label=JPA Content
+
+JpaStructureView_structureNotAvailable=JPA structure is not available.
+JpaStructureView_linkWithEditorText=Link with Editor
+JpaStructureView_linkWithEditorDesc=Link with Active Editor
+JpaStructureView_linkWithEditorTooltip=Link with Editor
+JpaStructureView_numItemsSelected={0} items selected
+
+JpaDetailsView_viewNotAvailable=Details are not available for the current selection.
+
+JpaFacetWizardPage_title=JPA Facet
+JpaFacetWizardPage_description=Configure JPA settings.
+JpaFacetWizardPage_platformLabel=&Platform
+JpaFacetWizardPage_connectionLabel=&Connection
+JpaFacetWizardPage_connectionLink=Add connection ...
+JpaFacetWizardPage_connectLink=Connect
+JpaFacetWizardPage_addDriverLibraryLabel=&Add driver library to build path
+JpaFacetWizardPage_driverLibraryLabel=&Driver:
+JpaFacetWizardPage_overrideDefaultCatalogLabel=&Override default catalog from connection
+JpaFacetWizardPage_defaultCatalogLabel=Catalo&g:
+JpaFacetWizardPage_overrideDefaultSchemaLabel=O&verride default schema from connection
+JpaFacetWizardPage_defaultSchemaLabel=&Schema:
+JpaFacetWizardPage_jpaImplementationLabel=JPA implementation
+JpaFacetWizardPage_userServerLibLabel=Implementation provided by server runtime
+JpaFacetWizardPage_specifyLibLabel=Implementation library:
+JpaFacetWizardPage_jpaPrefsLink=Configure default JPA implementation library ...
+JpaFacetWizardPage_userLibsLink=Configure user libraries ...
+JpaFacetWizardPage_persistentClassManagementLabel=Persistent class management
+JpaFacetWizardPage_discoverClassesButton=Discover annotated classes a&utomatically
+JpaFacetWizardPage_listClassesButton=Annotated classes must be &listed in persistence.xml
+JpaFacetWizardPage_createOrmXmlButton=Create &mapping file (orm.xml)
+JpaFacetWizardPage_metamodelLabel=Canonical metamodel (JPA 2.0)
+JpaFacetWizardPage_metamodelSourceFolderLink=Source fol&der:
+JpaFacetWizardPage_none=
+
+JpaPreferencesPage_Description=Expand the tree to edit preferences for a specific feature.
+
+JpaProblemSeveritiesPage_Description=Select the severity level for the following optional Java Persistence validation problems:
+JpaProblemSeveritiesPage_Error=Error
+JpaProblemSeveritiesPage_Ignore=Ignore
+JpaProblemSeveritiesPage_Info=Info
+JpaProblemSeveritiesPage_Warning=Warning
+
+MappingFileWizard_title=New Mapping File
+MappingFileWizardPage_title=Mapping file
+MappingFileWizardPage_desc=Specify mapping file location and properties
+MappingFileWizardPage_projectLabel=&Project:
+MappingFileWizardPage_sourceFolderLabel=Source fol&der:
+MappingFileWizardPage_filePathLabel=File pat&h:
+MappingFileWizardPage_accessLabel=Default a&ccess:
+MappingFileWizardPage_addToPersistenceUnitButton=&Add to persistence unit
+MappingFileWizardPage_persistenceUnitLabel=Persistence &unit:
+MappingFileWizardPage_incorrectSourceFolderError=Selection must be a valid source folder
+MappingFileWizardPage_accessLabel_sourceFolderDialogTitle=Source Folder Selection
+MappingFileWizardPage_accessLabel_sourceFolderDialogDesc=Choose a source folder:
+
+NewJpaProjectWizard_title=New JPA Project
+NewJpaProjectWizard_firstPage_title=JPA Project
+NewJpaProjectWizard_firstPage_description=Configure JPA project settings.
+
+OrmItemLabelProviderFactory_entityMappingsLabel=Entity Mappings
+
+PackageChooserPane_dialogTitle=Package Selection
+PackageChooserPane_dialogMessage=Choose a folder:
+
+PersistenceItemLabelProviderFactory_persistenceLabel=Persistence
+
+OverwriteConfirmerDialog_title=Overwrite Existing Class
+OverwriteConfirmerDialog_text=Overwrite source code for the class ''{0}''?
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details.properties
new file mode 100644
index 0000000000..2313f78572
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details.properties
@@ -0,0 +1,330 @@
+################################################################################
+# Copyright (c) 2006, 2010 Oracle. All rights reserved.
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0, which accompanies this distribution
+# and is available at http://www.eclipse.org/legal/epl-v10.html.
+#
+# Contributors:
+# Oracle - initial API and implementation
+################################################################################
+
+Boolean_True=True
+Boolean_False=False
+NoneSelected=
+DefaultEmpty=Default
+DefaultWithOneParam=Default ({0})
+ProviderDefault=Default ()
+NoNameSet=
+
+MapAsComposite_changeMappingType=here
+MapAsComposite_default=Default
+MapAsComposite_dialogTitle=Mapping Type Selection
+MapAsComposite_labelText=&Enter mapping type or pattern (*, ?, or camel case):
+MapAsComposite_mappedAttributeText=Attribute ''{0}'' is mapped as {1}.
+MapAsComposite_mappedTypeText=Type ''{0}'' is mapped as {1}.
+MapAsComposite_unmappedAttributeText=Attribute ''{0}'' is not mapped, click here to change the mapping type.
+MapAsComposite_unmappedTypeText=Type ''{0}'' is not mapped, click here to change the mapping type.
+MapAsComposite_virtualAttributeText=Attribute ''{0}'' is not mapped.
+
+BasicSection_title=Basic
+EmbeddedSection_title=Embedded
+EmbeddedIdSection_title=Embedded ID
+EmbeddableSection_title=Embeddable
+EntitySection_title=Entity
+IdSection_title=ID
+ManyToManySection_title=Many to Many
+ManyToOneSection_title=Many to One
+MappedSuperclassSection_title=Mapped Superclass
+OneToManySection_title=One to Many
+OneToOneSection_title=One to One
+VersionSection_title=Version
+
+BasicMappingUiProvider_label=Basic
+EmbeddedMappingUiProvider_label=Embedded
+EmbeddedIdMappingUiProvider_label=Embedded ID
+IdMappingUiProvider_label=ID
+OneToManyMappingUiProvider_label=One to Many
+OneToOneMappingUiProvider_label=One to One
+ManyToManyMappingUiProvider_label=Many to Many
+ManyToOneMappingUiProvider_label=Many to One
+TransientMappingUiProvider_label=Transient
+VersionMappingUiProvider_label=Version
+BasicMappingUiProvider_linkLabel=basic
+EmbeddedMappingUiProvider_linkLabel=embedded
+EmbeddedIdMappingUiProvider_linkLabel=embedded ID
+IdMappingUiProvider_linkLabel=ID
+OneToManyMappingUiProvider_linkLabel=one to many
+OneToOneMappingUiProvider_linkLabel=one to one
+ManyToManyMappingUiProvider_linkLabel=many to many
+ManyToOneMappingUiProvider_linkLabel=many to one
+TransientMappingUiProvider_linkLabel=transient
+VersionMappingUiProvider_linkLabel=version
+
+DefaultBasicMappingUiProvider_label=Default (Basic)
+DefaultEmbeddedMappingUiProvider_label=Default (Embedded)
+DefaultBasicMappingUiProvider_linkLabel=default (basic)
+DefaultEmbeddedMappingUiProvider_linkLabel=default (embedded)
+
+EmbeddableUiProvider_label=Embeddable
+EntityUiProvider_label=Entity
+MappedSuperclassUiProvider_label=Mapped Superclass
+NullTypeMappingUiProvider_label=Unmapped
+
+EmbeddableUiProvider_linkLabel=embeddable
+EntityUiProvider_linkLabel=entity
+MappedSuperclassUiProvider_linkLabel=mapped superclass
+
+
+AddQueryDialog_title=Add Query
+AddQueryDialog_descriptionTitle=Create new query
+AddQueryDialog_namedQuery=Named Query
+AddQueryDialog_namedNativeQuery= Named Native Query
+AddQueryDialog_description=Create a new query setting both the 'name' and the 'type'
+QueryStateObject_nameMustBeSpecified=A name must be specified.
+QueryStateObject_typeMustBeSpecified=A query type must be specified
+AddQueryDialog_name=Name:
+AddQueryDialog_queryType=Type:
+NamedQueryComposite_nameTextLabel=Name:
+
+EntityComposite_inheritance=Inheritance
+EntityComposite_queries=Queries
+EntityComposite_tableDefault=Default ({0})
+EntityComposite_tableNoDefaultSpecified=Default ()
+
+EntityGeneralSection_name=Name:
+
+EntityNameComposite_name=Name:
+
+BasicGeneralSection_name=Name:
+BasicGeneralSection_nameDefault=Default ({0})
+BasicGeneralSection_fetchLabel=Fetch:
+BasicGeneralSection_optionalLabel=Optional
+BasicGeneralSection_optionalLabelDefault=Optional ({0})
+BasicGeneralSection_lobLabel=Lob
+BasicGeneralSection_temporalLabel=Temporal:
+BasicGeneralSection_enumeratedLabel=Enumerated:
+TypeSection_type=Type
+TypeSection_default=Default
+TypeSection_lob=Lob
+TypeSection_temporal=Temporal:
+TypeSection_enumerated=Enumerated:
+
+TableChooser_label=Name:
+CatalogChooser_label=Catalog:
+SchemaChooser_label=Schema:
+TableComposite_tableSection=Table
+
+TargetEntityChooser_label=Target entity:
+TargetEntityChooser_browse=Browse...
+TargetEntityChooser_selectTypeTitle=Select Type
+
+IdClassComposite_label=ID class:
+
+Joining_title=Joining Strategy
+Joining_mappedByLabel=Mapped by
+Joining_mappedByAttributeLabel=Attribute:
+Joining_joinColumnJoiningLabel=Join columns
+Joining_primaryKeyJoinColumnJoiningLabel=Primary key join columns
+Joining_joinTableJoiningLabel=Join table
+
+JoinTableComposite_inverseJoinColumn=Inverse join columns
+JoinTableComposite_joinColumn=Join columns
+JoinTableComposite_name=Name:
+JoinTableComposite_schema=Schema:
+JoinTableComposite_catalog=Catalog:
+JoinTableComposite_overrideDefaultJoinColumns=Override default
+JoinTableComposite_overrideDefaultInverseJoinColumns=Override default
+
+MultiRelationshipMappingComposite_general=General
+MultiRelationshipMappingComposite_joinTable=Join Table
+MultiRelationshipMappingComposite_targetEntity=Target entity:
+MultiRelationshipMappingComposite_cascadeType=Cascade type:
+MultiRelationshipMappingComposite_fetchType=Fetch type:
+MultiRelationshipMappingComposite_mappedBy=Mapped by:
+
+ColumnComposite_columnDefinition=Column definition:
+ColumnComposite_columnSection=Column
+ColumnComposite_details=Details
+ColumnComposite_insertable=Insertable
+ColumnComposite_insertableWithDefault=Insertable ({0})
+ColumnComposite_length=Length:
+ColumnComposite_name=Name:
+ColumnComposite_nullable=Nullable
+ColumnComposite_nullableWithDefault=Nullable ({0})
+ColumnComposite_precision=Precision:
+ColumnComposite_scale=Scale:
+ColumnComposite_table=Table:
+ColumnComposite_unique=Unique
+ColumnComposite_uniqueWithDefault=Unique ({0})
+ColumnComposite_updatable=Updatable
+ColumnComposite_updatableWithDefault=Updatable ({0})
+
+JoinColumnsComposite_edit=Edit...
+JoinColumnsComposite_mappingBetweenTwoParams={0} -> {1}
+JoinColumnsComposite_mappingBetweenTwoParamsDefault=Default ({0} -> {1})
+JoinColumnsComposite_mappingBetweenTwoParamsBothDefault=Default ({0}) -> Default ({1})
+JoinColumnsComposite_mappingBetweenTwoParamsFirstDefault=Default ({0}) -> {1}
+JoinColumnsComposite_mappingBetweenTwoParamsSecDefault={0} -> Default ({1})
+JoiningStrategyJoinColumnsComposite_overrideDefaultJoinColumns=Override default
+
+PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns=Override default
+PrimaryKeyJoinColumnsComposite_edit=Edit...
+PrimaryKeyJoinColumnsComposite_primaryKeyJoinColumn=Primary key join columns
+PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParams={0} -> {1}
+PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsDefault=Default ({0} -> {1})
+PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsBothDefault=Default ({0}) -> Default ({1})
+PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsFirstDefault=Default ({0}) -> {1}
+PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsSecDefault={0} -> Default ({1})
+
+JoinColumnDialog_addJoinColumnDescriptionTitle=Create New Join Column
+JoinColumnDialog_addJoinColumnTitle=Add Join Column
+JoinColumnDialog_description=Specify a mapped column for joining an entity association.
+JoinColumnDialog_editJoinColumnDescriptionTitle=Edit Join Column
+JoinColumnDialog_editJoinColumnTitle=Edit Join Column
+JoinColumnDialog_name=&Name:
+JoinColumnDialog_referencedColumnName=&Referenced column name:
+
+JoinColumnDialogPane_columnDefinition=&Column definition:
+JoinColumnDialogPane_insertable=&Insertable
+JoinColumnDialogPane_insertableWithDefault=&Insertable ({0})
+JoinColumnDialogPane_nullable=&Nullable
+JoinColumnDialogPane_nullableWithDefault=&Nullable ({0})
+JoinColumnDialogPane_table=&Table:
+JoinColumnDialogPane_unique=&Unique
+JoinColumnDialogPane_uniqueWithDefault=&Unique ({0})
+JoinColumnDialogPane_updatable=&Updatable
+JoinColumnDialogPane_updatableWithDefault=&Updatable ({0})
+
+InverseJoinColumnDialog_editInverseJoinColumnTitle=Edit Inverse Join Column
+
+PrimaryKeyJoinColumnInSecondaryTableDialog_addDescriptionTitle=Create New Primary Key Join Column
+PrimaryKeyJoinColumnInSecondaryTableDialog_addTitle=Add Primary Key Join Column
+PrimaryKeyJoinColumnInSecondaryTableDialog_editDescriptionTitle=Edit Primary Key Join Column
+PrimaryKeyJoinColumnInSecondaryTableDialog_editTitle=Edit Primary Key Join Column
+
+PrimaryKeyJoinColumnDialog_addDescriptionTitle=Create New Primary Key Join Column
+PrimaryKeyJoinColumnDialog_addTitle=Add Primary Key Join Column
+PrimaryKeyJoinColumnDialog_editDescriptionTitle=Edit Primary Key Join Column
+PrimaryKeyJoinColumnDialog_editTitle=Edit Primary Key Join Column
+
+OverridesComposite_attributeOverridesSection=Attribute Overrides
+OverridesComposite_attributeOverridesGroup=Attribute overrides
+OverridesComposite_overrideDefault=Override default
+
+OverridesComposite_association=Association Override
+OverridesComposite_attribute=Attribute Override
+OverridesComposite_noName=
+AssociationOverridesComposite_joinColumn=Join columns
+
+InheritanceComposite_detailsGroupBox=Details
+InheritanceComposite_discriminatorColumnGroupBox=Discriminator column
+InheritanceComposite_discriminatorValue=Discriminator value:
+AbstractInheritanceComposite_joined=Joined
+AbstractInheritanceComposite_single_table=Single Table
+InheritanceComposite_strategy=Strategy:
+AbstractInheritanceComposite_table_per_class=Table per Class
+
+DiscriminatorColumnComposite_discriminatorType=Type:
+DiscriminatorColumnComposite_name=Name:
+DiscriminatorColumnComposite_char=Character
+DiscriminatorColumnComposite_integer=Integer
+DiscriminatorColumnComposite_string=String
+
+GeneratorsComposite_sequenceGeneratorCheckBox=Sequence generator
+GeneratorsComposite_sequenceGeneratorSection=Sequence Generator
+GeneratorsComposite_tableGeneratorCheckBox=Table generator
+GeneratorsComposite_tableGeneratorSection=Table Generator
+
+IdMappingComposite_pk_generation=PK Generation
+IdMappingComposite_primaryKeyGenerationCheckBox=Primary key generation
+IdMappingComposite_primaryKeyGenerationSection=Primary Key Generation
+IdMappingComposite_tableGeneratorCheckBox=Table generator
+IdMappingComposite_tableGeneratorSection=Table Generator
+IdMappingComposite_sequenceGeneratorCheckBox=Sequence generator
+IdMappingComposite_sequenceGeneratorSection=Sequence Generator
+
+GeneratedValueComposite_generatedValue=Generated Value
+GeneratedValueComposite_generatorName=Generator name:
+GeneratedValueComposite_strategy=Strategy:
+GeneratedValueComposite_auto=Auto
+GeneratedValueComposite_identity=Identity
+GeneratedValueComposite_sequence=Sequence
+GeneratedValueComposite_table=Table
+
+SequenceGeneratorComposite_catalog=Catalog:
+SequenceGeneratorComposite_default=Default
+SequenceGeneratorComposite_name=Name:
+SequenceGeneratorComposite_schema=Schema:
+SequenceGeneratorComposite_sequence=Sequence:
+SequenceGeneratorComposite_sequenceGenerator=Sequence Generator
+
+TableGeneratorComposite_catalog=Catalog:
+TableGeneratorComposite_default=Default
+TableGeneratorComposite_name=Name:
+TableGeneratorComposite_pkColumn=Primary key column:
+TableGeneratorComposite_pkColumnValue=Primary key column value:
+TableGeneratorComposite_schema=Schema:
+TableGeneratorComposite_table=Table:
+TableGeneratorComposite_tableGenerator=Table Generator
+TableGeneratorComposite_valueColumn=Value column:
+
+GeneratorComposite_allocationSize=Allocation size:
+GeneratorComposite_initialValue=Initial value:
+
+OrderingComposite_orderingGroup=Ordering
+OrderingComposite_none=None
+OrderingComposite_primaryKey=Primary key
+OrderingComposite_custom=Custom
+
+SecondaryTablesComposite_secondaryTables=Secondary Tables
+SecondaryTablesComposite_edit=Edit...
+
+SecondaryTableDialog_addSecondaryTable=Add Secondary Table
+SecondaryTableDialog_editSecondaryTable=Edit Secondary Table
+SecondaryTableDialog_name=Name:
+SecondaryTableDialog_catalog=Catalog:
+SecondaryTableDialog_schema=Schema:
+SecondaryTableDialog_defaultSchema=Default ({0})
+SecondaryTableDialog_defaultCatalog=Default ({0})
+
+AccessTypeCombo_default=Default
+MetaDataCompleteCombo_Default=Default ({0})
+
+OptionalComposite_false=False
+OptionalComposite_true=True
+
+EnumTypeComposite_ordinal=Ordinal
+EnumTypeComposite_string=String
+
+FetchTypeComposite_eager=Eager
+FetchTypeComposite_lazy=Lazy
+
+TemporalTypeComposite_date=Date
+TemporalTypeComposite_time=Time
+TemporalTypeComposite_timestamp=Timestamp
+
+CascadeComposite_all=All
+CascadeComposite_cascadeTitle=Cascade
+CascadeComposite_merge=Merge
+CascadeComposite_persist=Persist
+CascadeComposite_refresh=Refresh
+CascadeComposite_remove=Remove
+
+QueriesComposite_displayString= {0}
+
+NamedNativeQueryPropertyComposite_query=Query:
+NamedNativeQueryPropertyComposite_queryHintsGroupBox=Query hints
+NamedNativeQueryPropertyComposite_resultClass=Result class:
+
+NamedQueryPropertyComposite_query=Query:
+NamedQueryPropertyComposite_queryHintsGroupBox=Query hints
+
+NewNameStateObject_nameMustBeSpecified=A name must be specified.
+NewNameStateObject_nameAlreadyExists=A query with this name already exists.
+
+QueryHintsComposite_nameColumn=Name
+QueryHintsComposite_valueColumn=Value
+
+OrmSecondaryTablesComposite_defineInXml=Define in XML
+
+NullAttributeMappingUiProvider_label=Unmapped
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details2_0.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details2_0.properties
new file mode 100644
index 0000000000..6114fe4d25
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details2_0.properties
@@ -0,0 +1,52 @@
+################################################################################
+# Copyright (c) 2009, 2010 Oracle. All rights reserved.
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0, which accompanies this distribution
+# and is available at http://www.eclipse.org/legal/epl-v10.html.
+#
+# Contributors:
+# Oracle - initial API and implementation
+################################################################################
+
+CascadePane2_0_detach=Detach
+
+CollectionTable2_0Composite_title=Collection Table
+CollectionTable2_0Composite_joinColumn=Join columns
+CollectionTable2_0Composite_name=Name:
+CollectionTable2_0Composite_schema=Schema:
+CollectionTable2_0Composite_catalog=Catalog:
+CollectionTable2_0Composite_overrideDefaultJoinColumns=Override default
+
+DerivedIdentity_title=Derived Identity
+DerivedIdentity_nullDerivedIdentity=None
+DerivedIdentity_idDerivedIdentity=Id
+DerivedIdentity_mapsIdDerivedIdentity=Maps id:
+DerivedIdentity_mapsIdUnspecifiedValue=
+
+ElementCollectionMapping2_0_label=Element Collection
+ElementCollectionMapping2_0_linkLabel=element collection
+ElementCollectionSection_title=Element Collection
+AbstractElementCollectionMapping2_0_Composite_valueSectionTitle=Value
+Entity_cacheableLabel=Cacheable
+Entity_cacheableWithDefaultLabel=Cacheable ({0})
+
+EmbeddedIdMapping2_0MappedByRelationshipPane_label=Embedded ID is mapped by a relationship.
+IdMapping2_0MappedByRelationshipPane_label=ID is mapped by a relationship.
+
+OrderingComposite_orderColumn=Order column
+
+OrphanRemoval2_0Composite_orphanRemovalLabel=Orphan removal
+OrphanRemoval2_0Composite_orphanRemovalLabelDefault=Orphan removal ({0})
+
+LockModeComposite_lockModeLabel = Lock mode:
+
+LockModeComposite_read = Read
+LockModeComposite_write = Write
+LockModeComposite_optimistic = Optimistic
+LockModeComposite_optimistic_force_increment = Optimistic Force Increment
+LockModeComposite_pessimistic_read = Pessimistic Read
+LockModeComposite_pessimistic_write = Pessimistic Write
+LockModeComposite_pessimistic_force_increment = Pessimistic Force Increment
+LockModeComposite_none = None
+
+TargetClassComposite_label=Target class:
\ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details_orm.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details_orm.properties
new file mode 100644
index 0000000000..28bb243eb8
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_details_orm.properties
@@ -0,0 +1,56 @@
+################################################################################
+# Copyright (c) 2006, 2010 Oracle. All rights reserved.
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0, which accompanies this distribution
+# and is available at http://www.eclipse.org/legal/epl-v10.html.
+#
+# Contributors:
+# Oracle - initial API and implementation
+################################################################################
+
+Boolean_False=False
+Boolean_True=True
+EntityMappingsSection_title=Entity Mappings
+EntityMappingsDetailsPage_access=Access:
+EntityMappingsDetailsPage_catalog=Catalog:
+EntityMappingsDetailsPage_field=Field
+EntityMappingsDetailsPage_package=Package:
+EntityMappingsDetailsPage_property=Property
+EntityMappingsDetailsPage_schema=Schema:
+EntityMappingsPage_catalogDefault=Default ({0}
+EntityMappingsPage_catalogNoDefaultSpecified=Default
+EntityMappingsPage_schemaDefault=Default ({0})
+EntityMappingsPage_schemaNoDefaultSpecified=Default
+MetadataCompleteComposite_metadataComplete=Metadata complete
+MetadataCompleteComposite_metadataCompleteWithDefault=Metadata complete ({0})
+OrmGeneratorsComposite_displayString= {0}
+OrmGeneratorsComposite_groupBox=Generators
+OrmMappingNameChooser_name=Name:
+OrmJavaClassChooser_javaClass=Java class:
+OrmQueriesComposite_groupBox=Queries
+PersistenceUnitMetadataComposite_access=Access:
+PersistenceUnitMetadataComposite_delimitedIdentifiersCheckBox=Delimited identifiers
+PersistenceUnitMetadataComposite_cascadePersistCheckBox=Cascade persist
+PersistenceUnitMetadataComposite_catalog=Catalog:
+PersistenceUnitMetadataComposite_field=Field
+PersistenceUnitMetadataComposite_persistenceUnitSection=Persistence Unit
+PersistenceUnitMetadataComposite_property=Property
+PersistenceUnitMetadataComposite_schema=Schema:
+PersistenceUnitMetadataComposite_xmlMappingMetadataCompleteCheckBox=XML mapping metadata complete
+PersistenceUnitMetadataSection_catalogDefault=Default ({0})
+PersistenceUnitMetadataSection_schemaDefault=Default ({0})
+
+AddGeneratorDialog_name=Name:
+AddGeneratorDialog_generatorType=Type:
+AddGeneratorDialog_title=Add Generator
+AddGeneratorDialog_descriptionTitle=Create new generator
+AddGeneratorDialog_description=Create a new generator setting both the 'name' and the 'type'
+AddGeneratorDialog_tableGenerator=Table Generator
+AddGeneratorDialog_sequenceGenerator=Sequence Generator
+GeneratorStateObject_nameMustBeSpecified=A name must be specified.
+GeneratorStateObject_typeMustBeSpecified=A generator type must be specified.
+
+
+UnsupportedOrmMappingUiProvider_label=Unsupported
+
+UnsupportedOrmMappingUiProvider_linkLabel=unsupported
\ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_entity_gen.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_entity_gen.properties
new file mode 100644
index 0000000000..b5b18ec42a
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_entity_gen.properties
@@ -0,0 +1,111 @@
+###############################################################################
+# Copyright (c) 2006, 2010 Oracle. All rights reserved.
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0, which accompanies this distribution
+# and is available at http://www.eclipse.org/legal/epl-v10.html.
+#
+# Contributors:
+# Oracle - initial API and implementation
+###############################################################################
+
+cardinality=Car&dinality:
+property=P&roperty:
+cascade=&Cascade:
+connection=&Connection:
+schema=&Schema:
+schemaInfo=(Note: You must have an active connection to select schema.)
+addConnectionLink=Add connections...
+connectLink=Connect
+connectingToDatabase=Connecting to database
+manyToOne=&Many to one
+manyToMany=Man&y to many
+oneToMany=&One to many
+oneToOne=&One to one
+manyToOneDesc=Each %s has many %s.
+oneToOneDesc=There is one %s per %s.
+manyToManyDesc=Each %s has many %s, and each %s has many %s.
+
+add=&Add
+remove=&Remove
+
+GenerateEntitiesWizard_generateEntities=Generate Custom Entities
+
+GenerateEntitiesWizard_selectJPAProject=JPA Project Selection
+GenerateEntitiesWizard_selectJPAProject_msg=Select a JPA project.
+
+GenerateEntitiesWizard_tableSelectPage_selectTable=Select Tables
+GenerateEntitiesWizard_tableSelectPage_chooseEntityTable=Select tables to generate entities from.
+GenerateEntitiesWizard_tableSelectPage_updatePersistenceXml=Update class list in persistence.xml
+GenerateEntitiesWizard_tableSelectPage_tables=&Tables:
+GenerateEntitiesWizard_tableSelectPage_tableColumn=Table
+GenerateEntitiesWizard_tableSelectPage_Restore_Defaults=Restore Defaults
+
+GenerateEntitiesWizard_assocPage_title=Table Associations
+GenerateEntitiesWizard_assocPage_label=Table &associations
+GenerateEntitiesWizard_assocPage_desc=Edit a table association by selecting it and modifying the controls in the editing panel.
+GenerateEntitiesWizard_assocPage_newAssoc=New Association
+GenerateEntitiesWizard_assocPage_delAssoc=Delete Selected Association
+
+
+GenerateEntitiesWizard_defaultTablePage_title=Customize Default Entity Generation
+GenerateEntitiesWizard_defaultTablePage_tableMapping=Table mapping
+GenerateEntitiesWizard_defaultTablePage_domainJavaClass=Domain java class
+
+GenerateEntitiesWizard_defaultTablePage_desc=Optionally customize aspects of entities that will be generated by default from database tables. A Java package should be specified.
+GenerateEntitiesWizard_defaultTablePage_access=Entity &access:
+GenerateEntitiesWizard_defaultTablePage_fetch=Associations &fetch:
+GenerateEntitiesWizard_defaultTablePage_collType=Collection properties &type:
+GenerateEntitiesWizard_defaultTablePage_genOptionalAnnotations = Always generate optional JPA annotations and DDL parameters
+GenerateEntitiesWizard_defaultTablePage_genOptionalAnnotations_desc = Generate optional JPA annotations and DDL parameters like 'unique', 'nullable', 'length', 'precision' and 'scale', which are optional and only used by automatic table creation to specify table creation data.
+GenerateEntitiesWizard_defaultTablePage_keyGen=Key &generator:
+GenerateEntitiesWizard_defaultTablePage_sequence=Sequence &name:
+GenerateEntitiesWizard_defaultTablePage_sequenceNote=You can use the patterns %s and/or %s in the sequence name.\n\
+ These patterns will be replaced by the table name and the primary key \n\
+ column name when a table mapping is generated.
+
+
+GenerateEntitiesWizard_tablesAndColumnsPage_title=Customize Individual Entities
+GenerateEntitiesWizard_tablesAndColumnsPage_desc=Customize detail of individual entities by selecting the associated tables or columns and changing values in the editing panel.
+GenerateEntitiesWizard_tablesAndColumnsPage_labelTableAndColumns=&Tables and columns
+
+GenerateEntitiesWizard_tablePanel_className=&Class name:
+GenerateEntitiesWizard_colPanel_genProp=Generate this property
+GenerateEntitiesWizard_colPanel_colMapping=Column mapping
+GenerateEntitiesWizard_colPanel_propName=Property &name:
+GenerateEntitiesWizard_colPanel_propType=Mapping t&ype:
+GenerateEntitiesWizard_colPanel_mapKind=Mapping &kind:
+GenerateEntitiesWizard_colPanel_beanProp=Domain Java Class
+GenerateEntitiesWizard_colPanel_getterScope=Getter scope:
+GenerateEntitiesWizard_colPanel_setterScope=Setter scope:
+GenerateEntitiesWizard_colPanel_colUpdateable=Column is &updatable
+GenerateEntitiesWizard_colPanel_colInsertable=Column is &insertable
+
+GenerateEntitiesWizard_newAssoc_title=Create New Association
+
+GenerateEntitiesWizard_newAssoc_tablesPage_title=Association Tables
+GenerateEntitiesWizard_newAssoc_tablesPage_desc=Specify the association tables.
+GenerateEntitiesWizard_newAssoc_tablesPage_assocKind=Association kind
+GenerateEntitiesWizard_newAssoc_tablesPage_assocTables=Association &tables:
+GenerateEntitiesWizard_newAssoc_tablesPage_table1=Table &1:
+GenerateEntitiesWizard_newAssoc_tablesPage_table2=Table &2:
+GenerateEntitiesWizard_newAssoc_tablesPage_intermediateTable=Join table:
+GenerateEntitiesWizard_newAssoc_tablesPage_simpleAssoc=&Simple association
+GenerateEntitiesWizard_newAssoc_tablesPage_m2mAssoc=&Many to many association
+
+GenerateEntitiesWizard_newAssoc_cardinalityPage_title=Association Cardinality
+GenerateEntitiesWizard_newAssoc_cardinalityPage_desc=Specify the association cardinality.
+
+GenerateEntitiesWizard_newAssoc_colsPage_title=Join Columns
+GenerateEntitiesWizard_newAssoc_colsPage_desc=Specify the join columns.
+GenerateEntitiesWizard_newAssoc_colsPage_label=Specify the join columns between the %s and %s tables:
+
+GenerateEntitiesWizard_assocEditor_entityRef=Generate a reference to %s in %s
+GenerateEntitiesWizard_assocEditor_setRef=Generate a reference to a collection of %s in %s
+GenerateEntitiesWizard_assocEditor_tableJoin=Table &join:
+GenerateEntitiesWizard_assocEditor_joinedWhen=The table rows are joined when:\n%s
+GenerateEntitiesWizard_assocEditor_genAssoc=Generate &this association
+GenerateEntitiesWizard_doNotShowWarning = Don't show me this warning again
+
+selectCascadeDlgTitle=Select Cascade
+selectTableDlgTitle=Table Selection
+selectTableDlgDesc=&Select a table:
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_entity_wizard.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_entity_wizard.properties
new file mode 100644
index 0000000000..064f3847eb
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_entity_wizard.properties
@@ -0,0 +1,57 @@
+################################################################################
+# Copyright (c) 2008, 2010 by SAP AG, Walldorf.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# SAP AG - initial API and implementation
+# Dimiter Dimitrov, d.dimitrov@sap.com - initial API and implementation
+################################################################################
+
+ENTITY_WIZARD_TITLE=New JPA Entity
+ENTITY_WIZARD_PAGE_TITLE=Entity class
+ENTITY_WIZARD_PAGE_DESCRIPTION=Create a new JPA entity. Only JPA enabled projects may be selected.
+DEFAULT_PACKAGE_WARNING=The usage of the default package is not recommended.
+ENTITY_PROPERTIES_TITLE=Entity Properties
+ENTITY_PROPERTIES_DESCRIPTION=Set entity name, table name, fields, and access type.
+ENTITY=Entit&y
+MAPPED_AS_SUPERCLASS=Mapped super&class
+INHERITANCE_GROUP=Inheritance
+INHERITANCE_CHECK_BOX=&Inheritance:
+XML_STORAGE_GROUP=XML entity mappings
+XML_SUPPORT=Add to entity mappings in &XML
+CHOOSE_XML=M&apping file:
+MAPPING_XML_TITLE=Mapping File
+XML_NAME_TITLE=XML name:
+CHOOSE_MAPPING_XML_MESSAGE=Choose mapping XML
+INVALID_XML_NAME=The mapping file does not exist
+TYPE_DIALOG_TITLE=Choose Type
+TYPE_DIALOG_DESCRIPTION=Choose the type of the entity field.
+ENTITY_NAME=Entity na&me:
+TABLE_NAME_GROUP=Table name
+TABLE_NAME=&Table name:
+USE_DEFAULT=&Use default
+ENTITY_FIELDS_GROUP=Entity field&s
+ENTITY_FIELDS_DIALOG_TITLE=Entity Fields
+KEY=Key
+NAME_COLUMN=Name
+TYPE_COLUMN=Type
+NAME_TEXT_FIELD=Na&me:
+TYPE_TEXT_FIELD=&Type:
+BROWSE_BUTTON_LABEL=B&rowse...
+ADD_BUTTON_LABEL=&Add...
+EDIT_BUTTON_LABEL=&Edit...
+REMOVE_BUTTON_LABEL=&Remove
+DUPLICATED_ENTITY_NAMES_MESSAGE=There are duplicate names on created entity fields. Please resolve the duplication.
+ACCESS_TYPE=Access type
+FIELD_BASED=Fiel&d
+PROPERTY_BASED=&Property
+NO_JPA_PROJECTS=No JPA projects in the workspace
+APPLY_CHANGES_TO_PERSISTENCE_XML=Apply changes to persistence XML
+ADD_MAPPED_SUPERCLASS_TO_XML=Add mapped superclass to XML
+ADD_ENTITY_TO_XML=Add entity to XML
+EntityDataModelProvider_typeNotInProjectClasspath=''{0}'' does not exist on the project classpath
+EntityDataModelProvider_invalidPKType=''{0}'' is not a valid simple primary key type
+EntityDataModelProvider_invalidArgument=Invalid argument ''{0}''
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_persistence.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_persistence.properties
new file mode 100644
index 0000000000..ae091e70b9
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_persistence.properties
@@ -0,0 +1,59 @@
+################################################################################
+# Copyright (c) 2006, 2009 Oracle. All rights reserved.
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0, which accompanies this distribution
+# and is available at http://www.eclipse.org/legal/epl-v10.html.
+#
+# Contributors:
+# Oracle - initial API and implementation
+################################################################################
+
+Boolean_False=False
+Boolean_True=True
+
+ArchiveFileSelectionDialog_jarPathHelpLabel=The correct path to the JAR file selected will vary on your deployment environment. You may alter it here to correctly reflect your particular environment.
+ArchiveFileSelectionDialog_jarPathLabel=JAR file path:
+
+PersistenceEditor_page_help=Help
+PersistenceEditor_sourceTab=Source
+
+PersistenceUnitClassesComposite_description=Specify the list of classes to be managed in this persistence unit.
+PersistenceUnitClassesComposite_excludeUnlistedMappedClasses=Exclude unlisted classes
+PersistenceUnitClassesComposite_excludeUnlistedMappedClassesWithDefault=Exclude unlisted classes ({0})
+PersistenceUnitClassesComposite_mappedClassesNoName=
+PersistenceUnitClassesComposite_open=Open
+
+PersistenceUnitConnectionGeneralComposite_default=Default(JTA)
+PersistenceUnitConnectionGeneralComposite_jta=JTA
+PersistenceUnitConnectionGeneralComposite_resource_local=Resource Local
+
+PersistenceUnitConnectionComposite_connection=Connection
+PersistenceUnitConnectionComposite_database=Database
+PersistenceUnitConnectionComposite_general=General
+
+PersistenceUnitConnectionDatabaseComposite_jtaDatasourceName=JTA data source name:
+PersistenceUnitConnectionDatabaseComposite_nonJtaDatasourceName=Non-JTA data source name:
+
+PersistenceUnitConnectionGeneralComposite_transactionType=Transaction type:
+
+PersistenceUnitGeneralComposite_general=General
+PersistenceUnitGeneralComposite_jarFiles=JAR Files
+PersistenceUnitGeneralComposite_jpaMappingDescriptors=XML Mapping Files
+PersistenceUnitGeneralComposite_jpaMappingDescriptors_description=Specify the XML mapping files for this persistence unit.
+PersistenceUnitGeneralComposite_mappedClasses=Managed Classes
+PersistenceUnitGeneralComposite_name=Name:
+PersistenceUnitGeneralComposite_persistenceProvider=Persistence provider:
+PersistenceUnitGeneralComposite_description=Description:
+
+PersistenceUnitJarFilesComposite_noFileName=
+PersistenceUnitMappingFilesComposite_jarFileDialog_title=JAR File Selection
+PersistenceUnitMappingFilesComposite_jarFileDialog_message=Choose a JAR file to be added to the persistence unit.
+
+PersistenceUnitMappingFilesComposite_mappingFileDialog_message=Choose the XML mapping files to be added to the persistence unit.
+PersistenceUnitMappingFilesComposite_mappingFileDialog_title=JPA XML Mapping File Selection
+PersistenceUnitMappingFilesComposite_ormNoName=
+
+PersistenceUnitPropertiesComposite_nameColumn=Name
+PersistenceUnitPropertiesComposite_properties=Properties
+PersistenceUnitPropertiesComposite_properties_description=This table lists all properties that are defined for this persistence unit.
+PersistenceUnitPropertiesComposite_valueColumn=Value
\ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_persistence2_0.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_persistence2_0.properties
new file mode 100644
index 0000000000..7603cf1293
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_persistence2_0.properties
@@ -0,0 +1,59 @@
+################################################################################
+# Copyright (c) 2009, 2010 Oracle. All rights reserved.
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0, which accompanies this distribution
+# and is available at http://www.eclipse.org/legal/epl-v10.html.
+#
+# Contributors:
+# Oracle - initial API and implementation
+################################################################################
+
+ConnectionPropertiesComposite_Database_GroupBox = Database
+
+DataSourcePropertiesComposite_jtaDataSourceLabel = JTA data source:
+DataSourcePropertiesComposite_nonJtaDataSourceLabel = Non-JTA data source:
+
+GenericPersistenceUnit2_0ConnectionComposite_sectionTitle = Persistence Unit Connection
+GenericPersistenceUnit2_0ConnectionComposite_sectionDescription = Configure the data source or JDBC connection properties.
+
+JdbcConnectionPropertiesComposite_ConnectionDialog_Message = &Enter connection name or pattern (*, ?, or camel case):
+JdbcConnectionPropertiesComposite_ConnectionDialog_Title = Connection Selection
+GenericPersistenceUnit2_0ConnectionTab_title = Connection
+
+GenericPersistenceUnit2_0OptionsComposite_miscellaneousSectionTitle = Miscellaneous Options
+GenericPersistenceUnit2_0OptionsComposite_miscellaneousSectionDescription = Configure the miscellaneous options.
+GenericPersistenceUnit2_0OptionsTab_title = Options
+
+JdbcConnectionPropertiesComposite_populateFromConnectionHyperLink = Populate from connection...
+JdbcConnectionPropertiesComposite_driverLabel = Driver:
+JdbcConnectionPropertiesComposite_urlLabel = URL:
+JdbcConnectionPropertiesComposite_userLabel = User:
+JdbcConnectionPropertiesComposite_passwordLabel = Password:
+
+JdbcPropertiesComposite_JdbcConnectionProperties_GroupBox = JDBC connection properties
+
+LockingConfigurationComposite_lockTimeoutLabel = Lock timeout:
+QueryConfigurationComposite_queryTimeoutLabel = Query timeout:
+
+TransactionTypeComposite_transactionTypeLabel = Transaction type:
+
+TransactionTypeComposite_jta = JTA
+TransactionTypeComposite_resource_local = Resource Local
+
+SharedCacheModeComposite_sharedCacheModeLabel = Shared cache mode:
+
+SharedCacheModeComposite_all = All
+SharedCacheModeComposite_none = None
+SharedCacheModeComposite_enable_selective = Enable Selective
+SharedCacheModeComposite_disable_selective = Disable Selective
+SharedCacheModeComposite_unspecified = Unspecified
+
+ValidationModeComposite_validationModeLabel = Validation mode:
+
+ValidationModeComposite_auto = Auto
+ValidationModeComposite_callback = Callback
+ValidationModeComposite_none = None
+
+ValidationConfigurationComposite_groupPrePersistLabel = Validate pre-persist group:
+ValidationConfigurationComposite_groupPreUpdateLabel = Validate pre-update group:
+ValidationConfigurationComposite_groupPreRemoveLabel = Validate pre-remove group:
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_validation_preferences.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_validation_preferences.properties
new file mode 100644
index 0000000000..93aa07eb93
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_validation_preferences.properties
@@ -0,0 +1,183 @@
+################################################################################
+# Copyright (c) 2009, 2010 Oracle. All rights reserved.
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0, which accompanies this distribution
+# and is available at http://www.eclipse.org/legal/epl-v10.html.
+#
+# Contributors:
+# Oracle - initial API and implementation
+################################################################################
+PROJECT_LEVEL_CATEGORY=Project
+
+NO_JPA_PROJECT=Project has JPA facet, but JPA project couldn't be created:
+PROJECT_NO_CONNECTION=No connection specified for project:
+PROJECT_INVALID_CONNECTION=Connection does not exist:
+PROJECT_INACTIVE_CONNECTION=Connection is not active:
+PROJECT_NO_PERSISTENCE_XML=No persistence.xml file found in project:
+PROJECT_MULTIPLE_PERSISTENCE_XML=Multiple persistence.xml files in project:
+
+XML_VERSION_NOT_LATEST=XML document version not most recent:
+
+PERSISTENCE_NO_PERSISTENCE_UNIT=No persistence unit defined:
+PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS=Multiple persistence units defined:
+PERSISTENCE_XML_INVALID_CONTENT=Invalid content (no root node):
+
+PERSISTENCE_UNIT_LEVEL_CATEGORY=Persistence unit
+
+PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE=Unspecified mapping file:
+PERSISTENCE_UNIT_UNSUPPORTED_MAPPING_FILE_CONTENT=Mapping file does not have supported content:
+PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE=Mapping file cannot be resolved:
+PERSISTENCE_UNIT_INVALID_MAPPING_FILE=Mapping file does not have ORM content:
+PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE=Duplicate mapping file:
+PERSISTENCE_UNIT_UNSPECIFIED_CLASS=Unspecified class:
+PERSISTENCE_UNIT_NONEXISTENT_CLASS=Class cannot be resolved:
+PERSISTENCE_UNIT_INVALID_CLASS=Class is included in a persistence unit but is not mapped:
+PERSISTENCE_UNIT_DUPLICATE_CLASS=Duplicate class:
+PERSISTENCE_UNIT_REDUNDANT_CLASS=Class is already specified in mapping file:
+PERSISTENCE_UNIT_DUPLICATE_JAR_FILE=Duplicate JAR file:
+PERSISTENCE_UNIT_UNSPECIFIED_JAR_FILE=Unspecified JAR file:
+PERSISTENCE_UNIT_JAR_FILE_DEPLOYMENT_PATH_WARNING=The path to the JAR file will vary:
+PERSISTENCE_UNIT_NONEXISTENT_JAR_FILE=JAR file cannot be resolved:
+MAPPING_FILE_EXTRANEOUS_PERSISTENCE_UNIT_DEFAULTS=Extraneous persistence unit defaults found:
+PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT=Class is mapped, but is not in a persistence unit:
+PERSISTENT_TYPE_ANNOTATED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT=Class is annotated, but is not in a persistence unit:
+
+TYPE_LEVEL_CATEGORY=Type
+
+PERSISTENT_TYPE_UNSPECIFIED_CLASS=Class is unspecified in orm.xml:
+PERSISTENT_TYPE_UNRESOLVED_CLASS=Class in orm.xml cannot be resolved to a java class:
+ENTITY_NO_PK=Entity has no primary key:
+ENTITY_SINGLE_TABLE_DESCENDANT_DEFINES_TABLE=No table should be defined for non-root entity using single-table inheritance:
+ENTITY_ABSTRACT_TABLE_PER_CLASS_DEFINES_TABLE=No table should be defined for abstract entity using table-per-concrete-class inheritance:
+ENTITY_ABSTRACT_DISCRIMINATOR_VALUE_DEFINED = No discriminator value should be defined for abstract entity:
+ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_VALUE_DEFINED = No discriminator value should be defined for entity using table-per-concrete-class inheritance:
+ENTITY_NON_ROOT_DISCRIMINATOR_COLUMN_DEFINED =No discriminator column should be defined for non-root entity:
+ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_COLUMN_DEFINED = No discriminator column should be defined for entity using table-per-concrete-class inheritance:
+
+ATTRIBUTE_LEVEL_CATEGORY=Attribute
+
+PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME=Attribute in orm.xml has unspecified name:
+PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME=Attribute in orm.xml cannot be resolved in the java class:
+PERSISTENT_ATTRIBUTE_INHERITED_ATTRIBUTES_NOT_SUPPORTED=In orm.xml referenced inherited attribute may not be supported:
+PERSISTENT_ATTRIBUTE_INVALID_MAPPING=Attribute has invalid mapping type:
+PERSISTENT_ATTRIBUTE_FINAL_FIELD=The java field for attribute is final:
+PERSISTENT_ATTRIBUTE_PUBLIC_FIELD=The java field for attribute is public:
+MAPPING_UNRESOLVED_MAPPED_BY=Cannot resolve attribute name:
+MAPPING_INVALID_MAPPED_BY=Attribute has invalid mapping for this relationship:
+MAPPING_MAPPED_BY_WITH_JOIN_TABLE=Cannot specify join table if attribute is mapped by another attribute:
+MAPPING_MAPPED_BY_ON_BOTH_SIDES=Relationship must have an owner:
+TARGET_ENTITY_NOT_DEFINED=Target entity is not defined:
+TARGET_ENTITY_IS_NOT_AN_ENTITY=Target entity is not an Entity:
+MAPS_ID_VALUE_NOT_SPECIFIED="Maps ID" attribute value not specified:
+MAPS_ID_VALUE_NOT_RESOLVED="Maps ID" attribute value not resolved:
+MAPS_ID_VALUE_INVALID="Maps ID" attribute value invalid:
+ORDER_COLUMN_AND_ORDER_BY_BOTH_SPECIFIED=OrderColumn and OrderBy annotations are both specified:
+ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED=Element collection target class not defined:
+ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE=Element collection target class is not embeddable or basic type:
+ELEMENT_COLLECTION_MAP_KEY_CLASS_NOT_DEFINED=Element collection map key class not defined:
+
+DATABASE_CATEGORY=Database
+TABLE_CATEGORY=Table
+
+TABLE_UNRESOLVED_CATALOG=Catalog cannot be resolved for table:
+TABLE_UNRESOLVED_SCHEMA=Schema cannot be resolved for table:
+TABLE_UNRESOLVED_NAME=Table cannot be resolved:
+SECONDARY_TABLE_UNRESOLVED_CATALOG=Catalog cannot be resolved for secondary table:
+SECONDARY_TABLE_UNRESOLVED_SCHEMA=Schema cannot be resolved for secondary table:
+SECONDARY_TABLE_UNRESOLVED_NAME=Secondary table cannot be resolved:
+JOIN_TABLE_UNRESOLVED_CATALOG=Catalog cannot be resolved for join table:
+JOIN_TABLE_UNRESOLVED_SCHEMA=Schema cannot be resolved for join table:
+JOIN_TABLE_UNRESOLVED_NAME=Join table cannot be resolved:
+VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=Implied secondary table primary key join column cannot be resolved:
+VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Implied secondary table primary key join column referenced column name cannot be resolved:
+VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Implied secondary table primary key join column name must be specified when there are multiples:
+VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Implied secondary table primary key join column referenced column name must be specified when there are multiples:
+COLLECTION_TABLE_UNRESOLVED_CATALOG=Catalog cannot be resolved for collection table:
+COLLECTION_TABLE_UNRESOLVED_SCHEMA=Schema cannot be resolved for collection table:
+COLLECTION_TABLE_UNRESOLVED_NAME=Collection table cannot be resolved:
+
+COLUMN_CATEGORY=Column
+
+COLUMN_UNRESOLVED_TABLE=Table for column cannot be resolved:
+COLUMN_UNRESOLVED_NAME=Column cannot be resolved:
+COLUMN_TABLE_NOT_VALID=Table for column not valid given the context:
+JOIN_COLUMN_TABLE_NOT_VALID=Table for join column is not valid:
+JOIN_COLUMN_UNRESOLVED_NAME=Join column cannot be resolved:
+JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Join column name must be specified when there are multiples:
+JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced column in join column cannot be resolved:
+JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Join column referenced column name must be specified when there are multiples:
+INVERSE_JOIN_COLUMN_TABLE_NOT_VALID=Table for inverse join column is not valid:
+INVERSE_JOIN_COLUMN_UNRESOLVED_NAME=Inverse join column cannot be resolved:
+INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Inverse join column name must be specified when there are multiples:
+INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced column in inverse join column cannot be resolved:
+INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Inverse join column referenced column name must be specified when there are multiples:
+PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=Primary key join column cannot be resolved:
+PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced column in primary key join column cannot be resolved:
+PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Primary key join column name must be specified when there are multiples:
+PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Primary key join column referenced column name must be specified when there are multiples:
+MAP_KEY_COLUMN_TABLE_NOT_VALID=Table for map key column is not valid:
+ORDER_COLUMN_UNRESOLVED_NAME=Order column cannot be resolved:
+VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=Implied primary key join column cannot be resolved:
+VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Implied primary key join column referenced column name cannot be resolved:
+
+OVERRIDES_CATEGORY=Attribute/association overrides
+IMPLIED_ATTRIBUTE_LEVEL_CATEGORY=Implied attributes
+
+VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=Implied map key attribute override table for column is not valid:
+VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=Implied attribute override column cannot be resolved:
+VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=Implied attribute override table for column not valid:
+VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID=Implied association override table for join column is not valid:
+VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME=Implied association override join column cannot be resolved:
+VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Implied association override referenced column in join column cannot be resolved:
+VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Implied association override join column name must be specified when there are multiples:
+VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Implied association override join column referenced column name must be specified when there are multiples:
+
+VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_CATALOG=Catalog cannot be resolved for join table:
+VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA=Schema cannot be resolved for join table:
+VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME=Join table cannot be resolved:
+VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=Attribute override table for column not valid:
+VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID=Table for column not valid:
+VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=Attribute override column cannot be resolved:
+VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME=Column cannot be resolved:
+VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE=Table for join column cannot be resolved:
+VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME=Join column cannot be resolved:
+VIRTUAL_ATTRIBUTE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Join column name must be specified when there are multiples:
+VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced column in join column cannot be resolved:
+VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Join column referenced column name must be specified when there are multiples:
+VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY=Target entity is not an Entity:
+VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED=Target entity is not defined:
+VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_CATALOG=Catalog cannot be resolved for collection table:
+VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_SCHEMA=Schema cannot be resolved for collection table:
+VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_NAME=Collection table cannot be resolved:
+VIRTUAL_ATTRIBUTE_ORDER_COLUMN_UNRESOLVED_NAME=Order column cannot be resolved:
+VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED=Element collection target class not defined:
+VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE=Element collection target class is not embeddable or basic type:
+VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_MAP_KEY_CLASS_NOT_DEFINED=Element collection map key class not defined:
+VIRTUAL_ATTRIBUTE_JOIN_COLUMN_TABLE_NOT_VALID=Table for join column is not valid:
+VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID=Table for inverse join column is not valid:
+VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME=Inverse join column cannot be resolved:
+VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Inverse join column name must be specified when there are multiples:
+VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced column in inverse join column cannot be resolved:
+VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Inverse join column referenced column name must be specified when there are multiples:
+VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID=Table for map key column is not valid:
+VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=Map key attribute override table for column not valid:
+
+
+VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID=Association override table for join column is not valid:
+VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME=Association override join column cannot be resolved:
+VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=Association override join column referenced column name cannot be resolved:
+VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Association override join column name must be specified when there are multiples:
+VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Association override join column referenced column name must be specified when there are multiples:
+
+INHERITANCE_CATEGORY=Inheritance
+
+DISCRIMINATOR_COLUMN_UNRESOLVED_NAME=Discriminator column cannot be resolved:
+ENTITY_TABLE_PER_CLASS_NOT_SUPPORTED_ON_PLATFORM=Entity cannot use table-per-concrete-class inheritance:
+ENTITY_TABLE_PER_CLASS_NOT_PORTABLE_ON_PLATFORM=Entity uses table-per-concrete-class inheritance which is not portable:
+
+QUERIES_GENERATORS_CATEGORY=Queries and generators
+
+GENERATOR_DUPLICATE_NAME=Duplicate generator defined:
+ID_MAPPING_UNRESOLVED_GENERATOR_NAME=Unresolved generator name:
+GENERATED_VALUE_UNRESOLVED_GENERATOR=Generator is not defined in the persistence unit:
+QUERY_DUPLICATE_NAME=Duplicate query defined:
diff --git a/jpa/plugins/org.eclipse.jpt.ui/schema/jpaPlatformUis.exsd b/jpa/plugins/org.eclipse.jpt.ui/schema/jpaPlatformUis.exsd
new file mode 100644
index 0000000000..ef34ed6a63
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/schema/jpaPlatformUis.exsd
@@ -0,0 +1,139 @@
+
+
+
+
+
+
+
+
+ [Enter description of this extension point.]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extend this extension point and you must also extend the org.eclipse.jpt.core.jpaPlatforms extension point. The jpaPlatformId must match the id of a core.jpaPlatform extension. One jpaPlatform will be chosen per JpaProject. The possible jpaPlatforms will be displayed to the user as a project property.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The jpaPlatformId must match the corresponding org.eclipse.jpt.core.jpaPlatform extension id.
+
+
+
+
+
+
+ The class that implements <samp>org.eclipse.jpt.ui.JpaPlatformUiFactory</samp>.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2.2
+
+
+
+
+
+
+
+
+ [Enter extension point usage example here.]
+
+
+
+
+
+
+
+
+ Provisional API: This interface is part of an interim API that is still
+under development and expected to change significantly before reaching
+stability. It is available at this early stage to solicit feedback from
+pioneering adopters on the understanding that any code that uses this API
+will almost certainly be broken (repeatedly) as the API evolves.
+
+
+
+
+
+
+
+
+ [Enter information about supplied implementation of this extension point.]
+
+
+
+
+
+
+
+
+ Copyright (c) 2006, 2009 Oracle. All rights reserved.
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0, which accompanies this distribution
+and is available at http://www.eclipse.org/legal/epl-v10.html.
+
+Contributors:
+Oracle - initial API and implementation
+
+
+
+
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaPlatformUi.java
new file mode 100644
index 0000000000..6d01e4947c
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaPlatformUi.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui;
+
+import java.util.Iterator;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jpt.core.JpaFile;
+import org.eclipse.jpt.core.JpaPlatform;
+import org.eclipse.jpt.core.JpaProject;
+import org.eclipse.jpt.core.JpaResourceType;
+import org.eclipse.jpt.core.JpaStructureNode;
+import org.eclipse.jpt.core.context.AttributeMapping;
+import org.eclipse.jpt.core.context.PersistentAttribute;
+import org.eclipse.jpt.core.context.PersistentType;
+import org.eclipse.jpt.core.context.TypeMapping;
+import org.eclipse.jpt.ui.details.DefaultMappingUiDefinition;
+import org.eclipse.jpt.ui.details.JpaComposite;
+import org.eclipse.jpt.ui.details.JpaDetailsPage;
+import org.eclipse.jpt.ui.details.MappingUiDefinition;
+import org.eclipse.jpt.ui.navigator.JpaNavigatorProvider;
+import org.eclipse.jpt.ui.structure.JpaStructureProvider;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * This interface is to be implemented by a JPA vendor to provide extensions to
+ * JPA UI functionality. This is intended to work in conjunction with a core
+ * JPA platform ({@link JpaPlatform}) implementation with the same ID.
+ *
+ * Any implementation should be stateless in nature.
+ *
+ * The "generic" extension supplies UI for the core platform extension with the same
+ * ID.
+ *
+ * See the extension point: org.eclipse.jpt.ui.jpaPlatform
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface JpaPlatformUi
+{
+ // ********** navigator provider **********
+
+ /**
+ * Return the {@link JpaNavigatorProvider} for this platform,
+ * which determines Project Explorer content and look
+ */
+ JpaNavigatorProvider getNavigatorProvider();
+
+
+ // ********** structure providers **********
+
+ /**
+ * Return a structure provider for the specified JPA file.
+ */
+ JpaStructureProvider getStructureProvider(JpaFile jpaFile);
+
+
+ // ********** details providers **********
+
+ JpaDetailsPage extends JpaStructureNode> buildJpaDetailsPage(
+ Composite parent,
+ JpaStructureNode structureNode,
+ WidgetFactory widgetFactory);
+
+
+ // ********** file ui definitions **********
+
+ /**
+ * Return a resource ui definition for the specified resource type.
+ */
+ ResourceUiDefinition getResourceUiDefinition(JpaResourceType resourceType);
+
+
+ // ********** type mappings **********
+
+ JpaComposite buildTypeMappingComposite(
+ JpaResourceType resourceType,
+ String mappingKey,
+ Composite parent,
+ PropertyValueModel mappingHolder,
+ WidgetFactory widgetFactory);
+
+ DefaultMappingUiDefinition
+ getDefaultTypeMappingUiDefinition(JpaResourceType resourceType);
+
+ Iterator>
+ typeMappingUiDefinitions(JpaResourceType resourceType);
+
+
+ // ********** attribute mappings **********
+
+ JpaComposite buildAttributeMappingComposite(
+ JpaResourceType resourceType,
+ String mappingKey,
+ Composite parent,
+ PropertyValueModel mappingHolder,
+ WidgetFactory widgetFactory);
+
+ DefaultMappingUiDefinition
+ getDefaultAttributeMappingUiDefinition(JpaResourceType resourceType, String mappingKey);
+
+ Iterator>
+ attributeMappingUiDefinitions(JpaResourceType resourceType);
+
+
+ // ********** entity generation **********
+
+ void generateEntities(JpaProject project, IStructuredSelection selection);
+
+
+ // ********** DDL generation **********
+
+ void generateDDL(JpaProject project, IStructuredSelection selection);
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaPlatformUiFactory.java
new file mode 100644
index 0000000000..77c05fe69e
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaPlatformUiFactory.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui;
+
+/**
+ * This interface is to be implemented by a JPA vendor to build a JpaPlatformUi.
+ *
+ * See the extension point: org.eclipse.jpt.ui.jpaPlatform
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface JpaPlatformUiFactory
+{
+ JpaPlatformUi buildJpaPlatformUi();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaPlatformUiProvider.java
new file mode 100644
index 0000000000..a853d88cd6
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaPlatformUiProvider.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui;
+
+import java.util.ListIterator;
+import org.eclipse.jpt.core.JpaPlatform;
+import org.eclipse.jpt.ui.details.JpaDetailsProvider;
+
+/**
+ * This interface is to be implemented by a JPA vendor to provide extensions to
+ * JPA UI functionality. This is intended to work in conjunction with a core
+ * JPA platform ({@link JpaPlatform}) implementation with the same ID.
+ *
+ * Any implementation should be stateless in nature.
+ *
+ * The "generic" extension supplies UI for the core platform extension with the same
+ * ID.
+ *
+ * See the extension point: org.eclipse.jpt.ui.jpaPlatformUis
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface JpaPlatformUiProvider
+{
+ /**
+ * Return the details providers that apply to this platform.
+ */
+ ListIterator detailsProviders();
+
+ /**
+ * Return the resource ui definitions that apply to this platform.
+ */
+ ListIterator resourceUiDefinitions();
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JptUiPlugin.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JptUiPlugin.java
new file mode 100644
index 0000000000..24ae9da694
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JptUiPlugin.java
@@ -0,0 +1,236 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.jpt.core.JpaPlatform;
+import org.eclipse.jpt.core.JptCorePlugin;
+import org.eclipse.jpt.ui.internal.platform.JpaPlatformUiRegistry;
+import org.eclipse.jpt.ui.navigator.JpaNavigatorProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * Dali UI plug-in.
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+@SuppressWarnings("nls")
+public class JptUiPlugin
+ extends AbstractUIPlugin
+{
+ private final Listener focusListener;
+
+
+ // ********** constants **********
+
+ /**
+ * The plug-in identifier of JPA UI support (value {@value}).
+ */
+ public static final String PLUGIN_ID = "org.eclipse.jpt.ui";
+ public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
+
+ private static final String FOCUS_DATA_KEY = PLUGIN_ID_ + "focus";
+ private static final Object FOCUS_DATA = new Object();
+
+
+ // ********** singleton **********
+
+ private static JptUiPlugin INSTANCE;
+
+ /**
+ * Returns the singleton JPT UI plug-in.
+ */
+ public static JptUiPlugin instance() {
+ return INSTANCE;
+ }
+
+
+ // ********** logging **********
+
+ public static void log(IStatus status) {
+ INSTANCE.getLog().log(status);
+ }
+
+ public static void log(String msg) {
+ log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
+ }
+
+ public static void log(Throwable throwable) {
+ log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
+ }
+
+
+ // ********** images **********
+
+ /**
+ * Return an image descriptor for the specified .gif
+ * file in the icons folder.
+ */
+ public static ImageDescriptor getImageDescriptor(String key) {
+ if ( ! key.startsWith("icons/")) {
+ key = "icons/" + key;
+ }
+ if ( ! key.endsWith(".gif")) {
+ key = key + ".gif";
+ }
+ return imageDescriptorFromPlugin(PLUGIN_ID, key);
+ }
+
+ /**
+ * Return an image for the specified .gif
+ * file in the icons folder.
+ */
+ //TODO we are using the ImageRegistry here and storing all our icons for the life of the plugin,
+ //which means until the workspace is closed. This is better than before where we constantly
+ //created new images. Bug 306437 is about cleaning this up and using Local Resource Managers
+ //on our views so that closing the JPA perspective would mean our icons are disposed.
+ public static Image getImage(String key) {
+ ImageRegistry imageRegistry = instance().getImageRegistry();
+ Image image = imageRegistry.get(key);
+ if (image == null) {
+ imageRegistry.put(key, getImageDescriptor(key));
+ image = imageRegistry.get(key);
+ }
+ return image;
+ }
+
+
+ // ********** construction **********
+
+ public JptUiPlugin() {
+ super();
+ this.focusListener = this.buildFocusListener();
+ if (INSTANCE != null) {
+ throw new IllegalStateException();
+ }
+ INSTANCE = this;
+ }
+
+ /**
+ * We are registered to receive only {@link SWT#FocusIn} events
+ */
+ private Listener buildFocusListener() {
+ return new Listener() {
+ public void handleEvent(Event event) {
+ JptUiPlugin.this.focusIn((Control) event.widget);
+ }
+ };
+ }
+
+
+ // ********** focus handling **********
+
+ /**
+ * This method is called whenever a "focus in" event is generated.
+ * If the control gaining focus is part of one of our composites (typically
+ * a JPA Details View), we stop listening to Java change events
+ * (and assume all changes to the Java model are generated by us).
+ * If the control gaining focus is *not* part of one of our composites,
+ * we start listening to the Java change events again.
+ */
+ void focusIn(Control control) {
+ while (control != null) {
+ if (control.getData(FOCUS_DATA_KEY) == FOCUS_DATA) {
+ this.focusIn();
+ return;
+ }
+ control = control.getParent();
+ }
+ this.focusOut();
+ }
+
+ /**
+ * This method is called whenever a Dali UI control that affects Java
+ * source code gains the UI focus. When this happens we deactivate
+ * the Dali Java change listener so we ignore any changes to the Java
+ * source code that probably originated from Dali. This means we will miss
+ * any changes to the Java source code that is caused by non-UI activity;
+ * but, we hope, these changes are unrelated to JPA annotations etc.
+ * @see #focusOut()
+ */
+ private void focusIn() {
+ JptCorePlugin.setJavaElementChangeListenerIsActive(false);
+ }
+
+ /**
+ * This method is called whenever a non-Dali UI control gains the UI focus.
+ * When this happens we activate the Dali Java change listener so that we
+ * begin to keep the Dali model synchronized with the Java source code.
+ * @see #focusIn()
+ */
+ private void focusOut() {
+ JptCorePlugin.setJavaElementChangeListenerIsActive(true);
+ }
+
+ /**
+ * Tag the specified control so that whenever it (or any of its children,
+ * grandchildren, etc.) has the focus, the Dali model ignores any Java
+ * change events. This method is to be called when the control is first
+ * constructed.
+ */
+ public void controlAffectsJavaSource(Control control) {
+ control.setData(FOCUS_DATA_KEY, FOCUS_DATA);
+ }
+
+
+ // ********** platform **********
+
+ /**
+ * Return the JPA platform UI corresponding to the specified JPA platform.
+ */
+ public JpaPlatformUi getJpaPlatformUi(JpaPlatform jpaPlatform) {
+ return JpaPlatformUiRegistry.instance().getJpaPlatformUi(jpaPlatform.getId());
+ }
+
+ public JpaNavigatorProvider getJpaNavigatorProvider(JpaPlatform jpaPlatform) {
+ JpaPlatformUi platform = this.getJpaPlatformUi(jpaPlatform);
+ return (platform == null) ? null : platform.getNavigatorProvider();
+ }
+
+
+ // ********** plug-in implementation **********
+
+ /**
+ * Register our SWT listener with the display so we receive notification
+ * of every "focus in" event.
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ Display.getDefault().addFilter(SWT.FocusIn, this.focusListener);
+ }
+
+ /**
+ * Unregister our SWT listener with the display.
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ try {
+ Display.getDefault().removeFilter(SWT.FocusIn, this.focusListener);
+ } finally {
+ super.stop(context);
+ }
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/MappingResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/MappingResourceUiDefinition.java
new file mode 100644
index 0000000000..00e6a9dc4f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/MappingResourceUiDefinition.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui;
+
+import java.util.Iterator;
+import org.eclipse.jpt.core.context.AttributeMapping;
+import org.eclipse.jpt.core.context.PersistentAttribute;
+import org.eclipse.jpt.core.context.PersistentType;
+import org.eclipse.jpt.core.context.TypeMapping;
+import org.eclipse.jpt.ui.details.DefaultMappingUiDefinition;
+import org.eclipse.jpt.ui.details.JpaComposite;
+import org.eclipse.jpt.ui.details.MappingUiDefinition;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface MappingResourceUiDefinition extends ResourceUiDefinition
+{
+ /**
+ *
+ */
+ JpaComposite buildAttributeMappingComposite(
+ String key,
+ PropertyValueModel mappingHolder,
+ Composite parent, WidgetFactory widgetFactory);
+
+ /**
+ * Return an iterator of attribute mapping ui definitions appropriate for this file type
+ */
+ Iterator>
+ attributeMappingUiDefinitions();
+
+ /**
+ * Return a default attribute mapping ui definition for the given key or null
+ */
+ DefaultMappingUiDefinition
+ getDefaultAttributeMappingUiDefinition(String key);
+
+ /**
+ *
+ */
+ JpaComposite buildTypeMappingComposite(
+ String key,
+ PropertyValueModel mappingHolder,
+ Composite parent, WidgetFactory widgetFactory);
+
+ /**
+ *
+ */
+ Iterator>
+ typeMappingUiDefinitions();
+
+ /**
+ * Return a default type mapping ui provider or null
+ */
+ DefaultMappingUiDefinition
+ getDefaultTypeMappingUiDefinition();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/PersistenceXmlResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/PersistenceXmlResourceUiDefinition.java
new file mode 100644
index 0000000000..ae0070e975
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/PersistenceXmlResourceUiDefinition.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui;
+
+import java.util.ListIterator;
+import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.ui.details.JpaPageComposite;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface PersistenceXmlResourceUiDefinition extends ResourceUiDefinition
+{
+ ListIterator buildPersistenceUnitComposites(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/ResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/ResourceUiDefinition.java
new file mode 100644
index 0000000000..eee4213601
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/ResourceUiDefinition.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui;
+
+import org.eclipse.jpt.core.JpaResourceType;
+import org.eclipse.jpt.ui.structure.JpaStructureProvider;
+
+/**
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface ResourceUiDefinition
+{
+ /**
+ * Return whether this definition provides UI for resource of the given type
+ */
+ boolean providesUi(JpaResourceType resourceType);
+
+ /**
+ * Return the structure provider association with this mapping file type.
+ */
+ JpaStructureProvider getStructureProvider();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/WidgetFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/WidgetFactory.java
new file mode 100644
index 0000000000..cfee242e5a
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/WidgetFactory.java
@@ -0,0 +1,240 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui;
+
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DateTime;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormText;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * A widget factory is responsible for creating an SWT widget based on the right
+ * style. Some style shows the widgets differently, for instance, the flat style
+ * shows the widgets with less borders.
+ *
+ * Provisional API: This interface is part of an interim API that is still under
+ * development and expected to change significantly before reaching stability.
+ * It is available at this early stage to solicit feedback from pioneering
+ * adopters on the understanding that any code that uses this API will almost
+ * certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 2.0
+ * @since 2.0
+ */
+public interface WidgetFactory {
+
+ /**
+ * Creates a new regular button.
+ *
+ * @param parent The parent container
+ * @param text The button's text
+ * @return A new Button
+ */
+ Button createButton(Composite parent, String text);
+
+ /**
+ * Creates a new non-editable custom Combo.
+ *
+ * @deprecated
+ * @param parent The parent container
+ * @return A new CCombo
+ */
+ @Deprecated
+ CCombo createCCombo(Composite parent);
+
+ /**
+ * Creates a new check box button.
+ *
+ * @param parent The parent container
+ * @param text The button's text
+ * @return A new Button
+ */
+ Button createCheckBox(Composite parent, String text);
+
+ /**
+ * Creates a new non-editable Combo.
+ *
+ * @param parent The parent container
+ * @return A new Combo
+ */
+ Combo createCombo(Composite parent);
+
+ /**
+ * Creates a new container.
+ *
+ * @param parent The parent container
+ * @return A new Composite
+ */
+ Composite createComposite(Composite parent);
+
+ /**
+ * Creates a new DateTime.
+ *
+ * @param container The parent container
+ * @param style The style is to tell the type of widget
+ * (SWT.DATE or SWT.TIME or SWT.CALENDAR)
+ * @return A new DateTime
+ */
+ DateTime createDateTime(Composite parent, int style);
+
+ /**
+ * Creates a new editable custom CCombo.
+ *
+ * @deprecated
+ * @param parent The parent container
+ * @return A new CCombo
+ */
+ @Deprecated
+ CCombo createEditableCCombo(Composite parent);
+
+ /**
+ * Creates a new editable Combo.
+ *
+ * @param parent The parent container
+ * @return A new Combo
+ */
+ Combo createEditableCombo(Composite parent);
+
+ /**
+ * Creates a new titled pane (group box).
+ *
+ * @param parent The parent container
+ * @param title The group pane's title
+ * @return A new Group
+ */
+ Group createGroup(Composite parent, String title);
+
+ /**
+ * Creates a new label that is shown as a hyperlink.
+ *
+ * @param parent The parent container
+ * @param text The label's text
+ * @return A new Hyperlink
+ */
+ Hyperlink createHyperlink(Composite parent, String text);
+
+ /**
+ * Creates a new label.
+ *
+ * @param container The parent container
+ * @param labelText The label's text
+ * @return A new Label
+ */
+ Label createLabel(Composite container, String labelText);
+
+ /**
+ * Creates a new list.
+ *
+ * @param container The parent container
+ * @param style The style is usually to tell what type of selection
+ * (SWT.MULTI or SWT.SINGLE)
+ * @return A new Label
+ */
+ List createList(Composite container, int style);
+
+ /**
+ * Creates a new label that can be wrapped on multiple lines.
+ *
+ * @param container The parent container
+ * @param labelText The label's text
+ * @return A new FormText
+ */
+ FormText createMultiLineLabel(Composite container, String labelText);
+
+ /**
+ * Creates a new editable text area.
+ *
+ * @param parent The parent container
+ * @param parent The number of lines the text area should display
+ * @return A new Text
+ */
+ Text createMultiLineText(Composite parent);
+
+ /**
+ * Creates a new editable text field that handles password.
+ *
+ * @param container The parent container
+ * @return A new Text
+ */
+ Text createPasswordText(Composite container);
+
+ /**
+ * Creates a new push button (toggle between selected and unselected).
+ *
+ * @param parent The parent container
+ * @param text The button's text
+ * @return A new Button
+ */
+ Button createPushButton(Composite parent, String text);
+
+ /**
+ * Creates a new radio button.
+ *
+ * @param parent The parent container
+ * @param text The button's text
+ * @return A new Button
+ */
+ Button createRadioButton(Composite parent, String text);
+
+ /**
+ * Creates a new section, which is a collapsable pane with a title bar.
+ *
+ * @param parent The parent container
+ * @param style The style of the title bar, which can be
+ * ExpandableComposite.TWISTIE and
+ * ExpandableComposite.TITLE_BAR
+ * @return A new Section
+ */
+ Section createSection(Composite parent, int style);
+
+ /**
+ * Creates a new spinner.
+ *
+ * @param parent The parent container
+ * @return A new Spinner
+ */
+ Spinner createSpinner(Composite parent);
+
+ /**
+ * Creates a new table.
+ *
+ * @param container The parent container
+ * @param style The style to apply to the table
+ * @return A new Table
+ */
+ Table createTable(Composite parent, int style);
+
+ /**
+ * Creates a new editable text field.
+ *
+ * @param container The parent container
+ * @return A new Text
+ */
+ Text createText(Composite parent);
+
+ /**
+ * Creates a new tri-state check box.
+ *
+ * @param parent The parent container
+ * @param text The button's text
+ * @return A new Button that has 3 selection states
+ */
+ Button createTriStateCheckBox(Composite parent, String text);
+}
\ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/DefaultMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/DefaultMappingUiDefinition.java
new file mode 100644
index 0000000000..194b536446
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/DefaultMappingUiDefinition.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details;
+
+/**
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface DefaultMappingUiDefinition
+ extends MappingUiDefinition
+{
+ /**
+ * Returns a unique string that corresponds to the key of the mapping in the
+ * core. For a default mapping the method getKey() will return null since
+ * that is for the specified mapping. This will return the default mapping key, not null
+ */
+ String getDefaultKey();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaComposite.java
new file mode 100644
index 0000000000..207e78501a
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaComposite.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details;
+
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * A {@link JpaComposite} defines the common behavior of the JPA related
+ * widgets.
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface JpaComposite {
+
+ /**
+ * Returns the actual Composite.
+ *
+ * @return This composite's actual widget
+ */
+ Control getControl();
+
+ /**
+ * Changes the enablement state of the widgets of this pane.
+ *
+ * @param enabled true to enable the widgets or false
+ * to disable them
+ */
+ void enableWidgets(boolean enabled);
+
+ /**
+ * Notifies this composite it should dispose any resources.
+ */
+ void dispose();
+}
\ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsPage.java
new file mode 100644
index 0000000000..51f8d77c59
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsPage.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details;
+
+import org.eclipse.jpt.core.JpaStructureNode;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * A details page is used to show the property pane for a given context node. The
+ * {@link JpaDetailsProvider} is responsible for creating the pane.
+ *
+ * @see JpaDetailsProvider
+ *
+ * @version 2.0
+ * @since 2.0
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface JpaDetailsPage
+{
+ /**
+ * Returns this details' page's widget.
+ *
+ * @return The container of the widgets shown by this details page
+ */
+ Control getControl();
+
+ /**
+ * Sets the subject for this details page.
+ *
+ * @param subject Either the new subject or null if the subject
+ * needs to be removed
+ */
+ void setSubject(T subject);
+
+ /**
+ * Dispose the details page and any resources it holds.
+ */
+ void dispose();
+}
\ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsProvider.java
new file mode 100644
index 0000000000..10bc880051
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsProvider.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details;
+
+import org.eclipse.jpt.core.JpaStructureNode;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * This provider is responsible to create the {@link JpaDetailsPage}
+ * responsible to show the information for a given content node id.
+ *
+ * @see JpaDetailsPage
+ *
+ * @version 3.0
+ * @since 2.0
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface JpaDetailsProvider
+{
+ /**
+ * Return whether this provider returns a details page for the given structure node
+ */
+ boolean providesDetails(JpaStructureNode structureNode);
+
+ /**
+ * Creates a new details page based on the given content node id.
+ *
+ * @param parent The parent container
+ * @param contentNodeId The unique identifier used to determine which details
+ * page to create
+ * @param widgetFactory The factory used to create various widgets
+ */
+ //TODO Should we pass in JpaUiFactory so these pages can be built using the factory and overriden?
+ JpaDetailsPage extends JpaStructureNode> buildDetailsPage(
+ Composite parent,
+ WidgetFactory widgetFactory);
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaPageComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaPageComposite.java
new file mode 100644
index 0000000000..3bcb12d4c5
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaPageComposite.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+
+/**
+ * A {@link JpaPageComposite} defines the common behavior of the JPA
+ * related widgets that is shown as a page within an editor.
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface JpaPageComposite extends JpaComposite {
+
+ /**
+ * Returns the help ID. This ID will be used if the help button is invoked.
+ *
+ * @return Either the help ID of this page or null if no help
+ * is required
+ */
+ String getHelpID();
+
+ /**
+ * The image of the tab showing this page.
+ *
+ * @return The page's image
+ */
+ ImageDescriptor getPageImageDescriptor();
+
+ /**
+ * The text of the tab showing this page.
+ *
+ * @return The page's text
+ */
+ String getPageText();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/MappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/MappingUiDefinition.java
new file mode 100644
index 0000000000..011b797b6a
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/MappingUiDefinition.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details;
+
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * A UI provider is responsible to provide the support for displaying the
+ * information for a certain mapping type.
+ *
+ * T represents the type of the mapping the definition represents
+ * M represents the type of the object being mapped
+ *
+ * @version 2.3
+ * @since 2.0
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface MappingUiDefinition
+{
+ /**
+ * Returns a unique string that corresponds to the key of the mapping in the
+ * core (JavaAttributeMappingDefinition and/or OrmAttributeMappingProvider).
+ *
+ * @return The key representing the mapping
+ */
+ String getKey();
+
+ /**
+ * Returns a human readable text of the mapping type.
+ *
+ * @return A display string for the mapping type
+ */
+ String getLabel();
+
+ /**
+ * Returns a human readable text of the mapping type to be used in the mapping change link label
+ */
+ String getLinkLabel();
+
+ /**
+ * Returns an image that represents the mapping type defined by this provider.
+ *
+ * @return An image representing a mapping or null if no image
+ * is required
+ */
+ Image getImage();
+
+ /**
+ * Return whether the mapping type represented by this definition is enabled for the given
+ * mappable object. This is almost always true.
+ */
+ boolean isEnabledFor(M mappableObject);
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/DefaultJavaAttributeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/DefaultJavaAttributeMappingUiDefinition.java
new file mode 100644
index 0000000000..0380105e21
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/DefaultJavaAttributeMappingUiDefinition.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details.java;
+
+import org.eclipse.jpt.core.context.AttributeMapping;
+import org.eclipse.jpt.core.context.PersistentAttribute;
+import org.eclipse.jpt.ui.details.DefaultMappingUiDefinition;
+
+/**
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface DefaultJavaAttributeMappingUiDefinition
+ extends JavaAttributeMappingUiDefinition, DefaultMappingUiDefinition
+{
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/DefaultJavaTypeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/DefaultJavaTypeMappingUiDefinition.java
new file mode 100644
index 0000000000..d74ffde19a
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/DefaultJavaTypeMappingUiDefinition.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details.java;
+
+import org.eclipse.jpt.core.context.PersistentType;
+import org.eclipse.jpt.core.context.TypeMapping;
+import org.eclipse.jpt.ui.details.DefaultMappingUiDefinition;
+
+/**
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface DefaultJavaTypeMappingUiDefinition
+ extends JavaTypeMappingUiDefinition, DefaultMappingUiDefinition
+{
+
+}
\ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/JavaAttributeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/JavaAttributeMappingUiDefinition.java
new file mode 100644
index 0000000000..d518be929a
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/JavaAttributeMappingUiDefinition.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details.java;
+
+import org.eclipse.jpt.core.context.AttributeMapping;
+import org.eclipse.jpt.core.context.PersistentAttribute;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.details.JpaComposite;
+import org.eclipse.jpt.ui.details.MappingUiDefinition;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface JavaAttributeMappingUiDefinition
+ extends MappingUiDefinition
+{
+ /**
+ * Creates JpaComposite that corresponds to this mapping type.
+ * This will be displayed by the PersistentAttributeDetailsPage
+ * when the mapping key matches the key given by this provider. The
+ * composites will be stored in a Map with the mapping key as the key.
+ *
+ * @param factory The UI factory responsible to create the right composite
+ * for any mapping type
+ * @param subjectHolder The holder of the subject being displayed
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the various widgets
+ * @return The composite displaying the information for a certain mapping
+ */
+ JpaComposite buildAttributeMappingComposite(
+ JavaUiFactory factory,
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/JavaTypeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/JavaTypeMappingUiDefinition.java
new file mode 100644
index 0000000000..a5754e01eb
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/JavaTypeMappingUiDefinition.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details.java;
+
+import org.eclipse.jpt.core.context.PersistentType;
+import org.eclipse.jpt.core.context.TypeMapping;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.details.JpaComposite;
+import org.eclipse.jpt.ui.details.MappingUiDefinition;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface JavaTypeMappingUiDefinition
+ extends MappingUiDefinition
+{
+ /**
+ * Creates JpaComposite that corresponds to this mapping type.
+ * This will be displayed by the PersistentTypeDetailsPage when
+ * the mapping key matches the key given by this provider. The composites
+ * will be stored in a Map with the mapping key as the key.
+ *
+ * @param factory The UI factory responsible to create the right composite
+ * for any mapping type
+ * @param subjectHolder The holder of the subject being displayed
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the various widgets
+ * @return The composite displaying the information for a certain mapping
+ */
+ JpaComposite buildTypeMappingComposite(
+ JavaUiFactory factory,
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/JavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/JavaUiFactory.java
new file mode 100644
index 0000000000..18f9bda66d
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/java/JavaUiFactory.java
@@ -0,0 +1,265 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details.java;
+
+import org.eclipse.jpt.core.context.java.JavaBasicMapping;
+import org.eclipse.jpt.core.context.java.JavaEmbeddable;
+import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
+import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
+import org.eclipse.jpt.core.context.java.JavaEntity;
+import org.eclipse.jpt.core.context.java.JavaIdMapping;
+import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
+import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
+import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
+import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
+import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
+import org.eclipse.jpt.core.context.java.JavaTransientMapping;
+import org.eclipse.jpt.core.context.java.JavaVersionMapping;
+import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
+import org.eclipse.jpt.core.context.orm.OrmEntity;
+import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.details.JpaComposite;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Use {@link JavaUiFactory} to create any java JPA composites
+ *
+ * Provisional API: This interface is part of an interim API that is still under
+ * development and expected to change significantly before reaching stability.
+ * It is available at this early stage to solicit feedback from pioneering
+ * adopters on the understanding that any code that uses this API will almost
+ * certainly be broken (repeatedly) as the API evolves.
+ *
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface JavaUiFactory
+{
+
+ // **************** java type mapping composites ***************************
+
+ /**
+ * Creates a new JpaComposite used to edit a JavaMappedSuperclass.
+ *
+ * @param subjectHolder The holder of the mapped superclass
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createJavaMappedSuperclassComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an JavaEntity.
+ *
+ * @param subjectHolder The holder of the java entity
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createJavaEntityComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit a JavaEmbeddable.
+ *
+ * @param subjectHolder The holder of the embeddable
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createJavaEmbeddableComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+
+ // **************** orm type mapping composites ****************************
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmMappedSuperclass.
+ *
+ * @param subjectHolder The holder of the mapped superclass
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmMappedSuperclassComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmEntity.
+ *
+ * @param subjectHolder The holder of the orm entity
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmEntityComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmEmbeddable.
+ *
+ * @param subjectHolder The holder of the embeddable
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmEmbeddableComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+
+ // **************** java attribute mapping composites **********************
+
+ /**
+ * Creates a new JpaComposite used to edit a JavaIdMapping.
+ *
+ * @param subjectHolder The holder of the ID mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createJavaIdMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit a JavaEmbeddedIdMapping.
+ *
+ * @param subjectHolder The holder of the embedded ID mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createJavaEmbeddedIdMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit a JavaBasicMapping.
+ *
+ * @param subjectHolder The holder of the basic mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createJavaBasicMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit a JavaVersionMapping.
+ *
+ * @param subjectHolder The holder of the version mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createJavaVersionMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit a JavaManyToOneMapping.
+ *
+ * @param subjectHolder The holder of the many to one mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createJavaManyToOneMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit a JavaOneToManyMapping.
+ *
+ * @param subjectHolder The holder of the one to many mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createJavaOneToManyMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit a JavaOneToOneMapping.
+ *
+ * @param subjectHolder The holder of the one to one mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createJavaOneToOneMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit a JavaManyToManyMapping.
+ *
+ * @param subjectHolder The holder of the many to many mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createJavaManyToManyMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit a JavaEmbeddedMapping.
+ *
+ * @param subjectHolder The holder of the embedded mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createJavaEmbeddedMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit a JavaTransientMapping.
+ *
+ * @param subjectHolder The holder of the transient mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createJavaTransientMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+}
\ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/orm/OrmAttributeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/orm/OrmAttributeMappingUiDefinition.java
new file mode 100644
index 0000000000..897fde2f31
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/orm/OrmAttributeMappingUiDefinition.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details.orm;
+
+import org.eclipse.jpt.core.context.AttributeMapping;
+import org.eclipse.jpt.core.context.PersistentAttribute;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.details.JpaComposite;
+import org.eclipse.jpt.ui.details.MappingUiDefinition;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface OrmAttributeMappingUiDefinition
+ extends MappingUiDefinition
+{
+ /**
+ * Creates JpaComposite that corresponds to this mapping type.
+ * This will be displayed by the PersistentAttributeDetailsPage
+ * when the mapping key matches the key given by this provider. The
+ * composites will be stored in a Map with the mapping key as the key.
+ *
+ * @param factory The UI factory responsible to create the right composite
+ * for any mapping type
+ * @param subjectHolder The holder of the subject being displayed
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the various widgets
+ * @return The composite displaying the information for a certain mapping
+ */
+ JpaComposite buildAttributeMappingComposite(
+ OrmXmlUiFactory factory,
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/orm/OrmTypeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/orm/OrmTypeMappingUiDefinition.java
new file mode 100644
index 0000000000..b449a77d6e
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/orm/OrmTypeMappingUiDefinition.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details.orm;
+
+import org.eclipse.jpt.core.context.PersistentType;
+import org.eclipse.jpt.core.context.TypeMapping;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.details.JpaComposite;
+import org.eclipse.jpt.ui.details.MappingUiDefinition;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface OrmTypeMappingUiDefinition
+ extends MappingUiDefinition
+{
+ /**
+ * Creates JpaComposite that correponds to this mapping type.
+ * This will be displayed by the PersistentTypeDetailsPage when
+ * the mapping key matches the key given by this provider. The composites
+ * will be stored in a Map with the mapping key as the key.
+ *
+ * @param factory The UI factory responsible to create the right composite
+ * for any mapping type
+ * @param subjectHolder The holder of the subject being displayed
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the various widgets
+ * @return The composite displaying the information for a certain mapping
+ */
+ JpaComposite buildTypeMappingComposite(
+ OrmXmlUiFactory factory,
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/orm/OrmXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/orm/OrmXmlUiFactory.java
new file mode 100644
index 0000000000..beeb7c6f09
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/orm/OrmXmlUiFactory.java
@@ -0,0 +1,220 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.details.orm;
+
+import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
+import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
+import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
+import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
+import org.eclipse.jpt.core.context.orm.OrmEntity;
+import org.eclipse.jpt.core.context.orm.OrmIdMapping;
+import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
+import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
+import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
+import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
+import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
+import org.eclipse.jpt.core.context.orm.OrmTransientMapping;
+import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.details.JpaComposite;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Use {@link OrmXmlUiFactory} to create any ORM JPA composites
+ *
+ * Provisional API: This interface is part of an interim API that is still under
+ * development and expected to change significantly before reaching stability.
+ * It is available at this early stage to solicit feedback from pioneering
+ * adopters on the understanding that any code that uses this API will almost
+ * certainly be broken (repeatedly) as the API evolves.
+ *
+ * @see org.eclipse.jpt.ui.internal.BaseJpaUiFactory
+ *
+ * @version 2.0
+ * @since 1.0
+ */
+public interface OrmXmlUiFactory
+{
+
+ // **************** orm type mapping composites ****************************
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmMappedSuperclass.
+ *
+ * @param subjectHolder The holder of the mapped superclass
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmMappedSuperclassComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmEntity.
+ *
+ * @param subjectHolder The holder of the orm entity
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmEntityComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmEmbeddable.
+ *
+ * @param subjectHolder The holder of the embeddable
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmEmbeddableComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+
+ // **************** orm attribute mapping composites ***********************
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmIdMapping.
+ *
+ * @param subjectHolder The holder of the ID mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmIdMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmEmbeddedIdMapping.
+ *
+ * @param subjectHolder The holder of the embedded ID mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmEmbeddedIdMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmBasicMapping.
+ *
+ * @param subjectHolder The holder of the basic mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmBasicMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmVersionMapping.
+ *
+ * @param subjectHolder The holder of the version mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmVersionMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmManyToOneMapping.
+ *
+ * @param subjectHolder The holder of the many to one mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmManyToOneMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmOneToManyMapping.
+ *
+ * @param subjectHolder The holder of the one to many mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmOneToManyMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmOneToOneMapping.
+ *
+ * @param subjectHolder The holder of the one to one mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmOneToOneMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmManyToManyMapping.
+ *
+ * @param subjectHolder The holder of the many to many mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmManyToManyMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmEmbeddedMapping.
+ *
+ * @param subjectHolder The holder of the embedded mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmEmbeddedMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+
+ /**
+ * Creates a new JpaComposite used to edit an OrmTransientMapping.
+ *
+ * @param subjectHolder The holder of the transient mapping
+ * @param parent The parent container
+ * @param widgetFactory The factory used to create the widgets
+ * @return A new JpaComposite
+ */
+ JpaComposite createOrmTransientMappingComposite(
+ PropertyValueModel subjectHolder,
+ Composite parent,
+ WidgetFactory widgetFactory);
+}
\ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/AbstractJpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/AbstractJpaPlatformUiProvider.java
new file mode 100644
index 0000000000..d2a1f933bf
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/AbstractJpaPlatformUiProvider.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.ListIterator;
+import org.eclipse.jpt.ui.JpaPlatformUiProvider;
+import org.eclipse.jpt.ui.ResourceUiDefinition;
+import org.eclipse.jpt.ui.details.JpaDetailsProvider;
+import org.eclipse.jpt.utility.internal.iterators.ArrayListIterator;
+
+/**
+ * All the state in the JPA platform ui provider should be "static" (i.e. unchanging once
+ * it is initialized).
+ */
+public abstract class AbstractJpaPlatformUiProvider implements JpaPlatformUiProvider
+{
+ private JpaDetailsProvider[] detailsProviders;
+
+ private ResourceUiDefinition[] resourceUiDefinitions;
+
+ /**
+ * zero-argument constructor
+ */
+ public AbstractJpaPlatformUiProvider() {
+ super();
+ }
+
+
+ // ********** details providers **********
+
+ public ListIterator detailsProviders() {
+ return new ArrayListIterator(getDetailsProviders());
+ }
+
+ protected synchronized JpaDetailsProvider[] getDetailsProviders() {
+ if (this.detailsProviders == null) {
+ this.detailsProviders = this.buildDetailsProviders();
+ }
+ return this.detailsProviders;
+ }
+
+ protected JpaDetailsProvider[] buildDetailsProviders() {
+ ArrayList providers = new ArrayList();
+ this.addDetailsProvidersTo(providers);
+ return providers.toArray(new JpaDetailsProvider[providers.size()]);
+ }
+
+ /**
+ * Implement this to specify JPA details providers.
+ */
+ protected abstract void addDetailsProvidersTo(List providers);
+
+
+
+ // ********** structure providers **********
+
+ public ListIterator resourceUiDefinitions() {
+ return new ArrayListIterator(getResourceUiDefinitions());
+ }
+
+ protected synchronized ResourceUiDefinition[] getResourceUiDefinitions() {
+ if (this.resourceUiDefinitions == null) {
+ this.resourceUiDefinitions = this.buildResourceUiDefinitions();
+ }
+ return this.resourceUiDefinitions;
+ }
+
+ protected ResourceUiDefinition[] buildResourceUiDefinitions() {
+ ArrayList definitions = new ArrayList();
+ this.addResourceUiDefinitionsTo(definitions);
+ return definitions.toArray(new ResourceUiDefinition[definitions.size()]);
+ }
+
+ /**
+ * Implement this to specify JPA mapping file ui definitions.
+ */
+ protected abstract void addResourceUiDefinitionsTo(List definitions);
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/EditorPartAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/EditorPartAdapterFactory.java
new file mode 100644
index 0000000000..94768587d6
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/EditorPartAdapterFactory.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.jpt.core.JpaFile;
+import org.eclipse.jpt.core.JptCorePlugin;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+
+/**
+ * Factory to build adapters for a editor part:
+ * - JPA file (if the editor part is a file editor etc.)
+ *
+ * See org.eclipse.jpt.ui plugin.xml.
+ */
+public class EditorPartAdapterFactory
+ implements IAdapterFactory
+{
+ private static final Class>[] ADAPTER_LIST = new Class[] { JpaFile.class };
+
+ public Class>[] getAdapterList() {
+ return ADAPTER_LIST;
+ }
+
+ public Object getAdapter(Object adaptableObject, @SuppressWarnings("unchecked") Class adapterType) {
+ if (adaptableObject instanceof IEditorPart) {
+ return this.getAdapter((IEditorPart) adaptableObject, adapterType);
+ }
+ return null;
+ }
+
+ private Object getAdapter(IEditorPart editorPart, Class> adapterType) {
+ if (adapterType == JpaFile.class) {
+ return this.getJpaFile(editorPart);
+ }
+ return null;
+ }
+
+ private JpaFile getJpaFile(IEditorPart editorPart) {
+ IEditorInput editorInput = editorPart.getEditorInput();
+ if (editorInput instanceof IFileEditorInput) {
+ return this.getJpaFile((IFileEditorInput) editorInput);
+ }
+ return null;
+ }
+
+ private JpaFile getJpaFile(IFileEditorInput fileEditorInput) {
+ return this.getJpaFile(fileEditorInput.getFile());
+ }
+
+ private JpaFile getJpaFile(IFile file) {
+ return JptCorePlugin.getJpaFile(file);
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/GenericJpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/GenericJpaPlatformUiProvider.java
new file mode 100644
index 0000000000..f3b92c1c5f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/GenericJpaPlatformUiProvider.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal;
+
+import java.util.List;
+import org.eclipse.jpt.ui.JpaPlatformUiProvider;
+import org.eclipse.jpt.ui.ResourceUiDefinition;
+import org.eclipse.jpt.ui.details.JpaDetailsProvider;
+import org.eclipse.jpt.ui.internal.details.java.GenericJavaResourceUiDefinition;
+import org.eclipse.jpt.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
+import org.eclipse.jpt.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
+import org.eclipse.jpt.ui.internal.details.orm.EntityMappingsDetailsProvider;
+import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
+import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
+import org.eclipse.jpt.ui.internal.details.orm.OrmXmlUiDefinition;
+import org.eclipse.jpt.ui.internal.persistence.details.PersistenceXmlUiDefinition;
+
+/**
+ * All the state in the JPA platform should be "static" (i.e. unchanging once
+ * it is initialized).
+ */
+public class GenericJpaPlatformUiProvider extends AbstractJpaPlatformUiProvider
+{
+
+ // singleton
+ private static final JpaPlatformUiProvider INSTANCE = new GenericJpaPlatformUiProvider();
+
+ /**
+ * Return the singleton.
+ */
+ public static JpaPlatformUiProvider instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Ensure single instance.
+ */
+ private GenericJpaPlatformUiProvider() {
+ super();
+ }
+
+
+ // ********** details providers **********
+
+ @Override
+ protected void addDetailsProvidersTo(List providers) {
+ providers.add(JavaPersistentTypeDetailsProvider.instance());
+ providers.add(JavaPersistentAttributeDetailsProvider.instance());
+ providers.add(EntityMappingsDetailsProvider.instance());
+ providers.add(OrmPersistentTypeDetailsProvider.instance());
+ providers.add(OrmPersistentAttributeDetailsProvider.instance());
+ }
+
+
+ // ********** resource ui definitions **********
+
+ @Override
+ protected void addResourceUiDefinitionsTo(List defintions) {
+ defintions.add(GenericJavaResourceUiDefinition.instance());
+ defintions.add(OrmXmlUiDefinition.instance());
+ defintions.add(PersistenceXmlUiDefinition.instance());
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/ImageRepository.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/ImageRepository.java
new file mode 100644
index 0000000000..97c1ecdc3a
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/ImageRepository.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ResourceManager;
+import org.eclipse.jpt.ui.JptUiPlugin;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+@SuppressWarnings("nls")
+public final class ImageRepository {
+
+ // ***** overlays *****
+ public static Image getErrorOverlayImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, ERROR_OVERLAY_DESCRIPTOR);
+ }
+ private static final ImageDescriptor ERROR_OVERLAY_DESCRIPTOR = buildImageDescriptor("overlays/error.gif");
+
+ public static Image getWarningOverlayImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, WARNING_OVERLAY_DESCRIPTOR);
+ }
+ private static final ImageDescriptor WARNING_OVERLAY_DESCRIPTOR = buildImageDescriptor("overlays/warning.png");
+
+ // ***** buttons *****
+ public static Image getAddButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, ADD_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor ADD_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/add.png");
+
+ public static Image getEditButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, EDIT_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor EDIT_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/edit.png");
+
+ public static Image getDeleteButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, DELETE_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor DELETE_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/delete.png");
+
+ public static Image getMoveUpButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, MOVE_UP_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor MOVE_UP_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/move-up.png");
+
+ public static Image getMoveDownButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, MOVE_DOWN_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor MOVE_DOWN_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/move-down.png");
+
+ public static Image getExpandAllButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, EXPAND_ALL_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor EXPAND_ALL_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/expand-all.png");
+
+ public static Image getCollapseAllButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, COLLAPSE_ALL_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor COLLAPSE_ALL_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/collapse-all.png");
+
+ public static Image getRestoreDefaultsButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, RESTORE_DEFAULTS_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor RESTORE_DEFAULTS_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/restore-defaults.png");
+
+ public static Image getBrowseButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, BROWSE_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor BROWSE_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/browse.png");
+
+ public static Image getMiniBrowseButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, MINI_BROWSE_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor MINI_BROWSE_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/browse-mini.png");
+
+ public static Image getSelectAllButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, SELECT_ALL_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor SELECT_ALL_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/select-all.png");
+
+ public static Image getDeselectAllButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, DESELECT_ALL_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor DESELECT_ALL_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/deselect-all.png");
+
+ public static Image getAddConnectionButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, ADD_CONNECTION_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor ADD_CONNECTION_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/add-connection.gif");
+
+ public static Image getReconnectButtonImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, RECONNECT_BUTTON_DESCRIPTOR);
+ }
+ private static final ImageDescriptor RECONNECT_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/reconnect.png");
+
+ // ***** objects *****
+ public static Image getFileImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, FILE_DESCRIPTOR);
+ }
+ private static final ImageDescriptor FILE_DESCRIPTOR = buildImageDescriptor("objects/file.png");
+
+ public static Image getFolderImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, FOLDER_DESCRIPTOR);
+ }
+ private static final ImageDescriptor FOLDER_DESCRIPTOR = buildImageDescriptor("objects/folder.png");
+
+ public static Image getPackageImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, PACKAGE_DESCRIPTOR);
+ }
+ private static final ImageDescriptor PACKAGE_DESCRIPTOR = buildImageDescriptor("objects/package.png");
+
+ public static Image getTableImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, TABLE_DESCRIPTOR);
+ }
+ private static final ImageDescriptor TABLE_DESCRIPTOR = buildImageDescriptor("objects/table.gif");
+
+ public static Image getTableObjImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, TABLE_OBJ_DESCRIPTOR);
+ }
+ private static final ImageDescriptor TABLE_OBJ_DESCRIPTOR = buildImageDescriptor("objects/table_obj.gif");
+
+ public static Image getColumnImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, COLUMN_DESCRIPTOR);
+ }
+ private static final ImageDescriptor COLUMN_DESCRIPTOR = buildImageDescriptor("objects/column.gif");
+
+ public static Image getKeyColumnImage(ResourceManager resourceManager) {
+ return getImage(resourceManager, KEY_COLUMN_DESCRIPTOR);
+ }
+ private static final ImageDescriptor KEY_COLUMN_DESCRIPTOR = buildImageDescriptor("objects/columnKey.gif");
+
+
+ private static ImageDescriptor buildImageDescriptor(String fileName) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(JptUiPlugin.PLUGIN_ID, "images/" + fileName);
+ }
+
+
+ private static Image getImage(ResourceManager resourceManager, ImageDescriptor descriptor) {
+ return resourceManager.createImage(descriptor);
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaHelpContextIds.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaHelpContextIds.java
new file mode 100644
index 0000000000..06318dda0f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaHelpContextIds.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0, which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal;
+
+import org.eclipse.jpt.ui.JptUiPlugin;
+
+/**
+ * Help context ids for the Dali JPA UI.
+ *
+ * This interface contains constants only; it is not intended to be
+ * implemented.
+ *
+ */
+@SuppressWarnings("nls")
+public interface JpaHelpContextIds {
+
+ //ContextID prefix
+ public static final String PREFIX = JptUiPlugin.PLUGIN_ID + ".";
+
+ //Persistent Type composites
+ public static final String ENTITY_ACCESS_TYPE = PREFIX + "entity_accessType";
+ public static final String ENTITY_ATTRIBUTE_OVERRIDES = PREFIX + "entity_attributeOverrides";
+ public static final String ENTITY_ATTRIBUTE_OVERRIDES_COLUMN = PREFIX + "entity_attributeOverridesColumn";
+ public static final String ENTITY_CATALOG = PREFIX + "entity_catalog";
+ public static final String ENTITY_INHERITANCE_STRATEGY = PREFIX + "entity_inheritanceStrategy";
+ public static final String ENTITY_INHERITANCE_DISCRIMINATOR_TYPE = PREFIX + "entity_inheritanceDiscriminatorType";
+ public static final String ENTITY_INHERITANCE_DISCRIMINATOR_COLUMN = PREFIX + "entity_inheritanceDiscriminatorColumn";
+ public static final String ENTITY_INHERITANCE_DISCRIMINATOR_VALUE = PREFIX + "entity_inheritanceDiscriminatorValue";
+ public static final String ENTITY_NAME = PREFIX + "entity_name";
+ public static final String ENTITY_ORM_PACKAGE = PREFIX + "orm_package";
+ public static final String ENTITY_ORM_SCHEMA = PREFIX + "orm_schema";
+ public static final String ENTITY_ORM_CATALOG = PREFIX + "orm_catalog";
+ public static final String ENTITY_ORM_ACCESS = PREFIX + "orm_access";
+ public static final String ENTITY_ORM_DELIMITED_IDENTIFIERS = PREFIX + "orm_delimited_identifiers";
+ public static final String ENTITY_ORM_CASCADE = PREFIX + "orm_cascade";
+ public static final String ENTITY_ORM_XML = PREFIX + "orm_xml";
+ public static final String ENTITY_SCHEMA = PREFIX + "entity_schema";
+ public static final String ENTITY_TABLE = PREFIX + "entity_table";
+ public static final String ENTITY_CACHEABLE = PREFIX + "entity_cacheable";
+
+ //Persistent Attribute composites
+ public static final String MAPPING_CASCADE_TYPE = PREFIX + "mapping_cascadeType";
+ public static final String MAPPING_COLUMN = PREFIX + "mapping_column";
+ public static final String MAPPING_COLUMN_INSERTABLE = PREFIX + "mapping_columnInsertable";
+ public static final String MAPPING_COLUMN_LENGTH = PREFIX + "mapping_columnLength";
+ public static final String MAPPING_COLUMN_NULLABLE = PREFIX + "mapping_columnNullable";
+ public static final String MAPPING_COLUMN_PRECISION = PREFIX + "mapping_columnPrecision";
+ public static final String MAPPING_COLUMN_SCALE = PREFIX + "mapping_columnScale";
+ public static final String MAPPING_COLUMN_TABLE = PREFIX + "mapping_columnTable";
+ public static final String MAPPING_COLUMN_UNIQUE = PREFIX + "mapping_columnUnique";
+ public static final String MAPPING_COLUMN_UPDATABLE= PREFIX + "mapping_columnUpdatable";
+ public static final String MAPPING_EMBEDDED_ATTRIBUTE_OVERRIDES = PREFIX + "mapping_embeddedAttributeOverrides";
+ public static final String MAPPING_EMBEDDED_ATTRIBUTE_OVERRIDES_COLUMN = PREFIX + "mapping_embeddedAttributeOverridesColumn";
+ public static final String MAPPING_ENUMERATED = PREFIX + "mapping_enumerated";
+ public static final String MAPPING_FETCH_TYPE = PREFIX + "mapping_fetchType";
+ public static final String MAPPING_GENERATED_VALUE_STRATEGY = PREFIX + "mapping_generatedValueStrategy";
+ public static final String MAPPING_GENERATED_VALUE_GENERATOR_NAME = PREFIX + "mapping_generatedValueGeneratorName";
+ public static final String MAPPING_JOIN_COLUMN_NAME = PREFIX + "mapping_joinColumnName";
+ public static final String MAPPING_JOIN_REFERENCED_COLUMN = PREFIX + "mapping_joinReferencedColumn";
+ public static final String MAPPING_JOIN_TABLE_NAME = PREFIX + "mapping_joinTableName";
+ public static final String MAPPING_JOIN_TABLE_SCHEMA = PREFIX + "mapping_joinTableSchema";
+ public static final String MAPPING_JOIN_TABLE_CATALOG = PREFIX + "mapping_joinTableCatalog";
+ public static final String MAPPING_JOIN_TABLE_COLUMNS = PREFIX + "mapping_joinTableJoinColumns";
+ public static final String MAPPING_JOIN_TABLE_INVERSE_JOIN_COLUMNS = PREFIX + "mapping_joinTableInverseJoinColumns";
+ public static final String MAPPING_LOB = PREFIX + "mapping_lob";
+ public static final String MAPPING_MAP_AS = PREFIX + "mapping_mapAs";
+ public static final String MAPPING_MAPPED_BY = PREFIX + "mapping_mappedBy";
+ public static final String MAPPING_NAMED_NATIVE_QUERIES = "named_native_queries";
+ public static final String MAPPING_NAMED_QUERIES = PREFIX + "named_queries";
+ public static final String MAPPING_OPTIONAL = PREFIX + "mapping_optional";
+ public static final String MAPPING_ORDER_BY = PREFIX + "mapping_orderBy";
+ public static final String MAPPING_ORDER_BY_NO_ORDERING = PREFIX + "mapping_orderByNoOrdering";
+ public static final String MAPPING_ORDER_BY_PRIMARY_KEY_ORDERING = PREFIX + "mapping_orderByPrimaryKeyOrdering";
+ public static final String MAPPING_ORDER_BY_CUSTOM_ORDERING = PREFIX + "mapping_orderByCustomOrdering";
+ public static final String MAPPING_ORDER_COLUMN_ORDERING = PREFIX + "mapping_orderColumnOrdering";
+ public static final String MAPPING_ORDER_COLUMN_ORDERING_COLUMN = PREFIX + "mapping_orderColumnOrderingColumn";
+ public static final String MAPPING_PRIMARY_KEY_GENERATION = PREFIX + "mapping_primaryKeyGeneration";
+ public static final String MAPPING_SEQUENCE_GENERATOR = PREFIX + "mapping_sequenceGenerator";
+ public static final String MAPPING_SEQUENCE_GENERATOR_NAME = PREFIX + "mapping_sequenceGeneratorName";
+ public static final String MAPPING_SEQUENCE_GENERATOR_SEQUENCE = PREFIX + "mapping_sequenceGeneratorSequence";
+ public static final String MAPPING_TABLE_GENERATOR = PREFIX + "mapping_tableGenerator";
+ public static final String MAPPING_TABLE_GENERATOR_CATALOG = PREFIX + "mapping_tableGeneratorCatalog";
+ public static final String MAPPING_TABLE_GENERATOR_NAME = PREFIX + "mapping_tableGeneratorName";
+ public static final String MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN = PREFIX + "mapping_tableGeneratorPrimaryKeyColumn";
+ public static final String MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN_VALUE = PREFIX + "mapping_tableGeneratorPrimaryKeyColumnValue";
+ public static final String MAPPING_TABLE_GENERATOR_SCHEMA = PREFIX + "mapping_tableGeneratorSchema";
+ public static final String MAPPING_TABLE_GENERATOR_TABLE= PREFIX + "mapping_tableGeneratorTable";
+ public static final String MAPPING_TABLE_GENERATOR_VALUE_COLUMN = PREFIX + "mapping_tableGeneratorValueColumn";
+ public static final String MAPPING_TARGET_ENTITY = PREFIX + "mapping_targetEntity";
+ public static final String MAPPING_TEMPORAL = PREFIX + "mapping_temporal";
+
+ //Project properties
+ public static final String PROPERTIES_JAVA_PERSISTENCE = PREFIX + "properties_javaPersistence";
+ public static final String PROPERTIES_JAVA_PERSISTENCE_CONNECTION = PREFIX + "properties_javaPersistenceConnection";
+ public static final String PROPERTIES_JAVA_PERSISTENCE_SCHEMA = PREFIX + "properties_javaPersistenceSchema";
+ public static final String PROPERTIES_JAVA_PERSISTENCE_METAMODEL = PREFIX + "properties_canonicalMetamodel";
+
+ //Dialogs, Wizards
+ public static final String DIALOG_CREATE_ORM = PREFIX + "dialog_createORM";
+ public static final String DIALOG_EDIT_INVERSE_JOIN_COLUNN = PREFIX + "dialog_editInverseJoinColumn";
+ public static final String DIALOG_GENERATE_ENTITIES = PREFIX + "dialog_generateEntities";
+ public static final String DIALOG_GENERATE_ENTITIES_SOURCE = PREFIX + "dialog_generateEntities_source";
+ public static final String DIALOG_GENERATE_ENTITIES_PACKAGE = PREFIX + "dialog_generateEntities_package";
+ public static final String DIALOG_GENERATE_ENTITIES_TABLES = PREFIX + "dialog_generateEntities_tables";
+ public static final String DIALOG_JPA_FACET = PREFIX + "dialog_JPAFacet";
+ public static final String DIALOG_JPA_PLATFORM = PREFIX + "dialog_JPAPlatform";
+
+ //New JPA Project wizard:
+ public static final String NEW_JPA_PROJECT = PREFIX + "dialog_newJPAProject";
+ public static final String NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH = PREFIX + "dialog_addJavaPersistence_classpath";
+ public static final String NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE = PREFIX + "dialog_addJavaPersistence_database";
+ public static final String NEW_JPA_PROJECT_CONTENT_PAGE_PACKAGING = PREFIX + "dialog_addJavaPersistence_packaging";
+ public static final String NEW_JPA_PROJECT_CREATION_PAGE = PREFIX + "dialog_addJavaPersistence";
+ public static final String NEW_JPA_PROJECT_JPA_FACET = PREFIX + "dialog_newJPAProjectFacet";
+
+ //Other
+ public static final String PERSISTENCE_OUTLINE = PREFIX + "persistenceOutline";
+
+ //Persistence Xml Editor
+ public static final String PERSISTENCE_XML_CONNECTION = PREFIX + "persistence_connection";
+ public static final String PERSISTENCE_XML_GENERAL = PREFIX + "persistence_general";
+ public static final String PERSISTENCE_XML_PROPERTIES = PREFIX + "persistence_properties";
+ public static final String PERSISTENCE_XML_SOURCE = PREFIX + "persistence_source";
+
+ //New JPA Entity wizard
+ public static final String NEW_JPA_ENTITY_ENTITY_CLASS = PREFIX + "dialog_entityClassPage";
+ public static final String NEW_JPA_ENTITY_ENTITY_PROPERTIES = PREFIX + "dialog_entityPropertiesPage";
+
+ //Generate Entities Wizard
+ public static final String GENERATE_ENTITIES_WIZARD_ASSOCIATION_CARDINALITY = PREFIX + "dialog_associationCardinalityPage";
+ public static final String GENERATE_ENTITIES_WIZARD_ASSOCIATION_TABLES = PREFIX + "dialog_associationTablesPage";
+ public static final String GENERATE_ENTITIES_WIZARD_CUSTOMIZE_DEFAULT_ENTITY_GENERATION = PREFIX + "dialog_customizeDefaultEntityGeneration";
+ public static final String GENERATE_ENTITIES_WIZARD_CUSTOMIZE_INDIVIDUAL_ENTITIES = PREFIX + "dialog_customizeIndividualEntities";
+ public static final String GENERATE_ENTITIES_WIZARD_JOIN_COLUMNS = PREFIX + "dialog_joinColumnsPage";
+ public static final String GENERATE_ENTITIES_WIZARD_SELECT_CASCADE = PREFIX + "dialog_selectCascade";
+ public static final String GENERATE_ENTITIES_WIZARD_SELECT_TABLES = PREFIX + "dialog_selectTablesPage";
+ public static final String GENERATE_ENTITIES_WIZARD_TABLE_ASSOCIATIONS = PREFIX + "dialog_tableAssociationsPage";
+
+ public static final String MAPPING_COLLECTION_TABLE_NAME = PREFIX + "mapping_collectionTableName";
+ public static final String MAPPING_COLLECTION_TABLE_SCHEMA = PREFIX + "mapping_collectionTableSchema";
+ public static final String MAPPING_COLLECTION_TABLE_CATALOG = PREFIX + "mapping_collectionTableCatalog";
+
+ public static final String MAPPING_ELEMENT_COLLECTION_TARGET_CLASS = PREFIX + "mapping_elementCollectionTargetClass";
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaJavaCompletionProposalComputer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaJavaCompletionProposalComputer.java
new file mode 100644
index 0000000000..70357675df
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaJavaCompletionProposalComputer.java
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.CompletionContext;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer;
+import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jpt.core.JpaFile;
+import org.eclipse.jpt.core.JpaStructureNode;
+import org.eclipse.jpt.core.JptCorePlugin;
+import org.eclipse.jpt.core.context.java.JavaPersistentType;
+import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
+import org.eclipse.jpt.utility.Filter;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+import org.eclipse.jpt.utility.internal.StringTools;
+
+/**
+ * JPA Java code-completion proposal computer
+ */
+public class JpaJavaCompletionProposalComputer implements IJavaCompletionProposalComputer {
+
+ public JpaJavaCompletionProposalComputer() {
+ super();
+ }
+
+ public void sessionStarted() {
+ // do nothing
+ }
+
+ @SuppressWarnings("unchecked")
+ public List computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) {
+ return (context instanceof JavaContentAssistInvocationContext) ?
+ this.computeCompletionProposals((JavaContentAssistInvocationContext) context)
+ :
+ Collections.emptyList();
+ }
+
+ /**
+ * We fail silently here because (it seems) expected exceptions occur
+ * more frequently than intermittent unexpected exceptions that might
+ * merit investigation (and a logged stacktrace might be the only hint as
+ * to what happened).
+ *
+ * We will get an expected exception (typically a {@link NullPointerException NPE})
+ * here if the user:
+ *
modifies the Java source file in a way that puts it drastically out
+ * of sync with the Dali context model (e.g. deleting a field or
+ * annotation)
+ *
+ * The AST we build here will be based on the just-modified Java source; but,
+ * since the user moved quickly and we will not have yet received any Java
+ * change notification (since we only get a Java change notification when
+ * the user has paused typing for at least 0.5 seconds), the context model
+ * will still be based on the unmodified Java source. As the new AST is
+ * passed down through the context model to the resource model all the code
+ * expects to find the AST in sync with the model. When this is not the
+ * case (e.g. a field in the resource model is no longer present in the AST
+ * because the user has deleted it or modified the code in such a way that
+ * the parser can no longer detect the field) the model will probably choke
+ * when it cannot find the corresponding AST node.
+ *
+ * It seems reasonable, in these situations, to simply return no completion
+ * proposals. If the user simply waits a moment and tries again, we will be
+ * able to successfully calculate some proposals.
+ *
+ * ~bjv
+ */
+ private List computeCompletionProposals(JavaContentAssistInvocationContext context) {
+ try {
+ return this.computeCompletionProposals_(context);
+ } catch (Exception ex) {
+ // JptCorePlugin.log(ex); // don't log "expected" exceptions (?)
+ return Collections.emptyList();
+ }
+ }
+
+ private List computeCompletionProposals_(JavaContentAssistInvocationContext context) {
+ ICompilationUnit cu = context.getCompilationUnit();
+ if (cu == null) {
+ return Collections.emptyList();
+ }
+
+ IFile file = this.getCorrespondingResource(cu);
+ if (file == null) {
+ return Collections.emptyList();
+ }
+
+ JpaFile jpaFile = JptCorePlugin.getJpaFile(file);
+ if (jpaFile == null) {
+ return Collections.emptyList();
+ }
+
+ Collection rootStructureNodes = CollectionTools.collection(jpaFile.rootStructureNodes());
+ if (rootStructureNodes.isEmpty()) {
+ return Collections.emptyList();
+ }
+
+ CompletionContext cc = context.getCoreContext();
+
+ // the context's "token" is really a sort of "prefix" - it does NOT
+ // correspond to the "start" and "end" we get below...
+ char[] prefix = cc.getToken();
+ Filter filter = ((prefix == null) ? Filter.Null.instance() : new IgnoreCasePrefixFilter(prefix));
+ // the token "start" is the offset of the token's first character
+ int tokenStart = cc.getTokenStart();
+ // the token "end" is the offset of the token's last character (yuk)
+ int tokenEnd = cc.getTokenEnd();
+ if (tokenStart == -1) { // not sure why this happens - see bug 242286
+ return Collections.emptyList();
+ }
+
+// System.out.println("prefix: " + ((prefix == null) ? "[null]" : new String(prefix)));
+// System.out.println("token start: " + tokenStart);
+// System.out.println("token end: " + tokenEnd);
+// String source = cu.getSource();
+// String token = source.substring(Math.max(0, tokenStart), Math.min(source.length(), tokenEnd + 1));
+// System.out.println("token: =>" + token + "<=");
+// String snippet = source.substring(Math.max(0, tokenStart - 20), Math.min(source.length(), tokenEnd + 21));
+// System.out.println("surrounding snippet: =>" + snippet + "<=");
+
+ // TODO move this parser call into the model...
+ CompilationUnit astRoot = ASTTools.buildASTRoot(cu);
+ List proposals = new ArrayList();
+ for (JpaStructureNode structureNode : rootStructureNodes) {
+ for (Iterator stream = ((JavaPersistentType) structureNode).javaCompletionProposals(context.getInvocationOffset(), filter, astRoot); stream.hasNext(); ) {
+ String s = stream.next();
+ proposals.add(new CompletionProposal(s, tokenStart, tokenEnd - tokenStart + 1, s.length()));
+ }
+ }
+ return proposals;
+ }
+
+ private IFile getCorrespondingResource(ICompilationUnit cu) {
+ try {
+ return (IFile) cu.getCorrespondingResource();
+ } catch (JavaModelException ex) {
+ JptCorePlugin.log(ex);
+ return null;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public List computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) {
+ return Collections.emptyList();
+ }
+
+ public String getErrorMessage() {
+ return null;
+ }
+
+ public void sessionEnded() {
+ // do nothing
+ }
+
+ private static class IgnoreCasePrefixFilter implements Filter {
+ private final char[] prefix;
+ IgnoreCasePrefixFilter(char[] prefix) {
+ super();
+ this.prefix = prefix;
+ }
+ public boolean accept(String s) {
+ return StringTools.stringStartsWithIgnoreCase(s.toCharArray(), this.prefix);
+ }
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaMappingImageHelper.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaMappingImageHelper.java
new file mode 100644
index 0000000000..e96c6dba41
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaMappingImageHelper.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 Oracle.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.ui.internal;
+
+import org.eclipse.jpt.core.MappingKeys;
+import org.eclipse.jpt.core.jpa2.MappingKeys2_0;
+import org.eclipse.jpt.ui.JptUiPlugin;
+import org.eclipse.swt.graphics.Image;
+
+public class JpaMappingImageHelper
+{
+
+ public static Image imageForTypeMapping(String mappingKey) {
+ return JptUiPlugin.getImage(iconKeyForTypeMapping(mappingKey));
+ }
+
+ public static String iconKeyForTypeMapping(String mappingKey) {
+ if (MappingKeys.NULL_TYPE_MAPPING_KEY == mappingKey) {
+ return JptUiIcons.NULL_TYPE_MAPPING;
+ }
+ else if (MappingKeys.ENTITY_TYPE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.ENTITY;
+ }
+ else if (MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.EMBEDDABLE;
+ }
+ else if (MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.MAPPED_SUPERCLASS;
+ }
+ return null;
+ }
+
+ public static Image imageForAttributeMapping(String mappingKey) {
+ return JptUiPlugin.getImage(iconKeyForAttributeMapping(mappingKey));
+ }
+
+ public static String iconKeyForAttributeMapping(String mappingKey) {
+ if (MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY == mappingKey) {
+ return JptUiIcons.NULL_ATTRIBUTE_MAPPING;
+ }
+ else if (MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.BASIC;
+ }
+ else if (MappingKeys.ID_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.ID;
+ }
+ else if (MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.VERSION;
+ }
+ else if (MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.EMBEDDED_ID;
+ }
+ else if (MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.EMBEDDED;
+ }
+ else if (MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.ONE_TO_ONE;
+ }
+ else if (MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.ONE_TO_MANY;
+ }
+ else if (MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.MANY_TO_ONE;
+ }
+ else if (MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.MANY_TO_MANY;
+ }
+ else if (MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.ELEMENT_COLLECTION;
+ }
+ else if (MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptUiIcons.TRANSIENT;
+ }
+ //return the JPA_CONTENT icon instead of null, might as well have an icon if one is not defined
+ return JptUiIcons.JPA_CONTENT;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiIcons.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiIcons.java
new file mode 100644
index 0000000000..4cbea01c12
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiIcons.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Oracle.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.ui.internal;
+
+import org.eclipse.draw2d.ImageUtilities;
+import org.eclipse.jpt.ui.JptUiPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+
+@SuppressWarnings("nls")
+public class JptUiIcons
+{
+ /**
+ * Creates and returns a new SWT image that is a grayed out version of the image
+ * corresponding to the passed in key. Stores this gray image in the JptUiPlugin
+ * ImageRegistry with -gray appended to the key.
+ * Clients of this method should not dispose of the image.
+ *
+ * @return a new grayed out image
+ */
+ public static Image ghost(String key) {
+ Image existingImage = JptUiPlugin.instance().getImageRegistry().get(key + "-gray");
+ if (existingImage != null) {
+ return existingImage;
+ }
+
+ Image grayImage = buildGhostImage(key);
+ JptUiPlugin.instance().getImageRegistry().put(key + "-gray", grayImage);
+ return grayImage;
+ }
+
+ private static Image buildGhostImage(String key) {
+ Image originalImage = JptUiPlugin.getImage(key);
+ Color lightGray = new Color(originalImage.getDevice(), 223, 223, 223);
+ ImageData imageData = ImageUtilities.createShadedImage(originalImage, lightGray);
+
+ Image shadedImage = new Image(originalImage.getDevice(), imageData);
+ Image grayImage = new Image(originalImage.getDevice(), shadedImage, SWT.IMAGE_GRAY);
+
+ lightGray.dispose();
+ shadedImage.dispose();
+ return grayImage;
+ }
+
+
+ // **************** General JPA icons **************************************
+
+ public static final String JPA_CONTENT = "full/obj16/jpa-content";
+
+ public static final String JPA_FILE = "full/obj16/jpa-file";
+
+ public static final String JAR_FILE = "full/obj16/jpa-jar-file";
+
+ public static final String WARNING = "full/obj16/warning";
+
+
+ // **************** Wizard icons *******************************************
+
+ public static final String JPA_WIZ_BANNER = "full/wizban/jpa_facet_wizban";
+
+ public static final String ENTITY_WIZ_BANNER = "full/wizban/new_entity_wizban";
+
+ public static final String JPA_FILE_WIZ_BANNER = "full/wizban/new_jpa_file_wizban";
+
+
+ // **************** Persistence icons **************************************
+
+ public static final String PERSISTENCE = "full/obj16/persistence";
+
+ public static final String PERSISTENCE_UNIT = "full/obj16/persistence-unit";
+
+ public static final String MAPPING_FILE_REF = "full/obj16/jpa-file";
+
+ public static final String CLASS_REF = "full/obj16/null-type-mapping";
+
+ public static final String JAR_FILE_REF = "full/obj16/jpa-jar-file";
+
+
+ // **************** Orm icons **********************************************
+
+ public static final String ENTITY_MAPPINGS = "full/obj16/entity-mappings";
+
+
+ // **************** Orm/Java common icons **********************************
+
+ public static final String ENTITY = "full/obj16/entity";
+
+ public static final String EMBEDDABLE = "full/obj16/embeddable";
+
+ public static final String MAPPED_SUPERCLASS = "full/obj16/mapped-superclass";
+
+ public static final String NULL_TYPE_MAPPING = "full/obj16/null-type-mapping";
+
+ public static final String ID = "full/obj16/id";
+
+ public static final String EMBEDDED_ID = "full/obj16/embedded-id";
+
+ public static final String BASIC = "full/obj16/basic";
+
+ public static final String VERSION = "full/obj16/version";
+
+ public static final String MANY_TO_ONE = "full/obj16/many-to-one";
+
+ public static final String ONE_TO_MANY = "full/obj16/one-to-many";
+
+ public static final String ONE_TO_ONE = "full/obj16/one-to-one";
+
+ public static final String MANY_TO_MANY = "full/obj16/many-to-many";
+
+ public static final String ELEMENT_COLLECTION = "full/obj16/element-collection";
+
+ public static final String EMBEDDED = "full/obj16/embedded";
+
+ public static final String TRANSIENT = "full/obj16/transient";
+
+ public static final String NULL_ATTRIBUTE_MAPPING = "full/obj16/null-attribute-mapping";
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java
new file mode 100644
index 0000000000..2d7c45f46a
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Localized messages used by Dali UI.
+ *
+ * @version 2.3
+ * @since 1.0
+ */
+public class JptUiMessages {
+
+ public static String ChooserPane_browseButton;
+ public static String AccessTypeComposite_access;
+ public static String AccessTypeComposite_field;
+ public static String AccessTypeComposite_property;
+ public static String AddPersistentAttributeDialog_attributeLabel;
+ public static String AddPersistentAttributeDialog_mappingLabel;
+ public static String AddPersistentAttributeDialog_noMappingKeyError;
+ public static String AddPersistentAttributeDialog_title;
+ public static String AddPersistentClassDialog_classDialog_message;
+ public static String AddPersistentClassDialog_classDialog_title;
+ public static String AddPersistentClassDialog_classLabel;
+ public static String AddPersistentClassDialog_classNotFoundWarning;
+ public static String AddPersistentClassDialog_duplicateClassWarning;
+ public static String AddPersistentClassDialog_mappingLabel;
+ public static String AddPersistentClassDialog_noClassError;
+ public static String AddPersistentClassDialog_noMappingKeyError;
+ public static String AddPersistentClassDialog_title;
+ public static String AddRemovePane_AddButtonText;
+ public static String AddRemovePane_RemoveButtonText;
+ public static String ClassChooserPane_dialogMessage;
+ public static String ClassChooserPane_dialogTitle;
+ public static String DatabaseSchemaWizardPage_title;
+ public static String DatabaseSchemaWizardPage_desc;
+ public static String DatabaseSchemaWizardPage_schemaSettings;
+ public static String DatabaseSchemaWizardPage_addConnectionToProject;
+ public static String DatabaseSchemaWizardPage_connectLink;
+ public static String DatabaseSchemaWizardPage_schema;
+ public static String DatabaseSchemaWizardPage_connectionInfo;
+ public static String DatabaseSchemaWizardPage_schemaInfo;
+ public static String EnumComboViewer_default;
+ public static String EnumComboViewer_defaultWithDefault;
+ public static String Error_openingEditor;
+ public static String General_browse;
+ public static String General_revert;
+ public static String General_deselectAll;
+ public static String General_selectAll;
+ public static String GenerateDDLWizard_title;
+ public static String GenerateEntitiesWizard_generateEntities;
+ public static String GenerateEntitiesWizardPage_chooseEntityTable;
+ public static String GenerateEntitiesWizardPage_entityNameColumn;
+ public static String GenerateEntitiesWizardPage_generateEntities;
+ public static String GenerateEntitiesWizardPage_synchronizeClasses;
+ public static String GenerateEntitiesWizardPage_tableColumn;
+ public static String GenerateEntitiesWizardPage_tables;
+ public static String GenericPlatformUiDialog_notSupportedMessageText;
+ public static String GenericPlatformUiDialog_notSupportedMessageTitle;
+ public static String JpaContent_label;
+ public static String JpaDetailsView_viewNotAvailable;
+ public static String JpaFacetWizardPage_addDriverLibraryLabel;
+ public static String JpaFacetWizardPage_connectionLabel;
+ public static String JpaFacetWizardPage_connectionLink;
+ public static String JpaFacetWizardPage_connectLink;
+ public static String JpaFacetWizardPage_createOrmXmlButton;
+ public static String JpaFacetWizardPage_defaultCatalogLabel;
+ public static String JpaFacetWizardPage_defaultSchemaLabel;
+ public static String JpaFacetWizardPage_description;
+ public static String JpaFacetWizardPage_discoverClassesButton;
+ public static String JpaFacetWizardPage_driverLibraryLabel;
+ public static String JpaFacetWizardPage_metamodelSourceFolderLink;
+ public static String JpaFacetWizardPage_jpaImplementationLabel;
+ public static String JpaFacetWizardPage_jpaPrefsLink;
+ public static String JpaFacetWizardPage_listClassesButton;
+ public static String JpaFacetWizardPage_metamodelLabel;
+ public static String JpaFacetWizardPage_none;
+ public static String JpaFacetWizardPage_overrideDefaultCatalogLabel;
+ public static String JpaFacetWizardPage_overrideDefaultSchemaLabel;
+ public static String JpaFacetWizardPage_persistentClassManagementLabel;
+ public static String JpaFacetWizardPage_platformLabel;
+ public static String JpaFacetWizardPage_specifyLibLabel;
+ public static String JpaFacetWizardPage_title;
+ public static String JpaFacetWizardPage_userLibsLink;
+ public static String JpaFacetWizardPage_userServerLibLabel;
+ public static String JpaStructureView_linkWithEditorDesc;
+ public static String JpaStructureView_linkWithEditorText;
+ public static String JpaStructureView_linkWithEditorTooltip;
+ public static String JpaStructureView_structureNotAvailable;
+ public static String JpaStructureView_numItemsSelected;
+ public static String MappingFileWizard_title;
+ public static String MappingFileWizardPage_title;
+ public static String MappingFileWizardPage_desc;
+ public static String MappingFileWizardPage_projectLabel;
+ public static String MappingFileWizardPage_sourceFolderLabel;
+ public static String MappingFileWizardPage_filePathLabel;
+ public static String MappingFileWizardPage_accessLabel;
+ public static String MappingFileWizardPage_addToPersistenceUnitButton;
+ public static String MappingFileWizardPage_persistenceUnitLabel;
+ public static String MappingFileWizardPage_incorrectSourceFolderError;
+ public static String MappingFileWizardPage_accessLabel_sourceFolderDialogTitle;
+ public static String MappingFileWizardPage_accessLabel_sourceFolderDialogDesc;
+ public static String NewJpaProjectWizard_firstPage_description;
+ public static String NewJpaProjectWizard_firstPage_title;
+ public static String NewJpaProjectWizard_title;
+ public static String OrmItemLabelProviderFactory_entityMappingsLabel;
+ public static String OverwriteConfirmerDialog_text;
+ public static String OverwriteConfirmerDialog_title;
+ public static String PackageChooserPane_dialogMessage;
+ public static String PackageChooserPane_dialogTitle;
+ public static String PersistenceItemLabelProviderFactory_persistenceLabel;
+ public static String EntitiesGenerator_jobName;
+ public static String JpaPreferencesPage_Description;
+ public static String JpaProblemSeveritiesPage_Description;
+ public static String JpaProblemSeveritiesPage_Error;
+ public static String JpaProblemSeveritiesPage_Ignore;
+ public static String JpaProblemSeveritiesPage_Info;
+ public static String JpaProblemSeveritiesPage_Warning;
+
+ private static final String BUNDLE_NAME = "jpt_ui"; //$NON-NLS-1$
+ private static final Class> BUNDLE_CLASS = JptUiMessages.class;
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
+ }
+
+ private JptUiMessages() {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiValidationPreferenceMessages.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiValidationPreferenceMessages.java
new file mode 100644
index 0000000000..4a3fb3bad4
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiValidationPreferenceMessages.java
@@ -0,0 +1,192 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+public class JptUiValidationPreferenceMessages {
+
+ public static String PROJECT_LEVEL_CATEGORY;
+ public static String NO_JPA_PROJECT;
+ public static String PROJECT_NO_CONNECTION;
+ public static String PROJECT_INVALID_CONNECTION;
+ public static String PROJECT_INACTIVE_CONNECTION;
+ public static String PROJECT_NO_PERSISTENCE_XML;
+
+ public static String XML_VERSION_NOT_LATEST;
+
+ public static String PROJECT_MULTIPLE_PERSISTENCE_XML;
+ public static String PERSISTENCE_NO_PERSISTENCE_UNIT;
+ public static String PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS;
+ public static String PERSISTENCE_XML_INVALID_CONTENT;
+
+ public static String PERSISTENCE_UNIT_LEVEL_CATEGORY;
+ public static String PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE;
+ public static String PERSISTENCE_UNIT_UNSUPPORTED_MAPPING_FILE_CONTENT;
+ public static String PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE;
+ public static String PERSISTENCE_UNIT_INVALID_MAPPING_FILE;
+ public static String PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE;
+ public static String PERSISTENCE_UNIT_UNSPECIFIED_CLASS;
+ public static String PERSISTENCE_UNIT_NONEXISTENT_CLASS;
+ public static String PERSISTENCE_UNIT_INVALID_CLASS;
+ public static String PERSISTENCE_UNIT_DUPLICATE_CLASS;
+ public static String PERSISTENCE_UNIT_REDUNDANT_CLASS;
+ public static String PERSISTENCE_UNIT_DUPLICATE_JAR_FILE;
+ public static String PERSISTENCE_UNIT_UNSPECIFIED_JAR_FILE;
+ public static String PERSISTENCE_UNIT_JAR_FILE_DEPLOYMENT_PATH_WARNING;
+ public static String PERSISTENCE_UNIT_NONEXISTENT_JAR_FILE;
+ public static String MAPPING_FILE_EXTRANEOUS_PERSISTENCE_UNIT_DEFAULTS;
+ public static String PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT;
+ public static String PERSISTENT_TYPE_ANNOTATED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT;
+ public static String PERSISTENT_TYPE_UNSPECIFIED_CLASS;
+ public static String PERSISTENT_TYPE_UNRESOLVED_CLASS;
+
+ public static String TYPE_LEVEL_CATEGORY;
+ public static String ENTITY_NO_PK;
+ public static String ENTITY_SINGLE_TABLE_DESCENDANT_DEFINES_TABLE;
+ public static String ENTITY_ABSTRACT_TABLE_PER_CLASS_DEFINES_TABLE;
+ public static String ENTITY_ABSTRACT_DISCRIMINATOR_VALUE_DEFINED;
+ public static String ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_VALUE_DEFINED;
+ public static String ENTITY_NON_ROOT_DISCRIMINATOR_COLUMN_DEFINED;
+ public static String ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_COLUMN_DEFINED;
+ public static String PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME;
+ public static String PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME;
+ public static String PERSISTENT_ATTRIBUTE_INHERITED_ATTRIBUTES_NOT_SUPPORTED;
+ public static String PERSISTENT_ATTRIBUTE_INVALID_MAPPING;
+ public static String PERSISTENT_ATTRIBUTE_FINAL_FIELD;
+ public static String PERSISTENT_ATTRIBUTE_PUBLIC_FIELD;
+
+ public static String ATTRIBUTE_LEVEL_CATEGORY;
+ public static String MAPPING_UNRESOLVED_MAPPED_BY;
+ public static String MAPPING_INVALID_MAPPED_BY;
+ public static String MAPPING_MAPPED_BY_WITH_JOIN_TABLE;
+ public static String MAPPING_MAPPED_BY_ON_BOTH_SIDES;
+ public static String TARGET_ENTITY_NOT_DEFINED;
+ public static String TARGET_ENTITY_IS_NOT_AN_ENTITY;
+ public static String MAPS_ID_VALUE_NOT_SPECIFIED;
+ public static String MAPS_ID_VALUE_NOT_RESOLVED;
+ public static String MAPS_ID_VALUE_INVALID;
+ public static String ORDER_COLUMN_AND_ORDER_BY_BOTH_SPECIFIED;
+ public static String ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED;
+ public static String ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE;
+ public static String ELEMENT_COLLECTION_MAP_KEY_CLASS_NOT_DEFINED;
+
+ public static String DATABASE_CATEGORY;
+ public static String TABLE_CATEGORY;
+ public static String COLUMN_CATEGORY;
+ public static String OVERRIDES_CATEGORY;
+ public static String IMPLIED_ATTRIBUTE_LEVEL_CATEGORY;
+
+ public static String TABLE_UNRESOLVED_CATALOG;
+ public static String TABLE_UNRESOLVED_SCHEMA;
+ public static String TABLE_UNRESOLVED_NAME;
+ public static String SECONDARY_TABLE_UNRESOLVED_CATALOG;
+ public static String SECONDARY_TABLE_UNRESOLVED_SCHEMA;
+ public static String SECONDARY_TABLE_UNRESOLVED_NAME;
+ public static String JOIN_TABLE_UNRESOLVED_CATALOG;
+ public static String JOIN_TABLE_UNRESOLVED_SCHEMA;
+ public static String JOIN_TABLE_UNRESOLVED_NAME;
+ public static String COLUMN_TABLE_NOT_VALID;
+ public static String COLUMN_UNRESOLVED_TABLE;
+ public static String COLUMN_UNRESOLVED_NAME;
+ public static String JOIN_COLUMN_TABLE_NOT_VALID;
+ public static String JOIN_COLUMN_UNRESOLVED_NAME;
+ public static String JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
+ public static String JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String INVERSE_JOIN_COLUMN_TABLE_NOT_VALID;
+ public static String INVERSE_JOIN_COLUMN_UNRESOLVED_NAME;
+ public static String INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
+ public static String INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME;
+ public static String PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
+ public static String PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME;
+ public static String VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
+ public static String VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME;
+ public static String VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
+ public static String VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String MAP_KEY_COLUMN_TABLE_NOT_VALID;
+ public static String VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID;
+
+ public static String COLLECTION_TABLE_UNRESOLVED_CATALOG;
+ public static String COLLECTION_TABLE_UNRESOLVED_SCHEMA;
+ public static String COLLECTION_TABLE_UNRESOLVED_NAME;
+ public static String ORDER_COLUMN_UNRESOLVED_NAME;
+
+ public static String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_CATALOG;
+ public static String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA;
+ public static String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME;
+ public static String VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID;
+ public static String VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID;
+ public static String VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID;
+ public static String VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME;
+ public static String VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME;
+ public static String VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME;
+ public static String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE;
+ public static String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME;
+ public static String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
+ public static String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY;
+ public static String VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED;
+ public static String VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_CATALOG;
+ public static String VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_SCHEMA;
+ public static String VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_NAME;
+ public static String VIRTUAL_ATTRIBUTE_ORDER_COLUMN_UNRESOLVED_NAME;
+ public static String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED;
+ public static String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE;
+ public static String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_MAP_KEY_CLASS_NOT_DEFINED;
+ public static String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_TABLE_NOT_VALID;
+ public static String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID;
+ public static String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME;
+ public static String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
+ public static String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID;
+ public static String VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID;
+
+ public static String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME;
+ public static String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
+ public static String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID;
+ public static String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID;
+ public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME;
+ public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME;
+ public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+ public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
+
+ public static String INHERITANCE_CATEGORY;
+ public static String DISCRIMINATOR_COLUMN_UNRESOLVED_NAME;
+ public static String ENTITY_TABLE_PER_CLASS_NOT_SUPPORTED_ON_PLATFORM;
+ public static String ENTITY_TABLE_PER_CLASS_NOT_PORTABLE_ON_PLATFORM;
+
+ public static String QUERIES_GENERATORS_CATEGORY;
+ public static String GENERATOR_DUPLICATE_NAME;
+ public static String ID_MAPPING_UNRESOLVED_GENERATOR_NAME;
+ public static String GENERATED_VALUE_UNRESOLVED_GENERATOR;
+ public static String QUERY_DUPLICATE_NAME;
+
+ private static final String BUNDLE_NAME = "jpt_ui_validation_preferences"; //$NON-NLS-1$
+ private static final Class> BUNDLE_CLASS = JptUiValidationPreferenceMessages.class;
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
+ }
+
+ private JptUiValidationPreferenceMessages() {
+ throw new UnsupportedOperationException();
+ }
+
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/Tracing.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/Tracing.java
new file mode 100644
index 0000000000..d2620857f5
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/Tracing.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jpt.ui.JptUiPlugin;
+
+/**
+ * This tracing class manages to convert the string value into boolean values or
+ * integer values that are associated with the tracing debug flags. Those flags
+ * are specified in the .options file. The supported keys are defined here as
+ * constants for quick reference.
+ *
+ * @version 2.0
+ * @since 2.0
+ */
+@SuppressWarnings("nls")
+public final class Tracing
+{
+ /**
+ * A constant used to retrieve the value associated with "/debug".
+ */
+ public static final String DEBUG = "/debug";
+
+ /**
+ * A constant used to retrieve the value associated with "/debug/ui/db".
+ */
+ public static final String UI_DB = "/debug/ui/db";
+
+ /**
+ * A constant used to retrieve the value associated with "/debug/ui/detailsView".
+ */
+ public static final String UI_DETAILS_VIEW = "/debug/ui/detailsView";
+
+ /**
+ * A constant used to retrieve the value associated with "/debug/ui/layout".
+ */
+ public static final String UI_LAYOUT = "/debug/ui/layout";
+
+ /**
+ * A constant used to retrieve the value associated with "/unit-tests".
+ */
+ public static final String UNIT_TESTS = "/unit-tests";
+
+ /**
+ * Can't instantiate this Tracing class.
+ */
+ private Tracing()
+ {
+ super();
+ throw new UnsupportedOperationException("Tracing cannot be instantiated");
+ }
+
+ /**
+ * Retrieves the debug value associated with the given flag. The default
+ * value is false.
+ *
+ * @param flag The flag to retrieve the debug value, which should be
+ * contained in the .options file, the flag should start with "/"
+ * @return true if the given flag is active; false
+ * otherwise
+ */
+ public static boolean booleanDebugOption(String flag)
+ {
+ return booleanDebugOption(flag, false);
+ }
+
+ /**
+ * Retrieves the debug value associated with the given flag.
+ *
+ * @param flag The flag to retrieve the debug value, which should be
+ * contained in the .options file, the flag should start with "/"
+ * @param defaultValue The default value if the value associated with the
+ * given flag could not be found
+ * @return true if the given flag is active; false
+ * otherwise
+ */
+ public static boolean booleanDebugOption(String flag, boolean defaultValue)
+ {
+ String string = Platform.getDebugOption(JptUiPlugin.PLUGIN_ID + flag);
+ return (string == null) ? defaultValue : Boolean.parseBoolean(string.trim());
+ }
+
+ /**
+ * Retrieves the debug value associated with the given flag. The default value
+ * is 0.
+ *
+ * @param flag The flag to retrieve the debug value, which should be
+ * contained in the .options file, the flag should start with "/"
+ * @return The value associated with the given flag, or the given default
+ * value
+ */
+ public static int intDebugOption(String flag)
+ {
+ return intDebugOption(flag, 0);
+ }
+
+ /**
+ * Retrieves the debug value associated with the given flag.
+ *
+ * @param flag The flag to retrieve the debug value, which should be
+ * contained in the .options file, the flag should start with "/"
+ * @param defaultValue The default value if the value associated with the
+ * given flag could not be found
+ * @return The value associated with the given flag, or the given default
+ * value
+ */
+ public static int intDebugOption(String flag, int defaultValue)
+ {
+ String string = Platform.getDebugOption(JptUiPlugin.PLUGIN_ID + flag);
+ return (string == null) ? defaultValue : Integer.parseInt(string);
+ }
+
+ /**
+ * Logs the given messages, appends it with this plug-in id.
+ *
+ * @param message The message to be logged
+ */
+ public static void log(String message)
+ {
+ System.out.print("[" + JptUiPlugin.PLUGIN_ID + "] ");
+ System.out.println(message);
+ }
+
+ /**
+ * Retrieves the debug value associated with the given flag. The default value
+ * is an empty string.
+ *
+ * @param flag The flag to retrieve the debug value, which should be
+ * contained in the .options file, the flag should start with "/"
+ * @return The value associated with the given flag, or the given default
+ * value
+ */
+ public static String stringDebugOption(String flag)
+ {
+ return stringDebugOption(flag, "");
+ }
+
+ /**
+ * Retrieves the debug value associated with the given flag.
+ *
+ * @param flag The flag to retrieve the debug value, which should be
+ * contained in the .options file, the flag should start with "/"
+ * @param defaultValue The default value if the value associated with the
+ * given flag could not be found
+ * @return The value associated with the given flag, or the given default
+ * value
+ */
+ public static String stringDebugOption(String flag, String defaultValue)
+ {
+ String string = Platform.getDebugOption(JptUiPlugin.PLUGIN_ID + flag);
+ return (string != null) ? string : defaultValue;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateDDLAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateDDLAction.java
new file mode 100644
index 0000000000..b2e675fd52
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateDDLAction.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal.actions;
+
+import org.eclipse.jpt.core.JpaProject;
+
+/**
+ * GenerateDDLAction
+ */
+public class GenerateDDLAction extends ProjectAction {
+
+ public GenerateDDLAction() {
+ super();
+ }
+
+ @Override
+ protected void execute(JpaProject project) {
+ this.getJpaPlatformUi(project).generateDDL(project, this.getCurrentSelection());
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateEntitiesAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateEntitiesAction.java
new file mode 100644
index 0000000000..30d2de5787
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateEntitiesAction.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+* Copyright (c) 2007, 2009 Oracle. All rights reserved.
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License v1.0, which accompanies this distribution
+* and is available at http://www.eclipse.org/legal/epl-v10.html.
+*
+* Contributors:
+* Oracle - initial API and implementation
+*******************************************************************************/
+package org.eclipse.jpt.ui.internal.actions;
+
+import org.eclipse.jpt.core.JpaProject;
+
+/**
+ * GenerateEntitiesAction
+ */
+public class GenerateEntitiesAction extends ProjectAction {
+ public GenerateEntitiesAction() {
+ super();
+ }
+
+ @Override
+ protected void execute(JpaProject project) {
+ this.getJpaPlatformUi(project).generateEntities(project, this.getCurrentSelection());
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/MigrateJavaProjectAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/MigrateJavaProjectAction.java
new file mode 100644
index 0000000000..88c7ef401f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/MigrateJavaProjectAction.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle.
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.ui.internal.actions;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jpt.core.JptCorePlugin;
+import org.eclipse.jpt.ui.JptUiPlugin;
+import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
+import org.eclipse.jst.j2ee.project.facet.JavaProjectMigrationOperation;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard;
+
+public class MigrateJavaProjectAction implements IObjectActionDelegate
+{
+ private ISelection currentSelection;
+
+
+ public MigrateJavaProjectAction() {
+ super();
+ }
+
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ // do nothing
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.currentSelection = selection;
+ }
+
+ public void run(IAction action) {
+ // This action is currently enabled only for a singly selected, java,
+ // non-faceted IProject
+ IProject project = (IProject) ((IStructuredSelection) currentSelection).getFirstElement();
+ execute(project);
+ }
+
+ private void execute(IProject project) {
+ // add facets nature, java facet, and utility facet to project
+ JavaProjectMigrationOperation operation =
+ J2EEProjectUtilities.createFlexJavaProjectForProjectOperation(project, false);
+ operation.execute(null, null);
+
+ IFacetedProject facetedProject;
+ try {
+ // get the faceted project
+ facetedProject = ProjectFacetsManager.create(project);
+ }
+ catch (CoreException ce) {
+ JptUiPlugin.log(ce);
+ return;
+ }
+
+ // launch the UI with JPA facet preselected
+ final ModifyFacetedProjectWizard wizard = new ModifyFacetedProjectWizard(facetedProject);
+ IFacetedProjectWorkingCopy facetedProjectWorkingCopy = wizard.getFacetedProjectWorkingCopy();
+ IProjectFacetVersion jpa1_0 = ProjectFacetsManager.getProjectFacet(JptCorePlugin.FACET_ID).getDefaultVersion();
+ facetedProjectWorkingCopy.addProjectFacet(jpa1_0);
+
+ final WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+ dialog.open();
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/OpenJpaResourceAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/OpenJpaResourceAction.java
new file mode 100644
index 0000000000..bba8a40a8d
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/OpenJpaResourceAction.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Oracle.
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.ui.internal.actions;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jpt.core.JpaStructureNode;
+import org.eclipse.jpt.core.context.JpaContextNode;
+import org.eclipse.jpt.core.context.JpaRootContextNode;
+import org.eclipse.jpt.ui.internal.JptUiMessages;
+import org.eclipse.jpt.ui.internal.selection.DefaultJpaSelection;
+import org.eclipse.jpt.ui.internal.selection.JpaSelectionManager;
+import org.eclipse.jpt.ui.internal.selection.SelectionManagerFactory;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorRegistry;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.BaseSelectionListenerAction;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.part.FileEditorInput;
+
+public class OpenJpaResourceAction extends BaseSelectionListenerAction
+{
+ private JpaContextNode selectedNode;
+
+
+ public OpenJpaResourceAction() {
+ super("Open"); //$NON-NLS-1$
+ }
+
+
+ @Override
+ public boolean updateSelection(IStructuredSelection s) {
+ selectedNode = null;
+
+ if (! super.updateSelection(s)) {
+ return false;
+ }
+
+ if (s.size() != 1) {
+ return false;
+ }
+
+ if (s.getFirstElement() instanceof JpaRootContextNode) {
+ return false;
+ }
+
+ selectedNode = (JpaContextNode) s.getFirstElement();
+
+ return true;
+ }
+
+ @Override
+ public void run() {
+ if (! isEnabled()) {
+ return;
+ }
+
+ IResource resource = selectedNode.getResource();
+
+ if (resource != null && resource.exists() && resource.getType() == IResource.FILE) {
+ openEditor((IFile) resource);
+
+
+ if (selectedNode instanceof JpaStructureNode) {
+ JpaSelectionManager selectionManager =
+ SelectionManagerFactory.getSelectionManager(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ selectionManager.select(new DefaultJpaSelection((JpaStructureNode) selectedNode), null);
+ }
+ }
+ }
+
+ protected void openEditor(IFile file) {
+ IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
+ IContentType contentType = IDE.getContentType(file);
+ IEditorDescriptor editorDescriptor = registry.getDefaultEditor(file.getName(), contentType);
+ if (editorDescriptor == null) {
+ return; // no editor associated...
+ }
+
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+
+ try {
+ page.openEditor(new FileEditorInput(file), editorDescriptor.getId());
+ }
+ catch (Exception e) {
+ MessageDialog.openError(page.getWorkbenchWindow().getShell(), JptUiMessages.Error_openingEditor, e.getMessage());
+ }
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/ProjectAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/ProjectAction.java
new file mode 100644
index 0000000000..115c7e1dd4
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/ProjectAction.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal.actions;
+
+import java.util.Iterator;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jpt.core.JpaProject;
+import org.eclipse.jpt.core.JptCorePlugin;
+import org.eclipse.jpt.ui.JpaPlatformUi;
+import org.eclipse.jpt.ui.internal.platform.JpaPlatformUiRegistry;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * Override any of the #execute() methods.
+ */
+public abstract class ProjectAction implements IObjectActionDelegate {
+
+ private ISelection currentSelection;
+
+
+ public ProjectAction() {
+ super();
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ // do nothing
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.currentSelection = selection;
+ }
+
+ protected IStructuredSelection getCurrentSelection() {
+ if (this.currentSelection instanceof IStructuredSelection) {
+ return (IStructuredSelection) this.currentSelection;
+ }
+ return null;
+ }
+
+ public void run(IAction action) {
+ if (this.currentSelection instanceof IStructuredSelection) {
+ for (Iterator stream = ((IStructuredSelection) this.currentSelection).iterator(); stream.hasNext(); ) {
+ this.execute(stream.next());
+ }
+ }
+ }
+
+ protected void execute(Object selection) {
+ IProject project = this.projectFromSelection(selection);
+ if (project != null) {
+ this.execute(project);
+ }
+ }
+
+ protected IProject projectFromSelection(Object selection) {
+ if (selection instanceof IProject) {
+ return (IProject) selection;
+ }
+ if (selection instanceof IJavaProject) {
+ return ((IJavaProject) selection).getProject();
+ }
+ return null;
+ }
+
+ protected JpaPlatformUi getJpaPlatformUi(JpaProject project) {
+ String coreJpaPlatformId = project.getJpaPlatform().getId();
+ return JpaPlatformUiRegistry.instance().getJpaPlatformUi(coreJpaPlatformId);
+ }
+
+ protected void execute(IProject project) {
+ JpaProject jpaProject = JptCorePlugin.getJpaProject(project);
+ if (jpaProject == null) {
+ return;
+ }
+ this.execute(jpaProject);
+ }
+
+ protected void execute(JpaProject project) {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/SynchronizeClassesAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/SynchronizeClassesAction.java
new file mode 100644
index 0000000000..6e0a10ea3c
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/SynchronizeClassesAction.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 Oracle.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.ui.internal.actions;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jpt.core.context.persistence.PersistenceXml;
+import org.eclipse.jpt.core.internal.synch.SynchronizeClassesJob;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+public class SynchronizeClassesAction
+ implements IObjectActionDelegate
+{
+ private IFile file;
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ // no-op for now
+ }
+
+ public void run(IAction action) {
+ SynchronizeClassesJob job = new SynchronizeClassesJob(file);
+ job.schedule();
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ // Action is contributed for IFile's named "persistence.xml" and
+ // for PeristenceXml objects.
+ // There is always only one element in actual selection.
+ Object selectedObject = ((StructuredSelection) selection).getFirstElement();
+
+ if (selectedObject instanceof IFile) {
+ file = (IFile) selectedObject;
+ }
+ else if (selectedObject instanceof PersistenceXml) {
+ file = (IFile) ((PersistenceXml) selectedObject).getResource();
+ }
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/AddPersistentAttributeToXmlAndMapHandler.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/AddPersistentAttributeToXmlAndMapHandler.java
new file mode 100644
index 0000000000..3f944e970b
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/AddPersistentAttributeToXmlAndMapHandler.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
+import org.eclipse.jpt.core.context.orm.OrmPersistentType;
+import org.eclipse.jpt.ui.internal.dialogs.AddPersistentAttributeToXmlAndMapDialog;
+import org.eclipse.jpt.ui.internal.selection.DefaultJpaSelection;
+import org.eclipse.jpt.ui.internal.selection.JpaSelectionManager;
+import org.eclipse.jpt.ui.internal.selection.SelectionManagerFactory;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class AddPersistentAttributeToXmlAndMapHandler extends AbstractHandler
+{
+ @SuppressWarnings("unchecked")
+ public Object execute(ExecutionEvent executionEvent) throws ExecutionException {
+ final IWorkbenchWindow window =
+ HandlerUtil.getActiveWorkbenchWindowChecked(executionEvent);
+
+ final List newAttributes = new ArrayList();
+
+ IStructuredSelection selection
+ = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(executionEvent);
+
+
+ // only applies for multiply selected OrmPersistentAttribute objects in a tree
+ for (OrmPersistentAttribute attribute : (Iterable) CollectionTools.iterable(selection.iterator())) {
+ OrmPersistentType type = attribute.getOwningPersistentType();
+ String attributeName = attribute.getName();
+
+ AddPersistentAttributeToXmlAndMapDialog dialog = new AddPersistentAttributeToXmlAndMapDialog(window.getShell(), attribute);
+ dialog.create();
+ dialog.setBlockOnOpen(true);
+ dialog.open();
+
+ OrmPersistentAttribute newAttribute = type.getAttributeNamed(attributeName);
+ if (newAttribute != null) {
+ newAttributes.add(newAttribute);
+ }
+ }
+
+ if (newAttributes.size() == 1) {
+ window.getShell().getDisplay().asyncExec(
+ new Runnable() {
+ public void run() {
+ JpaSelectionManager selectionManager = SelectionManagerFactory.getSelectionManager(window);
+ selectionManager.select(new DefaultJpaSelection(newAttributes.get(0)), null);
+ }
+ });
+ }
+
+ return null;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/AddPersistentAttributeToXmlHandler.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/AddPersistentAttributeToXmlHandler.java
new file mode 100644
index 0000000000..0b54dba963
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/AddPersistentAttributeToXmlHandler.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
+import org.eclipse.jpt.core.context.orm.OrmPersistentType;
+import org.eclipse.jpt.ui.internal.selection.DefaultJpaSelection;
+import org.eclipse.jpt.ui.internal.selection.JpaSelectionManager;
+import org.eclipse.jpt.ui.internal.selection.SelectionManagerFactory;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class AddPersistentAttributeToXmlHandler extends AbstractHandler
+{
+ @SuppressWarnings("unchecked")
+ public Object execute(ExecutionEvent executionEvent) throws ExecutionException {
+ final IWorkbenchWindow window =
+ HandlerUtil.getActiveWorkbenchWindowChecked(executionEvent);
+
+ final List newAttributes = new ArrayList();
+
+ IStructuredSelection selection =
+ (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(executionEvent);
+
+ // only applies for multiply selected OrmPersistentAttribute objects in a tree
+ for (OrmPersistentAttribute attribute : (Iterable) CollectionTools.iterable(selection.iterator())) {
+ OrmPersistentType type = attribute.getOwningPersistentType();
+ String attributeName = attribute.getName();
+ attribute.makeSpecified();
+ OrmPersistentAttribute newAttribute = type.getAttributeNamed(attributeName);
+ if (newAttribute != null) {
+ newAttributes.add(newAttribute);
+ }
+ }
+
+ if (newAttributes.size() == 1) {
+ window.getShell().getDisplay().asyncExec(
+ new Runnable() {
+ public void run() {
+ JpaSelectionManager selectionManager = SelectionManagerFactory.getSelectionManager(window);
+ selectionManager.select(new DefaultJpaSelection(newAttributes.get(0)), null);
+ }
+ });
+ }
+
+ return null;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/AddPersistentClassHandler.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/AddPersistentClassHandler.java
new file mode 100644
index 0000000000..d91ba4bd87
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/AddPersistentClassHandler.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle.
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.ui.internal.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jpt.core.context.orm.EntityMappings;
+import org.eclipse.jpt.core.context.orm.OrmPersistentType;
+import org.eclipse.jpt.ui.internal.dialogs.AddPersistentClassDialog;
+import org.eclipse.jpt.ui.internal.selection.DefaultJpaSelection;
+import org.eclipse.jpt.ui.internal.selection.JpaSelectionManager;
+import org.eclipse.jpt.ui.internal.selection.SelectionManagerFactory;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class AddPersistentClassHandler extends AbstractHandler
+{
+ public Object execute(ExecutionEvent executionEvent) throws ExecutionException {
+ final IWorkbenchWindow window =
+ HandlerUtil.getActiveWorkbenchWindowChecked(executionEvent);
+
+ IStructuredSelection selection
+ = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(executionEvent);
+
+ // only applies for a singly selected EntityMappings object in a tree
+ EntityMappings entityMappings =
+ (EntityMappings) selection.getFirstElement();
+
+ AddPersistentClassDialog dialog =
+ new AddPersistentClassDialog(window.getShell(), entityMappings);
+ dialog.create();
+ dialog.setBlockOnOpen(true);
+ final OrmPersistentType type = dialog.openAndReturnType();
+
+ if (type != null) {
+ window.getShell().getDisplay().asyncExec(
+ new Runnable() {
+ public void run() {
+ JpaSelectionManager selectionManager = SelectionManagerFactory.getSelectionManager(window);
+ selectionManager.select(new DefaultJpaSelection(type), null);
+ }
+ });
+ }
+
+ return null;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/PersistentAttributeMapAsHandler.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/PersistentAttributeMapAsHandler.java
new file mode 100644
index 0000000000..0b829e7ac8
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/PersistentAttributeMapAsHandler.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal.commands;
+
+import java.util.Map;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jpt.core.context.PersistentAttribute;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.commands.IElementUpdater;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.menus.UIElement;
+import org.eclipse.ui.services.IEvaluationService;
+
+/**
+ * This handler is responsible to change the mapping type of the selected
+ * PersistentAttribute.
+ *
+ * This handler is defined in the JPT plugin.xml. It will be invoked by the
+ * mapping action dynamically created by the PersistentAttributeMapAsContribution.
+ *
+ * @see PersistentAttribute
+ * @see PersistentAttributeMapAsContribution
+ *
+ * @version 2.0
+ * @since 2.0
+ */
+@SuppressWarnings("nls")
+public class PersistentAttributeMapAsHandler extends AbstractHandler
+ implements IElementUpdater
+{
+ /**
+ * The unique identifier of the Map As command used for PersistentAttribute
+ * defined in the JptUiPlugin plugin.xml.
+ */
+ public static final String COMMAND_ID = "org.eclipse.jpt.ui.persistentAttributeMapAs";
+
+ /**
+ * The unique identifier of the Map As command parameter used for PersistentAttribute
+ * defined in the JptUiPlugin plugin.xml.
+ */
+ public static final String SPECIFIED_MAPPING_COMMAND_PARAMETER_ID = "specifiedPersistentAttributeMappingKey";
+
+ public static final String DEFAULT_MAPPING_COMMAND_PARAMETER_ID = "defaultPersistentAttributeMappingKey";
+
+ /**
+ * Creates a new PersistentAttributeMapAsHandler.
+ */
+ public PersistentAttributeMapAsHandler() {
+ super();
+ }
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ // Retrieve the selection from the ExecutionEvent
+ IStructuredSelection selection = (IStructuredSelection)
+ HandlerUtil.getCurrentSelectionChecked(event);
+
+ // Retrieve the value of the unique parameter passed to the command
+ String mappingKey = event.getParameter(SPECIFIED_MAPPING_COMMAND_PARAMETER_ID);
+
+ // Change the mapping key for all the selected items
+ for (Object item : selection.toArray()) {
+ PersistentAttribute attribute = (PersistentAttribute) item;
+ attribute.setSpecifiedMappingKey(mappingKey);
+ }
+
+ return null;
+ }
+
+ public void updateElement(UIElement element, @SuppressWarnings("unchecked") Map parameters) {
+ // Retrieve the selection for the UIElement
+
+ // Due to Bug 226746, we have to use API workaround to retrieve current
+ // selection
+ IEvaluationService es
+ = (IEvaluationService) element.getServiceLocator().getService(IEvaluationService.class);
+ IViewPart part =
+ (IViewPart) es.getCurrentState().getVariable(ISources.ACTIVE_PART_NAME);
+ IStructuredSelection selection
+ = (IStructuredSelection) part.getSite().getSelectionProvider().getSelection();
+
+ element.setChecked(selectedElementsMappingKeysMatch(selection, parameters));
+ }
+
+ //Check all the selected persistent attribute and verify that they have the same mapping type.
+ //They must all be either default mappings or specified mappings as well.
+ protected boolean selectedElementsMappingKeysMatch(IStructuredSelection selection, @SuppressWarnings("unchecked") Map parameters) {
+ String handlerSpecifiedMappingKey = (String) parameters.get(SPECIFIED_MAPPING_COMMAND_PARAMETER_ID);
+ String handlerDefaultMappingKey = (String) parameters.get(DEFAULT_MAPPING_COMMAND_PARAMETER_ID);
+
+ String commonDefaultKey = null;
+ String commonSpecifiedKey = null;
+ for (Object obj : selection.toArray()) {
+ if (! (obj instanceof PersistentAttribute)) {
+ //oddly enough, you have to check instanceof here, seems like a bug in the framework
+ return false;
+ }
+
+ PersistentAttribute persistentAttribute = (PersistentAttribute) obj;
+ if (persistentAttribute.getSpecifiedMapping() == null) {
+ if (commonSpecifiedKey != null) {
+ return false;
+ }
+ if (commonDefaultKey == null) {
+ commonDefaultKey = persistentAttribute.getMappingKey();
+ }
+ else if (!commonDefaultKey.equals(persistentAttribute.getMappingKey())) {
+ return false;
+ }
+ }
+ else {
+ if (commonDefaultKey != null) {
+ return false;
+ }
+ if (commonSpecifiedKey == null) {
+ commonSpecifiedKey = persistentAttribute.getMappingKey();
+ }
+ else if (!commonSpecifiedKey.equals(persistentAttribute.getMappingKey())) {
+ return false;
+ }
+ }
+ }
+ if (handlerSpecifiedMappingKey != null) {
+ return handlerSpecifiedMappingKey.equals(commonSpecifiedKey);
+ }
+ else if (handlerDefaultMappingKey != null) {
+ return handlerDefaultMappingKey.equals(commonDefaultKey);
+ }
+ return false;
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/PersistentTypeMapAsHandler.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/PersistentTypeMapAsHandler.java
new file mode 100644
index 0000000000..b1a9030fde
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/PersistentTypeMapAsHandler.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal.commands;
+
+import java.util.Iterator;
+import java.util.Map;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jpt.core.context.PersistentType;
+import org.eclipse.jpt.ui.internal.menus.PersistentTypeMapAsContribution;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.commands.IElementUpdater;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.menus.UIElement;
+import org.eclipse.ui.services.IEvaluationService;
+
+/**
+ * This handler is responsible to change the mapping type of the selected
+ * PersistentType.
+ *
+ * This handler is defined in the JPT plugin.xml. It will be invoked by the
+ * mapping action dynamically created by the PersistentTypeMapAsContribution.
+ *
+ * @see PersistentType
+ * @see PersistentTypeMapAsContribution
+ *
+ * @version 2.0
+ * @since 2.0
+ */
+@SuppressWarnings("nls")
+public class PersistentTypeMapAsHandler extends AbstractHandler
+ implements IElementUpdater
+{
+ /**
+ * The unique identifier of the Map As command used for {@link PersistentType}
+ * defined in the JptUiPlugin plugin.xml.
+ */
+ public static final String COMMAND_ID = "org.eclipse.jpt.ui.persistentTypeMapAs";
+
+ /**
+ * The unique identifier of the Map As command parameter used for {@link PersistentType}
+ * defined in the JptUiPlugin plugin.xml.
+ */
+ public static final String COMMAND_PARAMETER_ID = "persistentTypeMappingKey";
+
+
+ /**
+ * Creates a new PersistentTypeMapAsHandler.
+ */
+ public PersistentTypeMapAsHandler() {
+ super();
+ }
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ // Retrieve the selection from the ExecutionEvent
+ IStructuredSelection selection = (IStructuredSelection)
+ HandlerUtil.getCurrentSelectionChecked(event);
+
+ // Retrieve the value of the unique parameter passed to the command
+ String mappingKey = event.getParameter(COMMAND_PARAMETER_ID);
+
+ // Change the mapping key for all the selected items
+ for (Object item : selection.toArray()) {
+ PersistentType type = (PersistentType) item;
+ type.setMappingKey(mappingKey);
+ }
+
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void updateElement(UIElement element, Map parameters) {
+ // Retrieve the selection for the UIElement
+
+ // Due to Bug 226746, we have to use API workaround to retrieve current
+ // selection
+ IEvaluationService es
+ = (IEvaluationService) element.getServiceLocator().getService(IEvaluationService.class);
+ IViewPart part =
+ (IViewPart) es.getCurrentState().getVariable(ISources.ACTIVE_PART_NAME);
+ IStructuredSelection selection
+ = (IStructuredSelection) part.getSite().getSelectionProvider().getSelection();
+
+ String commonMappingKey = commonMappingKey(selection);
+
+ String handlerMappingKey = (String) parameters.get(COMMAND_PARAMETER_ID);
+ if (handlerMappingKey != null) {
+ element.setChecked(handlerMappingKey.equals(commonMappingKey));
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ protected String commonMappingKey(IStructuredSelection selection) {
+ String commonKey = null;
+ for (Iterator stream = selection.iterator(); stream.hasNext(); ) {
+ Object obj = stream.next();
+
+ if (! (obj instanceof PersistentType)) {
+ return null;
+ }
+
+ PersistentType persistentType = (PersistentType) obj;
+
+ if (commonKey == null) {
+ commonKey = persistentType.getMappingKey();
+ }
+ else if (! commonKey.equals(persistentType.getMappingKey())) {
+ return null;
+ }
+ }
+ return commonKey;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/RemovePersistentAttributeFromXmlHandler.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/RemovePersistentAttributeFromXmlHandler.java
new file mode 100644
index 0000000000..5a3dbb7a84
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/RemovePersistentAttributeFromXmlHandler.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
+import org.eclipse.jpt.core.context.orm.OrmPersistentType;
+import org.eclipse.jpt.ui.internal.selection.DefaultJpaSelection;
+import org.eclipse.jpt.ui.internal.selection.JpaSelectionManager;
+import org.eclipse.jpt.ui.internal.selection.SelectionManagerFactory;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class RemovePersistentAttributeFromXmlHandler extends AbstractHandler
+{
+ @SuppressWarnings("unchecked")
+ public Object execute(ExecutionEvent executionEvent) throws ExecutionException {
+ final IWorkbenchWindow window =
+ HandlerUtil.getActiveWorkbenchWindowChecked(executionEvent);
+
+ final List newAttributes = new ArrayList();
+
+ IStructuredSelection selection =
+ (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(executionEvent);
+
+ // only applies for multiply selected OrmPersistentAttribute objects in a tree
+ for (OrmPersistentAttribute attribute : (Iterable) CollectionTools.iterable(selection.iterator())) {
+ OrmPersistentType type = attribute.getOwningPersistentType();
+ String attributeName = attribute.getName();
+ attribute.makeVirtual();
+ OrmPersistentAttribute newAttribute = type.getAttributeNamed(attributeName);
+ if (newAttribute != null) {
+ newAttributes.add(newAttribute);
+ }
+ }
+
+ if (newAttributes.size() == 1) {
+ window.getShell().getDisplay().asyncExec(
+ new Runnable() {
+ public void run() {
+ JpaSelectionManager selectionManager = SelectionManagerFactory.getSelectionManager(window);
+ selectionManager.select(new DefaultJpaSelection(newAttributes.get(0)), null);
+ }
+ });
+ }
+
+ return null;
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/RemovePersistentClassHandler.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/RemovePersistentClassHandler.java
new file mode 100644
index 0000000000..8b6a3c8f4d
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/RemovePersistentClassHandler.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Oracle.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.ui.internal.commands;
+
+import java.util.Iterator;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jpt.core.context.orm.EntityMappings;
+import org.eclipse.jpt.core.context.orm.OrmPersistentType;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class RemovePersistentClassHandler extends AbstractHandler
+{
+ @SuppressWarnings("unchecked")
+ public Object execute(ExecutionEvent executionEvent) throws ExecutionException {
+ IStructuredSelection selection =
+ (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(executionEvent);
+
+ // only applies for multiply selected OrmPersistentType objects in a tree
+ for (Iterator stream = selection.iterator(); stream.hasNext(); ) {
+ OrmPersistentType persistentType = stream.next();
+ ((EntityMappings) persistentType.getMappingFileRoot()).removePersistentType(persistentType);
+ }
+
+ return null;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/UpgradeXmlFileVersionHandler.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/UpgradeXmlFileVersionHandler.java
new file mode 100644
index 0000000000..7ca61cc604
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/UpgradeXmlFileVersionHandler.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jpt.core.JpaProject;
+import org.eclipse.jpt.core.JptCorePlugin;
+import org.eclipse.jpt.core.context.XmlFile;
+import org.eclipse.jpt.core.resource.xml.JpaRootEObject;
+import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class UpgradeXmlFileVersionHandler extends AbstractHandler
+{
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IStructuredSelection selection
+ = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);
+
+ for (Object selectedObject : selection.toArray()) {
+ upgradeXmlFileVersion(selectedObject);
+ }
+ return null;
+ }
+
+ protected void upgradeXmlFileVersion(Object selectedObject) {
+ JpaXmlResource xmlResource =
+ (JpaXmlResource) Platform.getAdapterManager().getAdapter(selectedObject, JpaXmlResource.class);
+ if (xmlResource == null) {
+ XmlFile xmlFile =
+ (XmlFile) Platform.getAdapterManager().getAdapter(selectedObject, XmlFile.class);
+ if (xmlFile != null) {
+ xmlResource = xmlFile.getXmlResource();
+ }
+ }
+ if (xmlResource == null) {
+ return;
+ }
+
+ final JpaRootEObject root = xmlResource.getRootObject();
+ IContentType contentType = xmlResource.getContentType();
+ JpaProject jpaProject = JptCorePlugin.getJpaProject(xmlResource.getProject());
+ final String newVersion = jpaProject.getJpaPlatform().getMostRecentSupportedResourceType(contentType).getVersion();
+
+ xmlResource.modify(
+ new Runnable() {
+ public void run() {
+ root.setVersion(newVersion);
+ }
+ });
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractBasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractBasicMappingComposite.java
new file mode 100644
index 0000000000..639350b79f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractBasicMappingComposite.java
@@ -0,0 +1,216 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal.details;
+
+import org.eclipse.jpt.core.context.BasicMapping;
+import org.eclipse.jpt.core.context.Column;
+import org.eclipse.jpt.core.context.Converter;
+import org.eclipse.jpt.core.context.ConvertibleMapping;
+import org.eclipse.jpt.core.context.EnumeratedConverter;
+import org.eclipse.jpt.core.context.TemporalConverter;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.details.JpaComposite;
+import org.eclipse.jpt.ui.internal.widgets.Pane;
+import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
+import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Here the layout of this pane:
+ *