Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/.cvsignore4
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/.project17
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/build.properties15
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/epl-v10.html328
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/feature.properties145
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/feature.xml38
-rw-r--r--assembly/features/org.eclipse.jpt.sdk/license.html98
-rw-r--r--assembly/features/org.eclipse.jpt.tests/.cvsignore2
-rw-r--r--assembly/features/org.eclipse.jpt.tests/.project17
-rw-r--r--assembly/features/org.eclipse.jpt.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--assembly/features/org.eclipse.jpt.tests/build.properties5
-rw-r--r--assembly/features/org.eclipse.jpt.tests/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--assembly/features/org.eclipse.jpt.tests/epl-v10.html328
-rw-r--r--assembly/features/org.eclipse.jpt.tests/feature.properties145
-rw-r--r--assembly/features/org.eclipse.jpt.tests/feature.xml28
-rw-r--r--assembly/features/org.eclipse.jpt.tests/license.html98
-rw-r--r--assembly/features/org.eclipse.jpt/.cvsignore2
-rw-r--r--assembly/features/org.eclipse.jpt/.project17
-rw-r--r--assembly/features/org.eclipse.jpt/build.properties16
-rw-r--r--assembly/features/org.eclipse.jpt/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--assembly/features/org.eclipse.jpt/epl-v10.html328
-rw-r--r--assembly/features/org.eclipse.jpt/feature.properties144
-rw-r--r--assembly/features/org.eclipse.jpt/feature.xml38
-rw-r--r--assembly/features/org.eclipse.jpt/license.html93
-rw-r--r--assembly/plugins/org.eclipse.jpt/.cvsignore3
-rw-r--r--assembly/plugins/org.eclipse.jpt/.project22
-rw-r--r--assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF7
-rw-r--r--assembly/plugins/org.eclipse.jpt/about.html34
-rw-r--r--assembly/plugins/org.eclipse.jpt/about.ini44
-rw-r--r--assembly/plugins/org.eclipse.jpt/about.mappings6
-rw-r--r--assembly/plugins/org.eclipse.jpt/about.properties24
-rw-r--r--assembly/plugins/org.eclipse.jpt/build.properties19
-rw-r--r--assembly/plugins/org.eclipse.jpt/component.xml12
-rw-r--r--assembly/plugins/org.eclipse.jpt/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--assembly/plugins/org.eclipse.jpt/eclipse32.pngbin4594 -> 0 bytes
-rw-r--r--assembly/plugins/org.eclipse.jpt/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.feature/build.properties15
-rw-r--r--jpa/features/org.eclipse.jpt.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.feature/feature.properties140
-rw-r--r--jpa/features/org.eclipse.jpt.feature/feature.xml116
-rw-r--r--jpa/features/org.eclipse.jpt.feature/license.html98
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/build.properties16
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.properties145
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.xml26
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html82
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/build.properties11
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/license.html83
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/build.properties10
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/feature.properties145
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/feature.xml32
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/license.html98
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/build.properties9
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/feature.properties140
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/feature.xml28
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/license.html98
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore3
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF14
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/build.properties17
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties25
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.cvsignore3
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF15
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/build.properties19
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/plugin.properties25
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Catalog.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Column.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Connection.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionListener.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfile.java253
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfileRepository.java253
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java234
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionWrapper.java170
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java226
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTools.java212
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPWrapper.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Database.java229
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ForeignKey.java337
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/JptDbPlugin.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnection.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnectionProfile.java176
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullDatabase.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ProfileListener.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Schema.java299
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Sequence.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Table.java359
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/.project22
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF8
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/about.html48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/build.properties102
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml63
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml44
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml88
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm50
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml422
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css21
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm11
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm54
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm90
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm111
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started005.htm140
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started006.htm48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started007.htm215
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started008.htm52
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started009.htm68
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started010.htm63
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started011.htm85
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started012.htm60
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started013.htm64
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started014.htm132
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started015.htm133
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started016.htm89
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started017.htm71
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started018.htm89
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started019.htm67
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_open.pngbin5702 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_details.pngbin8558 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_structure.pngbin4099 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/button_jpa_perspective.pngbin318 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/database_explorer.pngbin4645 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.pngbin5647 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/edit_join_column_dialog.pngbin10049 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.pngbin13762 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.pngbin6223 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_11mapping.pngbin244 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_1mmapping.pngbin303 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.pngbin476 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddable.pngbin354 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedidmapping.pngbin213 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedmapping.pngbin400 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_idmapping.pngbin521 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_m1mapping.pngbin301 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_mmmapping.pngbin255 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_nonpersistent.pngbin210 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_persistent.pngbin649 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_superclass.pngbin632 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_transientmapping.pngbin224 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_versionmapping.pngbin443 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.pngbin11615 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.pngbin3359 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.pngbin4236 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.pngbin7823 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_details_employee.pngbin8587 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_facet_dialog.pngbin14095 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_dialog.pngbin23157 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_project_2.pngbin7208 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.pngbin667 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.pngbin615 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.pngbin568 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.pngbin12962 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_address.pngbin7215 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_empid.pngbin6734 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_entity.pngbin2090 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fields.pngbin4307 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fname.pngbin6658 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_owner.pngbin6409 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_phone.pngbin7292 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_version.pngbin6923 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.pngbin8746 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_perspective.pngbin43141 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_address.pngbin8600 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_addressid.pngbin9705 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_embedded.pngbin8080 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid.pngbin6545 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid_pk.pngbin12188 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_employee.pngbin8850 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_entity.pngbin8013 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_firstname.pngbin8892 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_manytoone.pngbin11009 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_mappedsprc.pngbin8293 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetomany.pngbin17395 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetoone.pngbin9280 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_version.pngbin7852 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.pngbin2899 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/properties_persistence.pngbin19758 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.pngbin9094 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.pngbin1750 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.pngbin16378 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.pngbin9169 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/tutorial_object_model.pngbin7632 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/index.xml546
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/legal.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml37
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm52
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm91
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm213
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm91
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm54
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm57
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm55
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm54
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm144
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm80
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm57
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm115
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm108
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm84
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm73
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm100
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm102
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm71
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm116
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm44
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm58
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm79
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm103
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm74
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm143
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm69
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm69
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm78
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm74
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm67
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm67
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm68
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm81
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm72
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm86
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm206
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm120
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm94
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm176
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm179
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm134
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm169
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm141
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm72
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm135
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm74
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm98
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm55
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm89
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm71
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/toc.xml117
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm54
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm57
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm56
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.cvsignore3
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF15
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/build.properties16
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java1437
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java175
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java342
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/.classpath13
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF58
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/build.properties21
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_jpaproject_wiz.gifbin372 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/jpa_facet.gifbin896 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_jpaproject_wiz.gifbin991 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_details.gifbin953 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_perspective.gifbin896 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_structure.gifbin900 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/basic.gifbin897 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embeddable.gifbin1003 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded-id.gifbin953 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded.gifbin905 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity-mappings.gifbin974 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity.gifbin1010 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/id.gifbin938 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-many.gifbin328 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-one.gifbin307 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/mapped-superclass.gifbin1005 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-attribute-mapping.gifbin911 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-type-mapping.gifbin586 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-many.gifbin306 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-one.gifbin283 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence-unit.gifbin931 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence.gifbin961 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/transient.gifbin892 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/version.gifbin321 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/jpa_facet_wizban.gifbin3485 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/plugin.properties50
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/plugin.xml314
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties79
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_mappings.properties185
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_xml.properties36
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/schema/jpaPlatform.exsd119
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/BaseJpaPlatformUi.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaHelpContextIds.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaPlatformUi.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaCompletionProposalComputer.java123
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiIcons.java16
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiPlugin.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/PlatformRegistry.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAction.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAndMapAction.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentClassAction.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateDDLAction.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateEntitiesAction.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/PersistentAttributeActionFilter.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/ProjectAction.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentAttributeFromXmlAction.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentClassAction.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/SynchronizeClassesAction.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/XmlPersistentAttributeActionFilter.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaComposite.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaController.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaDetailsPage.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaComposite.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsPage.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsProvider.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PageBookManager.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java397
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentTypeDetailsPage.java292
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java193
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentClassDialog.java279
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/EntitiesGenerator.java290
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/GenericPlatformUi.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/IAttributeMappingUiProvider.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ITypeMappingUiProvider.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaDetailsProvider.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentAttributeDetailsPage.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentTypeDetailsPage.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/BasicMappingUiProvider.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultBasicMappingUiProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultEmbeddedMappingUiProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddableUiProvider.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedIdMappingUiProvider.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedMappingUiProvider.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EntityUiProvider.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/IdMappingUiProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToManyMappingUiProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToOneMappingUiProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/MappedSuperclassUiProvider.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullAttributeMappingUiProvider.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullTypeMappingUiProvider.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToManyMappingUiProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToOneMappingUiProvider.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/TransientMappingUiProvider.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/VersionMappingUiProvider.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaCompilationUnitItemProvider.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentAttributeItemProvider.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentTypeItemProvider.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaStructureProvider.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JpaCoreJavaItemProviderAdapterFactory.java176
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullLabelProvider.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullTreeContentProvider.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsImages.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsMessages.java205
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialog.java183
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/BasicComposite.java357
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java378
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CatalogCombo.java304
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ColumnComposite.java567
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CommonWidgets.java260
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddableComposite.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedAttributeOverridesComposite.java338
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedComposite.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedIdComposite.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityComposite.java339
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityNameCombo.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EnumComboViewer.java207
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratedValueComposite.java288
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratorComposite.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/IdComposite.java459
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InheritanceComposite.java620
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnDialog.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnComposite.java428
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialog.java209
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideDialog.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableDialog.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingDialog.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnsComposite.java348
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinTableComposite.java473
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/LobCheckBox.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyComposite.java184
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneComposite.java193
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedByCombo.java159
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedSuperclassComposite.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyComposite.java187
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneComposite.java206
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OrderingComposite.java309
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OverridesComposite.java501
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialog.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsComposite.java399
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java407
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SchemaCombo.java327
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTableDialog.java247
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTablesComposite.java382
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SequenceGeneratorComposite.java185
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/StringWithDefaultChooser.java274
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableCombo.java338
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableComposite.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableGeneratorComposite.java535
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TargetEntityChooser.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TransientComposite.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/VersionComposite.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/perspective/JpaPerspectiveFactory.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/prefs/JpaPreferencePage.java204
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/DataModelPropertyPage.java309
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/JpaProjectPropertiesPage.java392
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/AbstractSelectionParticipant.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionManager.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionParticipant.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaDetailsSelectionParticipant.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaStructureSelectionParticipant.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/Selection.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionEvent.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManager.java264
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionParticipantFactory.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/TextEditorSelectionParticipant.java164
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/IJpaStructureProvider.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/TableLayoutComposite.java191
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/AbstractJpaView.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaDetailsView.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaStructureView.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/CComboViewer.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/ScrolledPageContent.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/DatabaseReconnectWizardPage.java361
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizard.java169
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizardPage.java539
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java528
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectFirstPage.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectWizard.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/JptUiXmlMessages.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/AccessTypeComboViewer.java186
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CascadePersistCheckBox.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CommonWidgets.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/MetaDataCompleteComboViewer.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/PersistenceUnitMetadataSection.java285
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlDetailsProvider.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlEntityMappingsDetailsPage.java274
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaAttributeChooser.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaClassChooser.java249
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlMappingMetadataCompleteCheckBox.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPackageChooser.java255
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentAttributeDetailsPage.java164
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentTypeDetailsPage.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/EntityMappingsItemProvider.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/JpaCoreXmlItemProviderAdapterFactory.java197
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentTypeItemProvider.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlRootContentNodeItemProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlStructureProvider.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.classpath12
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.cvsignore3
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/META-INF/MANIFEST.MF10
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/build.properties17
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassTools.java1505
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java910
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java2417
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java1006
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Filter.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java733
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IndentingPrintWriter.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCTools.java348
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCType.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JavaType.java232
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java305
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Range.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReverseComparator.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java2101
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/XMLStringEncoder.java182
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java229
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyEnumeration.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/IteratorEnumeration.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java175
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/.classpath13
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/META-INF/MANIFEST.MF25
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/build.properties19
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/plugin.properties22
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java38
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/ProjectUtility.java91
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JavaEntityTests.java52
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JpaJavaTestCase.java62
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JptCoreContentJavaMappingsTests.java28
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/AnnotationTestCase.java429
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapterTests.java728
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JDTToolsTests.java164
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JptCoreJdtUtilityTests.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/MemberAnnotationElementAdapterTests.java615
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedDeclarationAnnotationAdapterTests.java763
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapterTests.java2209
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/SimpleDeclarationAnnotationAdapterTests.java204
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/TypeTests.java67
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JptCoreModelTests.java27
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/ModelInitializationTests.java90
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/BaseJpaPlatformTests.java81
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JptCorePlatformTests.java28
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestFacetedProject.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJavaProject.java148
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java60
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestPlatformProject.java195
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/test.xml44
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.classpath7
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF16
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/build.properties15
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/derby101.properties30
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties29
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties29
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver2005.properties30
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/plugin.properties25
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java39
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java54
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java42
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java385
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Derby101Tests.java64
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java60
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java60
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServer2005Tests.java64
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.classpath7
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF12
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/build.properties16
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java59
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java548
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java289
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java1972
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java594
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java448
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java107
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java66
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java250
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java49
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java214
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java74
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java101
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java833
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java161
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java135
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java126
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java150
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java119
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java252
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java408
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java334
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java404
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java53
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java63
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java127
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java119
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java285
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java183
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java98
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java53
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java140
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java118
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java203
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java71
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java111
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java216
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java306
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java197
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/test.xml44
660 files changed, 0 insertions, 77148 deletions
diff --git a/assembly/features/org.eclipse.jpt.sdk/.cvsignore b/assembly/features/org.eclipse.jpt.sdk/.cvsignore
deleted file mode 100644
index bc2abf75c1..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.bin.dist.zip
-build.xml
-features
-plugins
diff --git a/assembly/features/org.eclipse.jpt.sdk/.project b/assembly/features/org.eclipse.jpt.sdk/.project
deleted file mode 100644
index 821d453136..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.sdk</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/features/org.eclipse.jpt.sdk/build.properties b/assembly/features/org.eclipse.jpt.sdk/build.properties
deleted file mode 100644
index 7200939aca..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
diff --git a/assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/assembly/features/org.eclipse.jpt.sdk/epl-v10.html b/assembly/features/org.eclipse.jpt.sdk/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt.sdk/feature.properties b/assembly/features/org.eclipse.jpt.sdk/feature.properties
deleted file mode 100644
index abb0c88d62..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence API (JPA) project SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Dali Java Persistence API (JPA) project SDK
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/assembly/features/org.eclipse.jpt.sdk/feature.xml b/assembly/features/org.eclipse.jpt.sdk/feature.xml
deleted file mode 100644
index 4b10e054bb..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/feature.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.sdk"
- label="%featureName"
- version="1.0.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <license url="license.html">
- %license
- </license>
-
- <copyright>
- %copyright
- </copyright>
-
- <url>
- <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- </url>
-
- <includes
- id="org.eclipse.jpt_sdk.feature"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/assembly/features/org.eclipse.jpt.sdk/license.html b/assembly/features/org.eclipse.jpt.sdk/license.html
deleted file mode 100644
index 76abfb4621..0000000000
--- a/assembly/features/org.eclipse.jpt.sdk/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/assembly/features/org.eclipse.jpt.tests/.cvsignore b/assembly/features/org.eclipse.jpt.tests/.cvsignore
deleted file mode 100644
index d9e4340782..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.bin.dist.zip
-build.xml
diff --git a/assembly/features/org.eclipse.jpt.tests/.project b/assembly/features/org.eclipse.jpt.tests/.project
deleted file mode 100644
index 3d1dde631a..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/features/org.eclipse.jpt.tests/.settings/org.eclipse.core.resources.prefs b/assembly/features/org.eclipse.jpt.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 17acb651a8..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:11:05 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/assembly/features/org.eclipse.jpt.tests/build.properties b/assembly/features/org.eclipse.jpt.tests/build.properties
deleted file mode 100644
index 7f47694aab..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
diff --git a/assembly/features/org.eclipse.jpt.tests/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt.tests/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/assembly/features/org.eclipse.jpt.tests/epl-v10.html b/assembly/features/org.eclipse.jpt.tests/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt.tests/feature.properties b/assembly/features/org.eclipse.jpt.tests/feature.properties
deleted file mode 100644
index 6b58fe6a33..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence API (JPA) project Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Dali Java Persistence API (JPA) project Tests
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/assembly/features/org.eclipse.jpt.tests/feature.xml b/assembly/features/org.eclipse.jpt.tests/feature.xml
deleted file mode 100644
index e445c4c153..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/feature.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.tests"
- label="%featureName"
- version="1.0.0.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <license url="license.html">
- %license
- </license>
-
- <copyright>
- %copyright
- </copyright>
-
- <url>
- <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates/"/>
- </url>
-
- <includes
- id="org.eclipse.jpt.tests.feature"
- version="0.0.0"/>
-
-</feature>
diff --git a/assembly/features/org.eclipse.jpt.tests/license.html b/assembly/features/org.eclipse.jpt.tests/license.html
deleted file mode 100644
index 56445985d9..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/assembly/features/org.eclipse.jpt/.cvsignore b/assembly/features/org.eclipse.jpt/.cvsignore
deleted file mode 100644
index d9e4340782..0000000000
--- a/assembly/features/org.eclipse.jpt/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.bin.dist.zip
-build.xml
diff --git a/assembly/features/org.eclipse.jpt/.project b/assembly/features/org.eclipse.jpt/.project
deleted file mode 100644
index b7aaec2f54..0000000000
--- a/assembly/features/org.eclipse.jpt/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/features/org.eclipse.jpt/build.properties b/assembly/features/org.eclipse.jpt/build.properties
deleted file mode 100644
index 470b4bcb63..0000000000
--- a/assembly/features/org.eclipse.jpt/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
- \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt/eclipse_update_120.jpg b/assembly/features/org.eclipse.jpt/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/assembly/features/org.eclipse.jpt/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/assembly/features/org.eclipse.jpt/epl-v10.html b/assembly/features/org.eclipse.jpt/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/assembly/features/org.eclipse.jpt/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/assembly/features/org.eclipse.jpt/feature.properties b/assembly/features/org.eclipse.jpt/feature.properties
deleted file mode 100644
index 0ae42bbb56..0000000000
--- a/assembly/features/org.eclipse.jpt/feature.properties
+++ /dev/null
@@ -1,144 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Java Persistence API Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Java Persistence API Tools - Runtime
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-March 17, 2005\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/assembly/features/org.eclipse.jpt/feature.xml b/assembly/features/org.eclipse.jpt/feature.xml
deleted file mode 100644
index fdae5614e9..0000000000
--- a/assembly/features/org.eclipse.jpt/feature.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt"
- label="%featureName"
- version="1.0.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <license url="license.html">
- %license
- </license>
-
- <copyright>
- %copyright
- </copyright>
-
- <url>
- <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- </url>
-
- <includes
- id="org.eclipse.jpt.feature"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/assembly/features/org.eclipse.jpt/license.html b/assembly/features/org.eclipse.jpt/license.html
deleted file mode 100644
index 2347060ef3..0000000000
--- a/assembly/features/org.eclipse.jpt/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>January 28, 2005</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI></UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/assembly/plugins/org.eclipse.jpt/.cvsignore b/assembly/plugins/org.eclipse.jpt/.cvsignore
deleted file mode 100644
index e4254b18e0..0000000000
--- a/assembly/plugins/org.eclipse.jpt/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-temp.folder
-build.xml
diff --git a/assembly/plugins/org.eclipse.jpt/.project b/assembly/plugins/org.eclipse.jpt/.project
deleted file mode 100644
index f51b04cc90..0000000000
--- a/assembly/plugins/org.eclipse.jpt/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs b/assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4aec29d1cd..0000000000
--- a/assembly/plugins/org.eclipse.jpt/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:09 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF b/assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF
deleted file mode 100644
index 5ac613eda7..0000000000
--- a/assembly/plugins/org.eclipse.jpt/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt; singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/assembly/plugins/org.eclipse.jpt/about.html b/assembly/plugins/org.eclipse.jpt/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/assembly/plugins/org.eclipse.jpt/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>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
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>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
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/assembly/plugins/org.eclipse.jpt/about.ini b/assembly/plugins/org.eclipse.jpt/about.ini
deleted file mode 100644
index 588a325a8f..0000000000
--- a/assembly/plugins/org.eclipse.jpt/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/assembly/plugins/org.eclipse.jpt/about.mappings b/assembly/plugins/org.eclipse.jpt/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/assembly/plugins/org.eclipse.jpt/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/assembly/plugins/org.eclipse.jpt/about.properties b/assembly/plugins/org.eclipse.jpt/about.properties
deleted file mode 100644
index 159bfceeba..0000000000
--- a/assembly/plugins/org.eclipse.jpt/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Java Persistence API Tools\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2006. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/assembly/plugins/org.eclipse.jpt/build.properties b/assembly/plugins/org.eclipse.jpt/build.properties
deleted file mode 100644
index 0ccfb0ebb8..0000000000
--- a/assembly/plugins/org.eclipse.jpt/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 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
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- eclipse32.png,\
- plugin.properties,\
- component.xml
diff --git a/assembly/plugins/org.eclipse.jpt/component.xml b/assembly/plugins/org.eclipse.jpt/component.xml
deleted file mode 100644
index 11f133f65a..0000000000
--- a/assembly/plugins/org.eclipse.jpt/component.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt" fragment="false"/>
-<plugin id="org.eclipse.jpt.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.db" fragment="false"/>
-<plugin id="org.eclipse.jpt.db.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.gen" fragment="false"/>
-<plugin id="org.eclipse.jpt.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.utility" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/assembly/plugins/org.eclipse.jpt/eclipse32.gif b/assembly/plugins/org.eclipse.jpt/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/assembly/plugins/org.eclipse.jpt/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/assembly/plugins/org.eclipse.jpt/eclipse32.png b/assembly/plugins/org.eclipse.jpt/eclipse32.png
deleted file mode 100644
index 568fac1d05..0000000000
--- a/assembly/plugins/org.eclipse.jpt/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/assembly/plugins/org.eclipse.jpt/plugin.properties b/assembly/plugins/org.eclipse.jpt/plugin.properties
deleted file mode 100644
index f45a08d54e..0000000000
--- a/assembly/plugins/org.eclipse.jpt/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-
-pluginName = Java Persistence API Tools
-providerName = Eclipse.org
diff --git a/jpa/features/org.eclipse.jpt.feature/.project b/jpa/features/org.eclipse.jpt.feature/.project
deleted file mode 100644
index c8eb2f0481..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index dab5837cb6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:47 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.feature/build.properties b/jpa/features/org.eclipse.jpt.feature/build.properties
deleted file mode 100644
index 7200939aca..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
diff --git a/jpa/features/org.eclipse.jpt.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/epl-v10.html b/jpa/features/org.eclipse.jpt.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt.feature/feature.properties b/jpa/features/org.eclipse.jpt.feature/feature.properties
deleted file mode 100644
index a2b39f3024..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/feature.properties
+++ /dev/null
@@ -1,140 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Java Persistence API Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Java Persistence API (JPA) Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006-07 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.feature/feature.xml b/jpa/features/org.eclipse.jpt.feature/feature.xml
deleted file mode 100644
index 0cc284f167..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/feature.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.feature"
- label="%featureName"
- version="1.0.0.qualifier"
- provider-name="%providerName"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <url>
- <update label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Web Tools Platform (WTP) Updates" url="http://download.eclipse.org/webtools/updates"/>
- <discovery label="Dali Java Persistence API Tools (JPA) Updates" url="http://download.eclipse.org/webtools/updates/"/>
- </url>
-
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.datatools.sqltools.editor.core"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.datatools.connectivity.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.core.commands"/>
- <import plugin="org.eclipse.core.expressions"/>
- <import plugin="org.eclipse.core.filebuffers"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.emf.ecore"/>
- <import plugin="org.eclipse.emf.ecore.xmi"/>
- <import plugin="org.eclipse.jem"/>
- <import plugin="org.eclipse.jem.util"/>
- <import plugin="org.eclipse.jem.workbench"/>
- <import plugin="org.eclipse.jst.j2ee"/>
- <import plugin="org.eclipse.jst.j2ee.core"/>
- <import plugin="org.eclipse.text"/>
- <import plugin="org.eclipse.wst.common.emf"/>
- <import plugin="org.eclipse.wst.common.frameworks"/>
- <import plugin="org.eclipse.wst.common.modulecore"/>
- <import plugin="org.eclipse.wst.common.project.facet.core"/>
- <import plugin="org.eclipse.wst.sse.core"/>
- <import plugin="org.eclipse.wst.validation"/>
- <import plugin="org.eclipse.wst.xml.core"/>
- <import plugin="org.eclipse.xsd"/>
- <import plugin="org.eclipse.draw2d"/>
- <import plugin="org.eclipse.emf.edit.ui"/>
- <import plugin="org.eclipse.jdt.ui"/>
- <import plugin="org.eclipse.jface.text"/>
- <import plugin="org.eclipse.jst.j2ee.ui"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.ui.views.properties.tabbed"/>
- <import plugin="org.eclipse.ui.workbench.texteditor"/>
- <import plugin="org.eclipse.wst.common.frameworks.ui"/>
- <import plugin="org.eclipse.wst.common.project.facet.ui"/>
- <import plugin="org.eclipse.wst.sse.ui"/>
- <import plugin="org.eclipse.wst.web.ui"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.utility"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.db"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.db.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.gen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.doc.user"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.feature/license.html b/jpa/features/org.eclipse.jpt.feature/license.html
deleted file mode 100644
index fc77372d46..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/build.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 997dd3f0c7..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 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
-###############################################################################
-bin.includes =\
-epl-v10.html,\
-eclipse_update_120.jpg,\
-feature.xml,\
-feature.properties,\
-license.html
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/epl-v10.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 0c1da15ce6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence API (JPA) Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Dali Java Persistence API (JPA) Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.xml b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.xml
deleted file mode 100644
index 12e267e1de..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.feature.source"
- label="%featureName"
- version="1.0.0.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <plugin
- id="org.eclipse.jpt.feature.source"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html
deleted file mode 100644
index fec4a489ad..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>June 06, 2007</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.ini b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.mappings b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 5e52cb277e..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2005 IBM Corporation and others.
-# 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=JavaServer Faces Tooling Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/build.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index e3098b39b2..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-bin.includes =\
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.gif b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.png b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/epl-v10.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/license.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 14b1d50265..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>June 06, 2007</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/plugin.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 088161f801..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-
-pluginName = Dali Java Persistence API (JPA) Tools
-providerName = Eclipse.org
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/.project b/jpa/features/org.eclipse.jpt.tests.feature/.project
deleted file mode 100644
index 91760f21b4..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.tests.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 235b84ae83..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:11:17 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/build.properties b/jpa/features/org.eclipse.jpt.tests.feature/build.properties
deleted file mode 100644
index d6a4dce096..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
-src.includes = license.html,\
- feature.xml,\
- epl-v10.html,\
- eclipse_update_120.jpg,\
- build.properties
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html b/jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/feature.properties b/jpa/features/org.eclipse.jpt.tests.feature/feature.properties
deleted file mode 100644
index 33ec536d55..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-# TOREVIEW - updateSiteName
-updateSiteName=Web Tools Platform (WTP) Updates
-
-# "description" property - description of the feature
-description=Dali Java Persistence API (JPA) Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/feature.xml b/jpa/features/org.eclipse.jpt.tests.feature/feature.xml
deleted file mode 100644
index 2034cacec4..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/feature.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.tests.feature"
- label="Dali Java Persistence API Tools (JPA) JUnit Tests"
- version="1.0.0.qualifier"
- provider-name="Eclipse.org">
-
- <description>
- %description
- </description>
-
- <license url="license.html">
- %license
- </license>
-
- <copyright>
- %copyright
- </copyright>
-
- <plugin
- id="org.eclipse.jpt.utility.tests"
- download-size="0"
- install-size="0"
- version="0.0.0" />
-
- <plugin
- id="org.eclipse.jpt.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0" />
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/license.html b/jpa/features/org.eclipse.jpt.tests.feature/license.html
deleted file mode 100644
index 56445985d9..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/.project b/jpa/features/org.eclipse.jpt_sdk.feature/.project
deleted file mode 100644
index 33da750336..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 6cc7d4b4cd..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:09:59 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/build.properties b/jpa/features/org.eclipse.jpt_sdk.feature/build.properties
deleted file mode 100644
index 28724c6843..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/build.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-bin.includes = feature.xml,\
- license.html,\
- feature.properties,\
- epl-v10.html,\
- eclipse_update_120.jpg
-
-src.includes = build.properties
-
-generate.feature@org.eclipse.jpt.feature.source=org.eclipse.jpt.feature
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html b/jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/feature.properties b/jpa/features/org.eclipse.jpt_sdk.feature/feature.properties
deleted file mode 100644
index a14204ac5e..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/feature.properties
+++ /dev/null
@@ -1,140 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Java Persistence API Tools Plug-in SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=Source code zips for JPA Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006-07 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml b/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml
deleted file mode 100644
index 78f3de1519..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt_sdk.feature"
- label="%featureName"
- version="1.0.0.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/license.html b/jpa/features/org.eclipse.jpt_sdk.feature/license.html
deleted file mode 100644
index fc77372d46..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.classpath b/jpa/plugins/org.eclipse.jpt.db.ui/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore b/jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore
deleted file mode 100644
index 814c6a80a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-build.xml
-javaCompiler...args \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.project b/jpa/plugins/org.eclipse.jpt.db.ui/.project
deleted file mode 100644
index 88ea5da610..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.db.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index ee4b8c1b90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:38 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 842c286bb1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:59:42 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 38a4d91ae9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.db.ui
-Bundle-Version: 1.0.0.qualifier
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jpt.db.ui.internal; x-friends:="org.eclipse.jpt.ui"
-Require-Bundle: org.eclipse.ui,
- org.eclipse.jpt.db,
- org.eclipse.datatools.connectivity.ui,
- org.eclipse.datatools.sqltools.editor.core
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/about.html b/jpa/plugins/org.eclipse.jpt.db.ui/about.html
deleted file mode 100644
index 9e73bdabb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>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
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>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
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/build.properties b/jpa/plugins/org.eclipse.jpt.db.ui/build.properties
deleted file mode 100644
index 0d56981f21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 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
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/component.xml b/jpa/plugins/org.eclipse.jpt.db.ui/component.xml
deleted file mode 100644
index bf648aaa4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.db.ui"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.db.ui" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties
deleted file mode 100644
index 2b0e5835b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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 = Java Persistence API Tools - DB UI
-providerName = Eclipse.org
-
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java b/jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java
deleted file mode 100644
index 632fe81411..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007 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.db.ui.internal;
-
-import org.eclipse.datatools.connectivity.ICategory;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IProfileListener;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.datatools.connectivity.internal.ConnectionProfileManager;
-import org.eclipse.datatools.connectivity.internal.ui.wizards.CPWizardNode;
-import org.eclipse.datatools.connectivity.internal.ui.wizards.NewCPWizard;
-import org.eclipse.datatools.connectivity.internal.ui.wizards.ProfileWizardProvider;
-import org.eclipse.datatools.connectivity.ui.wizards.IWizardCategoryProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.db.internal.ConnectionProfileRepository;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * ConnectionProfileUiTools
- */
-public class DTPUiTools {
-
- /**
- * Launch the DTP New Connection Profile wizard to create a new database connection profile.
- *
- * Returns the name of the added profile, or null if the wizard is cancelled. ConnectionProfileRepository
- * can be used to retrieve the added connection profile.
- */
- public static String createNewProfile() {
- NewCPWizard wizard;
- WizardDialog wizardDialog;
-
- // Filter datasource category
- ViewerFilter viewerFilter = new ViewerFilter() {
-
- public boolean select( Viewer viewer, Object parentElement, Object element) {
-
- CPWizardNode wizardNode = ( CPWizardNode) element;
- if( !( wizardNode.getProvider() instanceof IWizardCategoryProvider)) {
- ICategory cat = ConnectionProfileManager.getInstance().getProvider(
- (( ProfileWizardProvider) wizardNode.getProvider()).getProfile()).getCategory();
-
- // Only display wizards belong to database category
- while( cat != null) {
- if( cat.getId().equals( ConnectionProfileRepository.DATABASE_CATEGORY_ID))
- return true;
- else
- cat = cat.getParent();
- }
- }
- return false;
- }
- };
- wizard = new NewCPWizard( viewerFilter, null);
- Shell currentShell = Display.getCurrent().getActiveShell();
- wizardDialog = new WizardDialog( currentShell, wizard);
- wizardDialog.setBlockOnOpen( true);
-
- LocalProfileListener listener = new LocalProfileListener();
- ProfileManager.getInstance().addProfileListener( listener);
-
- if( wizardDialog.open() == Window.CANCEL) {
- ProfileManager.getInstance().removeProfileListener( listener);
- return null;
- }
- IConnectionProfile addedProfile = listener.addedProfile;
- ProfileManager.getInstance().removeProfileListener( listener);
-
- return addedProfile.getName();
- }
-
- private static class LocalProfileListener implements IProfileListener {
- IConnectionProfile addedProfile;
-
- public void profileAdded( IConnectionProfile profile) {
- addedProfile = profile;
- }
-
- public void profileChanged( IConnectionProfile profile) {
- // do nothing
- }
-
- public void profileDeleted( IConnectionProfile profile) {
- // do nothing
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/.classpath b/jpa/plugins/org.eclipse.jpt.db/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.db/.cvsignore b/jpa/plugins/org.eclipse.jpt.db/.cvsignore
deleted file mode 100644
index 814c6a80a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-build.xml
-javaCompiler...args \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db/.project b/jpa/plugins/org.eclipse.jpt.db/.project
deleted file mode 100644
index 5675a48e3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.db</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 797ea025b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:29 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 929d54536d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:59:18 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF
deleted file mode 100644
index a8da4753cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,15 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.db
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.jpt.db.internal.JptDbPlugin
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.jpt.db.internal
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.datatools.sqltools.editor.core,
- org.eclipse.jpt.utility
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/jpa/plugins/org.eclipse.jpt.db/about.html b/jpa/plugins/org.eclipse.jpt.db/about.html
deleted file mode 100644
index 9e73bdabb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>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
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>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
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.db/build.properties b/jpa/plugins/org.eclipse.jpt.db/build.properties
deleted file mode 100644
index 974eadac6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 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/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.db/component.xml b/jpa/plugins/org.eclipse.jpt.db/component.xml
deleted file mode 100644
index 644c396149..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.db"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.db" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db/plugin.properties b/jpa/plugins/org.eclipse.jpt.db/plugin.properties
deleted file mode 100644
index e87a2d3972..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/plugin.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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 = Java Persistence API Tools - DB
-providerName = Eclipse.org
-
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Catalog.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Catalog.java
deleted file mode 100644
index 0c4238e616..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Catalog.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.db.internal;
-
-import java.text.Collator;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-import org.eclipse.emf.common.util.EList;
-
-/**
- * Wrap a DTP Catalogs
- */
-final class Catalog extends DTPWrapper implements Comparable<Catalog> {
- private final Database database;
- final org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog;
- @SuppressWarnings("unused")
- private ICatalogObjectListener catalogListener; //TODO listen for change
-
- // ********** constructors **********
-
- Catalog( Database database, org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog) {
- super();
- this.database = database;
- this.dtpCatalog = dtpCatalog;
- }
-
- // ********** behavior **********
-
- @Override
- protected boolean connectionIsOnline() {
- return this.database.connectionIsOnline();
- }
-
- @SuppressWarnings("unused")
- private ICatalogObjectListener buildCatalogListener() {
- return new ICatalogObjectListener() {
- public void notifyChanged( final ICatalogObject catalog, final int eventType) {
- if( catalog == Catalog.this.dtpCatalog) {
-// Catalog.this.refresh();
-// Catalog.this.database.catalogChanged( Catalog.this, eventType);
- }
- }
- };
- }
-
- @Override
- protected void dispose() {
-// this.removeCatalogObjectListener(( ICatalogObject) this.dtpCatalog, this.catalogListener);
- }
-
- boolean wraps( org.eclipse.datatools.modelbase.sql.schema.Catalog catalog) {
- return this.dtpCatalog == catalog;
- }
-
- // ********** queries **********
-
- @Override
- public String getName() {
- return this.dtpCatalog.getName();
- }
-
- boolean isCaseSensitive() {
- return this.database.isCaseSensitive();
- }
-
- Column column( org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.database.column(dtpColumn);
- }
-
- // ***** schemata
-
- synchronized Set<Schema> buildSchemata() {
- EList<org.eclipse.datatools.modelbase.sql.schema.Schema> dtpSchemata = this.dtpSchemata();
-
- Set<Schema> result = new HashSet<Schema>( dtpSchemata.size());
- for (org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema : dtpSchemata) {
- result.add( this.wrap(dtpSchema));
- }
- return result;
- }
-
- @SuppressWarnings("unchecked")
- private EList<org.eclipse.datatools.modelbase.sql.schema.Schema> dtpSchemata() {
- return this.dtpCatalog.getSchemas();
- }
-
- private Schema wrap( org.eclipse.datatools.modelbase.sql.schema.Schema schema) {
-
- return new Schema( this.database, schema);
- }
-
- // ********** Comparable implementation **********
-
- public int compareTo( Catalog catalog) {
- return Collator.getInstance().compare( this.getName(), catalog.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Column.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Column.java
deleted file mode 100644
index 547ba01aad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Column.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.text.Collator;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-import org.eclipse.datatools.modelbase.sql.datatypes.DataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.PredefinedDataType;
-import org.eclipse.jpt.utility.internal.JavaType;
-import org.eclipse.jpt.utility.internal.NameTools;
-
-/**
- * Wrap a DTP Column
- */
-public final class Column extends DTPWrapper implements Comparable<Column> {
- private final Table table;
- private final org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn;
- private ICatalogObjectListener columnListener;
-
- // TODO Object is the default?
- private static final JavaType DEFAULT_JAVA_TYPE = new JavaType(java.lang.Object.class);
-
- private static final JavaType BLOB_JAVA_TYPE = new JavaType(java.sql.Blob.class);
- private static final JavaType BYTE_ARRAY_JAVA_TYPE = new JavaType(byte[].class);
-
- private static final JavaType CLOB_JAVA_TYPE = new JavaType(java.sql.Clob.class);
- private static final JavaType STRING_JAVA_TYPE = new JavaType(java.lang.String.class);
-
-
- // ********** constructors **********
-
- Column( Table table, org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- super();
- this.table = table;
- this.dtpColumn = dtpColumn;
- this.initialize();
- }
-
- // ********** behavior **********
-
- private void initialize() {
- if( this.connectionIsOnline()) {
- this.columnListener = this.buildColumnListener();
- this.addCatalogObjectListener(( ICatalogObject) this.dtpColumn, this.columnListener);
- }
- }
-
- @Override
- protected boolean connectionIsOnline() {
- return this.table.connectionIsOnline();
- }
-
- private ICatalogObjectListener buildColumnListener() {
- return new ICatalogObjectListener() {
- public void notifyChanged( final ICatalogObject column, final int eventType) {
-// TODO
-// if( column == Column.this.dtpColumn) {
-// Column.this.table.columnChanged( Column.this, eventType);
-// }
- }
- };
- }
-
- @Override
- protected void dispose() {
-
- this.removeCatalogObjectListener(( ICatalogObject) this.dtpColumn, this.columnListener);
- }
-
- // ********** queries **********
-
- @Override
- public String getName() {
- return this.dtpColumn.getName();
- }
-
- boolean isCaseSensitive() {
- return this.table.isCaseSensitive();
- }
-
- public String dataTypeName() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType == null) ? null : dataType.getName();
- }
-
- public String javaFieldName() {
- String jName = this.getName();
- if ( ! this.isCaseSensitive()) {
- jName = jName.toLowerCase();
- }
- return NameTools.convertToJavaIdentifier(jName);
- }
-
- public boolean matchesJavaFieldName(String javaFieldName) {
- return this.isCaseSensitive() ?
- this.getName().equals(javaFieldName)
- :
- this.getName().equalsIgnoreCase(javaFieldName);
- }
-
- /**
- * Return a Java type declaration that is reasonably
- * similar to the column's data type.
- */
- public String javaTypeDeclaration() {
- return this.javaType().declaration();
- }
-
- /**
- * Return a Java type that is reasonably
- * similar to the column's data type.
- */
- public JavaType javaType() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof PredefinedDataType) ?
- this.jpaSpecCompliantJavaType(DTPTools.javaTypeFor(((PredefinedDataType) dataType).getPrimitiveType()))
- :
- DEFAULT_JAVA_TYPE;
- }
-
- /**
- * The JDBC spec says JDBC drivers should be able to map BLOBs and CLOBs
- * directly, but the JPA spec does not allow them.
- */
- private JavaType jpaSpecCompliantJavaType(JavaType javaType) {
- if (javaType.equals(BLOB_JAVA_TYPE)) {
- return BYTE_ARRAY_JAVA_TYPE;
- }
- if (javaType.equals(CLOB_JAVA_TYPE)) {
- return STRING_JAVA_TYPE;
- }
- return javaType;
- }
-
- public boolean isLob() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof PredefinedDataType) ?
- DTPTools.dataTypeIsLob(((PredefinedDataType) dataType).getPrimitiveType())
- :
- false;
- }
-
- boolean wraps( org.eclipse.datatools.modelbase.sql.tables.Column column) {
- return this.dtpColumn == column;
- }
-
- // ********** Comparable implementation **********
-
- public int compareTo( Column column) {
- return Collator.getInstance().compare( this.getName(), column.getName());
- }
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Connection.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Connection.java
deleted file mode 100644
index 3e1e7365db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Connection.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.text.Collator;
-
-
-/**
- * Connection wrapper base class.
- */
-public abstract class Connection extends DTPWrapper implements Comparable<Connection> {
-
- // ********** constructors **********
-
- /**
- * Create a wrapper for the given IManagedConnection.
- */
- static Connection createConnection( org.eclipse.datatools.connectivity.IManagedConnection dtpConnection) {
- return ( dtpConnection == null) ? NullConnection.instance() : new DTPConnectionWrapper( dtpConnection);
- }
-
- Connection() {
- super();
- }
-
- // ********** listeners **********
-
- public abstract void addConnectionListener( ConnectionListener listener);
-
- public abstract void removeConnectionListener( ConnectionListener listener);
-
-
- // ********** behavior **********
-
- abstract void databaseChanged( Database database, int eventType);
-
- abstract void schemaChanged( Schema schema, Database database, int eventType);
-
- abstract void tableChanged( Table table, Schema schema, Database database, int eventType);
-
-
- // ********** queries **********
-
- public abstract boolean isConnected();
-
- public abstract String getFactoryId();
-
- @Override
- protected boolean connectionIsOnline() {
- return this.isConnected();
- }
-
- // ********** Comparable implementation **********
-
- public int compareTo(Connection connection) {
- return Collator.getInstance().compare( this.getName(), connection.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionListener.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionListener.java
deleted file mode 100644
index d778cbb1e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionListener.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-
-/**
- * ConnectionListener integrate th DTP IManagedConnectionListener listener.
- * This class purpose is to decouple from the DTP listeners by accepting wrappers as parameter.
- *
- * @see org.eclipse.datatools.connectivity.IManagedConnectionListener
- */
-public interface ConnectionListener {
-
- public void opened( Connection connection);
- public void modified( Connection connection);
- public boolean okToClose( Connection connection);
- public void aboutToClose( Connection connection);
- public void closed( Connection connection);
-
- public void databaseChanged( Connection connection, Database database);
- public void schemaChanged( Connection connection, Schema schema);
- public void tableChanged( Connection connection, Table table);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfile.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfile.java
deleted file mode 100644
index 13c8b8ed30..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfile.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.text.Collator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-
-/**
- * ConnectionProfile wrapper base class.
- */
-public abstract class ConnectionProfile extends DTPWrapper implements Comparable<ConnectionProfile> {
-
- private Connection connection; // Lazy initialized
- private Database database; // Lazy initialized
- private String catalogName; // Catalog used for this profile
-
- private ConnectionListener connectionListener;
-
- private ConnectionProfileRepository profileRepository;
-
- // ********** constructors **********
-
- static ConnectionProfile createProfile( ConnectionProfileRepository profileRepository, org.eclipse.datatools.connectivity.IConnectionProfile dtpProfile) {
- return ( dtpProfile == null) ? NullConnectionProfile.instance() : new DTPConnectionProfileWrapper( profileRepository, dtpProfile);
- }
-
- ConnectionProfile( ConnectionProfileRepository profileRepository) {
- super();
- this.profileRepository = profileRepository;
- this.connectionListener = buildConnectionListener();
- this.catalogName = "";
- }
-
- // ********** behavior **********
-
- public abstract void connect();
-
- public abstract void disconnect();
-
- protected abstract Connection buildConnection();
-
- protected abstract Database buildDatabase();
-
- abstract void databaseChanged( Database db, int eventType);
-
- abstract void catalogChanged( Catalog catalog, Database db, int eventType);
-
- abstract void schemaChanged( Schema schema, Database db, int eventType);
-
- abstract void tableChanged( Table table, Schema schema, Database db, int eventType);
-
- protected void refreshDatabase() {
- this.disposeDatabase();
- this.database = null;
- }
-
- @Override
- protected void dispose() {
- this.disengageConnectionListener();
-
- this.disposeConnection();
- this.disposeDatabase();
- }
-
- private void disposeConnection() {
- if( this.connection != null) {
- this.getConnection().dispose();
- }
- }
-
- private void disposeDatabase() {
- if( this.database != null) {
- this.getDatabase().dispose();
- }
- }
-
- // ********** queries **********
-
- public Connection getConnection() {
-
- if( this.connection == null) {
- this.connection = this.buildConnection();
- this.engageConnectionListener();
-
- }
- return this.connection;
- }
-
- public Database getDatabase() {
-
- if( this.database == null) {
- this.database = this.buildDatabase();
- this.setDefaultCatalogName();
- }
- return this.database;
- }
-
- public abstract String getDatabaseName();
-
- public abstract String getDatabaseProduct();
-
- public abstract String getDatabaseVendor();
-
- public abstract String getDatabaseVersion();
-
- public abstract String getDriverClass();
-
- public abstract String getUrl();
-
- public abstract String getUserName();
-
- public abstract String getUserPassword();
-
- public abstract String getInstanceId();
-
- public abstract String getProviderId();
-
- public abstract boolean isConnected();
-
- @Override
- protected boolean connectionIsOnline() {
- return this.isConnected();
- }
-
- abstract boolean wraps( org.eclipse.datatools.connectivity.IConnectionProfile dtpProfile);
-
- public boolean isNull() {
- return true;
- }
-
- ConnectionProfileRepository getProfileRepository() {
- return this.profileRepository;
- }
-
- public String getCatalogName() {
- return this.catalogName;
- }
-
- /**
- * Set the default catalog name for this profile.
- */
- public void setDefaultCatalogName() {
- this.setCatalogName( this.database.getDefaultCatalogName());
- }
-
- /**
- * Can only set the catalog to use for this profile, when the database supports catalogs.
- */
- public void setCatalogName( String catalogName) {
- if( this.catalogName == catalogName) {
- return;
- }
- if( this.database.supportsCatalogs()) {
- String name = ( catalogName != null) ? catalogName : this.database.getDefaultCatalogName();
-
- Catalog catalog = this.database.catalogNamed( name);
- if( catalog == null) {
- throw new NoSuchElementException();
- }
- this.catalogName = name;
- this.database.refresh();
- this.catalogChanged( catalog, this.database, ICatalogObjectListener.EventTypeEnumeration.ELEMENT_REFRESH);
- }
- else {
- this.catalogName = "";
- this.database.refresh();
- }
- }
-
- // ********** listeners **********
-
- abstract public void addProfileListener( ProfileListener listener);
-
- abstract public void removeProfileListener( ProfileListener listener);
-
- abstract public void addConnectionListener( ConnectionListener listener);
-
- abstract public void removeConnectionListener( ConnectionListener listener);
-
- private ConnectionListener buildConnectionListener() {
- return new ConnectionListener() {
-
- public void aboutToClose(Connection c) {
- // not interested to this event.
- }
-
- public void closed(Connection c) {
- ConnectionProfile.this.refreshDatabase();
- }
-
- public void modified(Connection c) {
- // not interested to this event.
- return;
- }
-
- public boolean okToClose(Connection c) {
- // not interested to this event.
- return true;
- }
-
- public void opened(Connection c) {
- ConnectionProfile.this.refreshDatabase();
- }
-
- public void databaseChanged(Connection c, final Database db) {
- // not interested to this event.
- return;
- }
-
- public void schemaChanged(Connection c, final Schema schema) {
- // not interested to this event.
- return;
- }
-
- public void tableChanged(Connection c, final Table table) {
- // not interested to this event.
- return;
- }
- };
- }
-
- protected void disengageConnectionListener() {
- this.removeConnectionListener();
- }
-
- protected void engageConnectionListener() {
- this.addConnectionListener();
- }
-
- private void addConnectionListener() {
- this.addConnectionListener( this.connectionListener);
- }
-
- private void removeConnectionListener() {
- this.removeConnectionListener( this.connectionListener);
- }
-
- // ********** Comparable implementation **********
-
- public int compareTo( ConnectionProfile connectionProfile) {
- return Collator.getInstance().compare( this.getName(), connectionProfile.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfileRepository.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfileRepository.java
deleted file mode 100644
index 25e7ea7acd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfileRepository.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IProfileListener;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * ConnectionProfileRepository is a mediator to the DTP ProfileManager.
- */
-public class ConnectionProfileRepository {
- private ProfileManager dtpProfileManager;
-
- private LocalRepositoryListener repositoryListener;
- private LocalProfileListener profileListener;
- private Set<ConnectionProfile> profiles;
-
- private static ConnectionProfileRepository INSTANCE;
-
- public static final String DATABASE_CATEGORY_ID = "org.eclipse.datatools.connectivity.db.category"; //$NON-NLS-1$
-
- /**
- * singleton support
- */
- public static ConnectionProfileRepository instance() {
- if (INSTANCE == null) {
- INSTANCE = new ConnectionProfileRepository();
- }
- return INSTANCE;
- }
-
- // ********** constructors **********
-
- private ConnectionProfileRepository() {
- super();
- this.dtpProfileManager = ProfileManager.getInstance();
- }
-
- // ********** behavior **********
-
- public void initializeListeners() {
-
- if( this.repositoryListener == null) {
- this.repositoryListener = new LocalRepositoryListener();
- this.dtpProfileManager.addProfileListener( this.repositoryListener);
- }
- if( this.profileListener == null) {
- this.profileListener = new LocalProfileListener();
- this.dtpProfileManager.addProfileListener( this.profileListener);
- }
- }
-
- public void disposeListeners() {
- for( Iterator<ConnectionProfile> stream = this.profiles(); stream.hasNext(); ) {
- stream.next().dispose();
- }
- if( this.repositoryListener != null) {
- this.dtpProfileManager.removeProfileListener( this.repositoryListener);
- this.repositoryListener = null;
- }
- if( this.profileListener != null) {
- this.dtpProfileManager.removeProfileListener( this.profileListener);
- this.profileListener = null;
- }
- }
-
- public Connection getConnectionWithProfileNamed( String name) {
- return this.profileNamed( name).getConnection();
- }
-
-
- @Override
- public String toString() {
- return this.profiles.toString();
- }
-
- // ********** profiles
-
- public Iterator<ConnectionProfile> profiles() {
- return this.getProfiles().iterator();
- }
-
- public Iterator<String> profileNames() {
- return new TransformationIterator<ConnectionProfile, String>( this.profiles()) {
- @Override
- protected String transform( ConnectionProfile profile) {
- return profile.getName();
- }
- };
- }
-
- public ConnectionProfile profileNamed( String name) {
- for( Iterator<ConnectionProfile> stream = this.profiles(); stream.hasNext(); ) {
- ConnectionProfile profile = stream.next();
- if( profile.getName().equals( name)) {
- return profile;
- }
- }
- return NullConnectionProfile.instance();
- }
-
- private Set<ConnectionProfile> getProfiles() {
-
- if( this.profiles == null) {
- this.profiles = this.buildProfiles();
- }
- return this.profiles;
- }
-
- private Set<ConnectionProfile> buildProfiles() {
- IConnectionProfile[] dtpProfiles = this.dtpProfileManager.getProfiles();
- Set<ConnectionProfile> result = new HashSet<ConnectionProfile>( dtpProfiles.length);
- for (IConnectionProfile dtpProfile : dtpProfiles) {
- result.add( ConnectionProfile.createProfile( this, dtpProfile));
- }
- return result;
- }
-
- void addProfile( IConnectionProfile dtpProfile) {
-
- if( !this.profileExists( dtpProfile)) {
- ConnectionProfile newProfile = ConnectionProfile.createProfile( ConnectionProfileRepository.this, dtpProfile);
- this.profiles.add( newProfile);
- }
- }
-
- void removeProfile( IConnectionProfile dtpProfile) {
-
- this.profiles.remove( this.getProfile( dtpProfile));
- }
-
- private boolean profileExists( IConnectionProfile dtpProfile) {
-
- return ( this.getProfile( dtpProfile) == null) ? false : true;
- }
-
- ConnectionProfile getProfile( IConnectionProfile dtpProfile) {
-
- for( Iterator<ConnectionProfile> stream = this.profiles(); stream.hasNext(); ) {
- ConnectionProfile profile = stream.next();
- if( profile.wraps( dtpProfile)) {
- return profile;
- }
- }
- return null;
- }
-
- // ********** listeners **********
-
- public void addProfileListener( ProfileListener listener) {
-
- this.profileListener.addProfileListener( listener);
- }
-
- public void removeProfileListener( ProfileListener listener) {
-
- this.profileListener.removeProfileListener( listener);
- }
-
- @SuppressWarnings("unused")
- private void addInternalProfileListener( IProfileListener listener) {
-
- this.dtpProfileManager.addProfileListener( listener);
- }
-
- @SuppressWarnings("unused")
- private void removeInternalProfileListener( IProfileListener listener) {
-
- this.dtpProfileManager.removeProfileListener( listener);
- }
-
- // ********** member class **********
- /**
- * Listens to ProfileManager events and updates the repository.
- */
- private class LocalRepositoryListener implements IProfileListener {
-
- LocalRepositoryListener() {
- super();
- }
-
- public void profileAdded( IConnectionProfile connectionProfile) {
- ConnectionProfileRepository.this.addProfile( connectionProfile);
- }
-
- public void profileChanged( IConnectionProfile connectionProfile) {
- // do nothing
- }
-
- public void profileDeleted( IConnectionProfile connectionProfile) {
- ConnectionProfileRepository.this.removeProfile( connectionProfile);
- }
- }
-
-
- /**
- * This listener translates and forwards IProfileListener events to ProfileListener.
- */
- private class LocalProfileListener implements IProfileListener {
- private Collection<ProfileListener> listeners = new ArrayList<ProfileListener>();
-
- LocalProfileListener() {
- super();
- }
-
- void addProfileListener( ProfileListener listener) {
- this.listeners.add( listener);
- }
-
- void removeProfileListener( ProfileListener listener) {
- this.listeners.remove( listener);
- }
-
- // ********** behavior **********
-
- public void profileAdded( IConnectionProfile dtpProfile) {
- ConnectionProfile profile = getProfile( dtpProfile);
- for (ProfileListener listener : this.listeners) {
- listener.profileAdded( profile);
- }
- }
-
- public void profileChanged( IConnectionProfile dtpProfile) {
- ConnectionProfile profile = getProfile( dtpProfile);
- for (ProfileListener listener : this.listeners) {
- listener.profileChanged( profile);
- }
- }
-
- public void profileDeleted( IConnectionProfile dtpProfile) {
- String profileName = dtpProfile.getName();
- for (ProfileListener listener : this.listeners) {
- listener.profileDeleted( profileName);
- }
- }
- }
-}
-
-
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java
deleted file mode 100644
index 478009d534..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.util.Properties;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.datatools.connectivity.IManagedConnection;
-import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants;
-import org.eclipse.datatools.sqltools.core.DatabaseIdentifier;
-import org.eclipse.datatools.sqltools.core.profile.ProfileUtil;
-
-/**
- * Wrap a DTP ConnectionProfile
- */
-public final class DTPConnectionProfileWrapper extends ConnectionProfile {
-
- final private org.eclipse.datatools.connectivity.IConnectionProfile dtpConnectionProfile;
-
- public static final String CONNECTION_TYPE = "java.sql.Connection"; //$NON-NLS-1$
- public static final String CONNECTION_PROFILE_TYPE = "org.eclipse.datatools.connectivity.db.generic.connectionProfile"; //$NON-NLS-1$
- public static final String DATABASE_PRODUCT_PROPERTY = "org.eclipse.datatools.connectivity.server.version"; //$NON-NLS-1$
- /**
- * This property is used in ConnectionProfile creation.
- */
- public static final String DATABASE_SAVE_PWD_PROP_ID = IDBDriverDefinitionConstants.PROP_PREFIX + "savePWD"; //$NON-NLS-1$
- /**
- * This property is used in ConnectionProfile creation.
- */
- public static final String DRIVER_DEFINITION_PROP_ID = "org.eclipse.datatools.connectivity.driverDefinitionID"; //$NON-NLS-1$
- /**
- * This property is used in DriverDefinition creation.
- */
- public static final String DRIVER_DEFINITION_TYPE_PROP_ID = "org.eclipse.datatools.connectivity.drivers.defnType"; //$NON-NLS-1$
- /**
- * This property is used in DriverDefinition creation.
- */
- public static final String DRIVER_JAR_LIST_PROP_ID = "jarList"; //$NON-NLS-1$
-
- // ********** constructors **********
-
- DTPConnectionProfileWrapper( ConnectionProfileRepository profileRepository, org.eclipse.datatools.connectivity.IConnectionProfile dtpConnectionProfile) {
- super( profileRepository);
- this.dtpConnectionProfile = dtpConnectionProfile;
- }
-
- // ********** listeners **********
-
- @Override
- public void addProfileListener( ProfileListener listener) {
-
- this.getProfileRepository().addProfileListener( listener);
- }
-
- @Override
- public void removeProfileListener( ProfileListener listener) {
-
- this.getProfileRepository().removeProfileListener( listener);
- }
-
- @Override
- public void addConnectionListener( ConnectionListener listener) {
-
- this.getConnection().addConnectionListener( listener);
- }
-
- @Override
- public void removeConnectionListener( ConnectionListener listener) {
-
- this.getConnection().removeConnectionListener( listener);
- }
-
- // ********** behavior **********
-
- private IManagedConnection buildDtpManagedConnection( org.eclipse.datatools.connectivity.IConnectionProfile dtpProfile) {
- return dtpProfile.getManagedConnection( CONNECTION_TYPE);
- }
- /**
- * Connect using this profile.
- */
- @Override
- public void connect() {
- if( !this.dtpConnectionProfile.isConnected()) {
-
- IStatus status = this.dtpConnectionProfile.connect();
- if( !status.isOK()) {
- if( status.isMultiStatus()) {
- IStatus[] statusChildren = status.getChildren();
- throw new RuntimeException( statusChildren[ 0].getMessage(), statusChildren[ 0].getException());
- }
- throw new RuntimeException( status.getMessage(), status.getException());
- }
- }
- }
-
- @Override
- public void disconnect() {
-
- IStatus status = this.dtpConnectionProfile.disconnect();
- if( !status.isOK()) {
- if( status.isMultiStatus()) {
- IStatus[] statusChildren = status.getChildren();
- throw new RuntimeException( statusChildren[ 0].getMessage(), statusChildren[ 0].getException());
- }
- throw new RuntimeException( status.getMessage(), status.getException());
- }
- }
-
- @Override
- void databaseChanged( Database database, int eventType) {
- this.getConnection().databaseChanged( database, eventType);
- return;
- }
-
- @Override
- void catalogChanged( Catalog catalog, Database database, int eventType) {
- //TODO
-// this.getConnection().catalogChanged( catalog, eventType);
- return;
- }
-
- @Override
- void schemaChanged( Schema schema, Database database, int eventType) {
- this.getConnection().schemaChanged( schema, database, eventType);
- }
-
- @Override
- void tableChanged( Table table, Schema schema, Database database, int eventType) {
- this.getConnection().tableChanged( table, schema, database, eventType);
- }
-
- // ********** queries **********
-
- @Override
- public boolean isConnected() {
-
- return this.getConnection().isConnected();
- }
-
- @Override
- public boolean isNull() {
- return false;
- }
-
- @Override
- public String getName() {
-
- return this.dtpConnectionProfile.getName();
- }
-
- @Override
- public String getDatabaseName() {
- return this.getProperties().getProperty( IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID);
- }
-
- @Override
- public String getDatabaseProduct() {
- return this.getProperties().getProperty( DATABASE_PRODUCT_PROPERTY);
- }
-
- @Override
- public String getDatabaseVendor() {
- return this.getProperties().getProperty( IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID);
- }
-
- @Override
- public String getDatabaseVersion() {
- return this.getProperties().getProperty( IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID);
- }
-
- @Override
- public String getUserName() {
- return this.getProperties().getProperty( IDBDriverDefinitionConstants.USERNAME_PROP_ID);
- }
-
- @Override
- public String getUserPassword() {
- return this.getProperties().getProperty( IDBDriverDefinitionConstants.PASSWORD_PROP_ID);
- }
-
- @Override
- public String getDriverClass() {
- return this.getProperties().getProperty( IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID);
- }
-
- @Override
- public String getUrl() {
- return this.getProperties().getProperty( IDBDriverDefinitionConstants.URL_PROP_ID);
- }
-
- @Override
- public String getInstanceId() {
- return this.dtpConnectionProfile.getInstanceID();
- }
-
- @Override
- public String getProviderId() {
- return this.dtpConnectionProfile.getProviderId();
- }
-
- private Properties getProperties() {
- return this.dtpConnectionProfile.getBaseProperties();
- }
-
- @Override
- protected Connection buildConnection() {
-
- Connection connection = Connection.createConnection( this.buildDtpManagedConnection( this.dtpConnectionProfile)); //$NON-NLS-1$
- return connection;
- }
-
- @Override
- protected Database buildDatabase() {
-
- org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase;
- if( this.isConnected()) {
- dtpDatabase = ProfileUtil.getDatabase( new DatabaseIdentifier( this.getName(), this.getDatabaseName()), false);
- return Database.createDatabase( this, dtpDatabase);
- }
- return NullDatabase.instance();
- }
-
- @Override
- boolean wraps( org.eclipse.datatools.connectivity.IConnectionProfile dtpProfile) {
- return this.dtpConnectionProfile == dtpProfile;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionWrapper.java
deleted file mode 100644
index 5440b35e3f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionWrapper.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.datatools.connectivity.ConnectEvent;
-import org.eclipse.datatools.connectivity.IManagedConnectionListener;
-
-/**
- * Wrap a DTP Connection
- */
-public final class DTPConnectionWrapper extends Connection {
-
- final private org.eclipse.datatools.connectivity.IManagedConnection dtpConnection;
- private LocalConnectionListener connectionListener;
-
- // ********** constructors **********
-
- DTPConnectionWrapper( org.eclipse.datatools.connectivity.IManagedConnection dtpConnection) {
- super();
- this.dtpConnection = dtpConnection;
- this.initialize();
- }
-
- // ********** behavior **********
-
- protected void initialize() {
- this.connectionListener = new LocalConnectionListener();
- this.dtpConnection.addConnectionListener( this.connectionListener);
- }
-
- @Override
- protected void dispose() {
- this.dtpConnection.removeConnectionListener( this.connectionListener);
- }
-
- @Override
- public String getName() {
-
- return this.dtpConnection.getConnection().getConnectionProfile().getName();
- }
-
- @Override
- public boolean isConnected() {
-
- return this.dtpConnection.isConnected();
- }
-
- @Override
- public String getFactoryId() {
-
- return this.dtpConnection.getFactoryID();
- }
-
- @Override
- void databaseChanged( Database database, int eventType) {
-
- this.connectionListener.databaseChanged( database, eventType);
- }
-
- @Override
- void schemaChanged( Schema schema, Database database, int eventType) {
-
- this.connectionListener.schemaChanged( schema, database, eventType);
- }
-
- @Override
- void tableChanged( Table table, Schema schema, Database database, int eventType) {
-
- this.connectionListener.tableChanged( table, schema, database, eventType);
- }
-
- // ********** listeners **********
-
- @Override
- public void addConnectionListener( ConnectionListener listener) {
- // hook up the specified listener to our intermediate listeners
- this.connectionListener.addConnectionListener( listener);
- }
-
- @Override
- public void removeConnectionListener( ConnectionListener listener) {
-
- this.connectionListener.removeConnectionListener( listener);
- }
-
- // ********** member classes **********
-
- /**
- * This listener translates and forwards IManagedConnectionListener events to ConnectionListeners.
- */
- private class LocalConnectionListener implements IManagedConnectionListener {
- private Collection<ConnectionListener> listeners = new ArrayList<ConnectionListener>();
-
- LocalConnectionListener() {
- super();
- }
-
- void addConnectionListener( ConnectionListener listener) {
- this.listeners.add( listener);
- }
-
- void removeConnectionListener( ConnectionListener listener) {
- this.listeners.remove( listener);
- }
-
- // ********** behavior **********
-
- public void aboutToClose( ConnectEvent event) {
- for (ConnectionListener listener : this.listeners) {
- listener.aboutToClose( DTPConnectionWrapper.this);
- }
- }
-
- public void closed( ConnectEvent event) {
- for (ConnectionListener listener : this.listeners) {
- listener.closed( DTPConnectionWrapper.this);
- }
- }
-
- public void modified( ConnectEvent event) {
- for (ConnectionListener listener : this.listeners) {
- listener.modified( DTPConnectionWrapper.this);
- }
- }
-
- public boolean okToClose( ConnectEvent event) {
- for (ConnectionListener listener : this.listeners) {
- if( !listener.okToClose( DTPConnectionWrapper.this)) {
- return false;
- }
- }
- return true;
- }
-
- public void opened( ConnectEvent event) {
- for (ConnectionListener listener : this.listeners) {
- listener.opened( DTPConnectionWrapper.this);
- }
- }
-
- void databaseChanged( Database database, int eventType) {
- for (ConnectionListener listener : this.listeners) {
- listener.databaseChanged( DTPConnectionWrapper.this, database);
- }
- }
-
- void schemaChanged( Schema schema, Database database, int eventType) {
- for (ConnectionListener listener : this.listeners) {
- listener.schemaChanged( DTPConnectionWrapper.this, schema);
- }
- }
-
- void tableChanged( Table table, Schema schema, Database database, int eventType) {
- for (ConnectionListener listener : this.listeners) {
- listener.tableChanged( DTPConnectionWrapper.this, table);
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java
deleted file mode 100644
index 4fd0f20a79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-import org.eclipse.emf.common.util.EList;
-
-/**
- * Wrap a DTP Database
- */
-public final class DTPDatabaseWrapper extends Database {
-
- final ConnectionProfile profile;
- final org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase;
- private ICatalogObjectListener databaseListener;
-
- private Set<Catalog> catalogs; // lazy-initialized
- private Set<Schema> schemata; // lazy-initialized
-
- DTPDatabaseWrapper( ConnectionProfile profile, org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase) {
- super();
- this.dtpDatabase = dtpDatabase;
- this.profile = profile;
- this.initialize();
- }
-
- // ********** behavior **********
-
- private void initialize() {
-
- if( this.connectionIsOnline()) {
- this.databaseListener = this.buildDatabaseListener();
- this.addCatalogObjectListener(( ICatalogObject) this.dtpDatabase, this.databaseListener);
- }
- }
-
- @Override
- protected boolean connectionIsOnline() {
- return this.profile.isConnected();
- }
-
- private ICatalogObjectListener buildDatabaseListener() {
- return new ICatalogObjectListener() {
- public void notifyChanged( final ICatalogObject database, final int eventType) {
- if( database == DTPDatabaseWrapper.this.dtpDatabase) {
- DTPDatabaseWrapper.this.refresh();
- DTPDatabaseWrapper.this.profile.databaseChanged( DTPDatabaseWrapper.this, eventType);
- }
- }
- };
- }
-
- @Override
- void refresh() {
- this.disposeSchemata();
- this.disposeCatalogs();
-
- this.schemata = null;
- this.catalogs = null;
- }
-
- @Override
- void catalogChanged( Catalog catalog, int eventType) {
- this.profile.catalogChanged( catalog, this, eventType);
- return;
- }
-
- @Override
- void schemaChanged( Schema schema, int eventType) {
- this.profile.schemaChanged( schema, this, eventType);
- return;
- }
-
- @Override
- void tableChanged( Table table, Schema schema, int eventType) {
- this.profile.tableChanged( table, schema, this, eventType);
- return;
- }
-
- @Override
- protected void dispose() {
- this.removeCatalogObjectListener(( ICatalogObject) this.dtpDatabase, this.databaseListener);
-
- this.disposeSchemata();
- this.disposeCatalogs();
- }
-
- private void disposeSchemata() {
- if( this.schemata != null) {
- for( Iterator<Schema> stream = this.schemata(); stream.hasNext(); ) {
- stream.next().dispose();
- }
- }
- }
-
- private void disposeCatalogs() {
- if( this.catalogs != null) {
- for( Iterator<Catalog> stream = this.catalogs(); stream.hasNext(); ) {
- stream.next().dispose();
- }
- }
- }
-
- // ********** queries **********
-
- @Override
- public String getName() {
-
- return this.dtpDatabase.getName();
- }
-
- @Override
- public String getVendor() {
-
- return this.dtpDatabase.getVendor();
- }
-
- @Override
- public String getVersion() {
-
- return this.dtpDatabase.getVersion();
- }
-
-
- // ***** schemata
-
- @Override
- synchronized Set<Schema> getSchemata() {
- if( this.schemata == null) {
- this.schemata = this.buildSchemata();
- }
- return this.schemata;
- }
-
- @SuppressWarnings("unchecked")
- private EList<org.eclipse.datatools.modelbase.sql.schema.Schema> dtpSchemata() {
- return this.dtpDatabase.getSchemas();
- }
-
- private Set<Schema> buildSchemata() {
- Set<Schema> result;
- if( this.supportsCatalogs()) {
- result = this.getSchemataForCatalogNamed( this.profile.getCatalogName());
- }
- else {
- EList<org.eclipse.datatools.modelbase.sql.schema.Schema> dtpSchemata = this.dtpSchemata();
- result = new HashSet<Schema>( dtpSchemata.size());
- for (org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema : dtpSchemata) {
- result.add( this.wrap(dtpSchema));
- }
- }
- return result;
- }
-
- // ***** catalogs
-
- @Override
- public boolean supportsCatalogs() {
- EList<org.eclipse.datatools.modelbase.sql.schema.Schema> dtpSchemata = this.dtpSchemata();
- return ( dtpSchemata == null || dtpSchemata.size() == 0);
- }
-
- @SuppressWarnings("unchecked")
- private EList<org.eclipse.datatools.modelbase.sql.schema.Catalog> dtpCatalogs() {
- return this.dtpDatabase.getCatalogs();
- }
-
- @Override
- public String getDefaultCatalogName() {
-
- if( !this.supportsCatalogs()) { // this database doesn't support catalogs
- return "";
- }
- String userName = this.profile.getUserName();
- for (org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog : this.dtpCatalogs()) {
- if( dtpCatalog.getName().length() == 0) { // special catalog that contains all schemata
- return "";
- }
- else if( dtpCatalog.getName().equals( userName)) {
- return userName; // returns user name as default catalog
- }
- }
- throw new NoSuchElementException();
- }
-
- @Override
- synchronized Set<Catalog> getCatalogs() {
- if( this.catalogs == null) {
- this.catalogs = this.buildCatalogs();
- }
- return this.catalogs;
- }
-
- private Set<Catalog> buildCatalogs() {
-
- EList<org.eclipse.datatools.modelbase.sql.schema.Catalog> dtpCatalogs = this.dtpCatalogs();
- if( dtpCatalogs == null) {
- return Collections.emptySet();
- }
- Set<Catalog> result = new HashSet<Catalog>( dtpCatalogs.size());
- for (org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog : dtpCatalogs) {
- result.add( this.wrap(dtpCatalog));
- }
- return result;
- }
-
- private Set<Schema> getSchemataForCatalogNamed( String catalogName) {
-
- Catalog catalog = this.catalogNamed( catalogName);
- return ( catalog != null) ? catalog.buildSchemata() : Collections.<Schema>emptySet();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTools.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTools.java
deleted file mode 100644
index 1c46efdfd5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTools.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.sql.Types;
-import java.util.HashMap;
-import org.eclipse.datatools.modelbase.sql.datatypes.PrimitiveType;
-import org.eclipse.jpt.utility.internal.JDBCTools;
-import org.eclipse.jpt.utility.internal.JDBCType;
-import org.eclipse.jpt.utility.internal.JavaType;
-
-/**
- * Helper methods for dealing with Eclipse DTP.
- */
-public final class DTPTools {
-
- /**
- * Return the JDBC type corresponding to the specified Primitive type.
- */
- public static JDBCType jdbcTypeForPrimitiveTypeNamed(String primitiveTypeName) {
- PrimitiveToJDBCTypeMapping mapping = primitiveToJDBCTypeMapping(primitiveTypeName);
- return (mapping == null) ? DEFAULT_JDBC_TYPE : mapping.getJDBCType();
- }
-
- /**
- * Return the JDBC type corresponding to the specified Primitive type.
- */
- public static JDBCType jdbcTypeFor(PrimitiveType primitiveType) {
- return jdbcTypeForPrimitiveTypeNamed(primitiveType.getName());
- }
-
- /**
- * Return the JDBC type corresponding to the specified Primitive type.
- */
- public static JDBCType jdbcTypeForPrimitiveTypeCode(int primitiveTypeCode) {
- return jdbcTypeFor(PrimitiveType.get(primitiveTypeCode));
- }
-
- /**
- * Return the Java type corresponding to the specified Primitive type.
- */
- public static JavaType javaTypeForPrimitiveTypeNamed(String primitiveTypeName) {
- return JDBCTools.javaTypeFor(jdbcTypeForPrimitiveTypeNamed(primitiveTypeName));
- }
-
- /**
- * Return the Java type corresponding to the specified Primitive type.
- */
- public static JavaType javaTypeFor(PrimitiveType primitiveType) {
- return JDBCTools.javaTypeFor(jdbcTypeFor(primitiveType));
- }
-
- /**
- * Return the Java type corresponding to the specified Primitive type.
- */
- public static JavaType javaTypeForPrimitiveTypeCode(int primitiveTypeCode) {
- return JDBCTools.javaTypeFor(jdbcTypeForPrimitiveTypeCode(primitiveTypeCode));
- }
-
- /**
- * Return whether the specified Primitive type is a LOB
- * (i.e. a BLOB, CLOB, or NCLOB).
- */
- public static boolean dataTypeIsLob(PrimitiveType primitiveType) {
- return (primitiveType == PrimitiveType.BINARY_LARGE_OBJECT_LITERAL)
- || (primitiveType == PrimitiveType.CHARACTER_LARGE_OBJECT_LITERAL)
- || (primitiveType == PrimitiveType.NATIONAL_CHARACTER_LARGE_OBJECT_LITERAL);
- }
-
-
- // ********** internal stuff **********
-
-
- // ********** DTP Primitive => JDBC **********
-
- /**
- * Primitive => JDBC type mappings, keyed by Primitive type name (e.g. "CHARACTER_VARYING")
- */
- private static HashMap<String, PrimitiveToJDBCTypeMapping> PRIMITIVE_TO_JDBC_TYPE_MAPPINGS; // pseudo 'final' - lazy-initialized
- private static final JDBCType DEFAULT_JDBC_TYPE = JDBCType.type(Types.VARCHAR); // TODO VARCHAR is the default?
-
-
- private static PrimitiveToJDBCTypeMapping primitiveToJDBCTypeMapping(String primitiveTypeName) {
- return primitiveToJDBCTypeMappings().get(primitiveTypeName);
- }
-
- private static synchronized HashMap<String, PrimitiveToJDBCTypeMapping> primitiveToJDBCTypeMappings() {
- if (PRIMITIVE_TO_JDBC_TYPE_MAPPINGS == null) {
- PRIMITIVE_TO_JDBC_TYPE_MAPPINGS = buildPrimitiveToJDBCTypeMappings();
- }
- return PRIMITIVE_TO_JDBC_TYPE_MAPPINGS;
- }
-
- private static HashMap<String, PrimitiveToJDBCTypeMapping> buildPrimitiveToJDBCTypeMappings() {
- HashMap<String, PrimitiveToJDBCTypeMapping> mappings = new HashMap<String, PrimitiveToJDBCTypeMapping>();
- addPrimitiveToJDBCTypeMappingsTo(mappings);
- return mappings;
- }
-
- /**
- * hard code the default mappings from the DTP primitive types to the
- * appropriate JDBC types;
- * pretty much a straight one-to-one mapping based on similar names;
- * TODO some JDBC types are missing: INTERVAL, XML_TYPE
- */
- private static void addPrimitiveToJDBCTypeMappingsTo(HashMap<String, PrimitiveToJDBCTypeMapping> mappings) {
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.BIGINT_LITERAL, Types.BIGINT, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.BINARY_LARGE_OBJECT_LITERAL, Types.BLOB, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.BINARY_LITERAL, Types.BINARY, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.BINARY_VARYING_LITERAL, Types.VARBINARY, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.BOOLEAN_LITERAL, Types.BOOLEAN, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.CHARACTER_LARGE_OBJECT_LITERAL, Types.CLOB, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.CHARACTER_LITERAL, Types.CHAR, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.CHARACTER_VARYING_LITERAL, Types.VARCHAR, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.DATALINK_LITERAL, Types.DATALINK, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.DATE_LITERAL, Types.DATE, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.DECIMAL_LITERAL, Types.DECIMAL, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.DOUBLE_PRECISION_LITERAL, Types.DOUBLE, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.FLOAT_LITERAL, Types.FLOAT, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.INTEGER_LITERAL, Types.INTEGER, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.INTERVAL_LITERAL, Types.OTHER, mappings); // ???
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.NATIONAL_CHARACTER_LARGE_OBJECT_LITERAL, Types.CLOB, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.NATIONAL_CHARACTER_LITERAL, Types.CHAR, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.NATIONAL_CHARACTER_VARYING_LITERAL, Types.VARCHAR, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.NUMERIC_LITERAL, Types.NUMERIC, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.REAL_LITERAL, Types.REAL, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.SMALLINT_LITERAL, Types.SMALLINT, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.TIME_LITERAL, Types.TIME, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.TIMESTAMP_LITERAL, Types.TIMESTAMP, mappings);
- addPrimitiveToJDBCTypeMappingTo(PrimitiveType.XML_TYPE_LITERAL, Types.OTHER, mappings); // ???
- }
-
- private static void addPrimitiveToJDBCTypeMappingTo(PrimitiveType primitiveType, int jdbcTypeCode, HashMap<String, PrimitiveToJDBCTypeMapping> mappings) {
- // check for duplicates
- Object prev = mappings.put(primitiveType.getName(), buildPrimitiveToJDBCTypeMapping(primitiveType, jdbcTypeCode));
- if (prev != null) {
- throw new IllegalArgumentException("duplicate Java class: " + ((PrimitiveToJDBCTypeMapping) prev).getPrimitiveType().getName());
- }
- }
-
- private static PrimitiveToJDBCTypeMapping buildPrimitiveToJDBCTypeMapping(PrimitiveType primitiveType, int jdbcTypeCode) {
- return new PrimitiveToJDBCTypeMapping(primitiveType, JDBCType.type(jdbcTypeCode));
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private DTPTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-
- // ********** member classes **********
-
- /**
- * Primitive => JDBC
- */
- private static class PrimitiveToJDBCTypeMapping {
- private final PrimitiveType primitiveType;
- private final JDBCType jdbcType;
-
- PrimitiveToJDBCTypeMapping(PrimitiveType primitiveType, JDBCType jdbcType) {
- super();
- this.primitiveType = primitiveType;
- this.jdbcType = jdbcType;
- }
-
- public PrimitiveType getPrimitiveType() {
- return this.primitiveType;
- }
-
- public JDBCType getJDBCType() {
- return this.jdbcType;
- }
-
- public boolean maps(PrimitiveType pt) {
- return this.primitiveType.equals(pt);
- }
-
- public boolean maps(String primitiveTypeName) {
- return this.primitiveType.getName().equals(primitiveTypeName);
- }
-
- public boolean maps(int primitiveTypeCode) {
- return this.primitiveType.getValue() == primitiveTypeCode;
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- this.appendTo(sb);
- return sb.toString();
- }
-
- public void appendTo(StringBuffer sb) {
- sb.append(this.primitiveType.getName());
- sb.append(" => ");
- this.jdbcType.appendTo(sb);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPWrapper.java
deleted file mode 100644
index 11e9808ec6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPWrapper.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-import org.eclipse.datatools.connectivity.sqm.core.rte.RefreshManager;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * DataTools Wrapper base class.
- */
-public abstract class DTPWrapper {
-
- DTPWrapper() {
- super();
- }
-
- // ********** behavior **********
-
- protected abstract void dispose();
-
- protected abstract boolean connectionIsOnline();
-
- protected void addCatalogObjectListener( ICatalogObject catalogObject, ICatalogObjectListener catalogObjectListener) {
- if( this.connectionIsOnline()) {
- RefreshManager.getInstance().AddListener( catalogObject, catalogObjectListener);
- }
- }
-
- protected void removeCatalogObjectListener( ICatalogObject catalogObject, ICatalogObjectListener catalogObjectListener) {
- if( this.connectionIsOnline()) {
- RefreshManager.getInstance().removeListener( catalogObject, catalogObjectListener);
- }
- }
-
- // ********** queries **********
-
- public abstract String getName();
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor( this, this.getName());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Database.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Database.java
deleted file mode 100644
index ab7f5656e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Database.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.text.Collator;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Database wrapper base class.
- */
-public abstract class Database extends DTPWrapper implements Comparable<Database> {
-
- private boolean caseSensitive = false; // TODO allow user to configure
-
- // ********** constructors **********
-
- static Database createDatabase( ConnectionProfile profile, org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase) {
- return ( dtpDatabase == null) ? NullDatabase.instance() : new DTPDatabaseWrapper( profile, dtpDatabase);
- }
-
- Database() {
- super();
- }
-
- // ********** behavior **********
-
- abstract void catalogChanged( Catalog catalog, int eventType);
-
- abstract void schemaChanged( Schema schema, int eventType);
-
- abstract void tableChanged( Table table, Schema schema, int eventType);
-
- abstract void refresh();
-
- protected Schema wrap( org.eclipse.datatools.modelbase.sql.schema.Schema schema) {
- return new Schema( this, schema);
- }
-
- protected Catalog wrap( org.eclipse.datatools.modelbase.sql.schema.Catalog catalog) {
- return new Catalog( this, catalog);
- }
-
- // ********** queries **********
-
- public abstract String getVendor();
-
- public abstract String getVersion();
-
- /**
- * return the column for the specified dtp column
- */
- Column column( org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.table( dtpColumn.getTable()).column( dtpColumn);
- }
-
- /**
- * return the table for the specified dtp table
- */
- Table table( org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return this.schema( dtpTable.getSchema()).table( dtpTable);
- }
-
- // ********** Comparable implementation **********
-
- public int compareTo( Database database) {
- return Collator.getInstance().compare( this.getName(), database.getName());
- }
-
- // ***** caseSensitive
-
- public boolean isCaseSensitive() {
- return this.caseSensitive;
- }
-
- public void setCaseSensitive( boolean caseSensitive) {
- this.caseSensitive = caseSensitive;
- }
-
- // ***** catalogs
-
- abstract Set<Catalog> getCatalogs();
-
- /**
- * Returns true if this database accepts catalogs.
- */
- public abstract boolean supportsCatalogs();
-
- /**
- * Returns the catalog to use by default.
- */
- public abstract String getDefaultCatalogName();
-
- public Iterator<Catalog> catalogs() {
- return this.getCatalogs().iterator();
- }
-
- public int catalogSize() {
- return this.getCatalogs().size();
- }
-
- public Iterator<String> catalogNames() {
- return new TransformationIterator<Catalog, String>( this.catalogs()) {
- @Override
- protected String transform( Catalog catalog) {
- return catalog.getName();
- }
- };
- }
-
- public boolean containsCatalogNamed( String name) {
- return this.catalogNamed( name) != null;
- }
-
- public Catalog catalogNamed( String name) {
- return this.isCaseSensitive() ? this.catalogNamedInternal( name) : this.catalogNamedIgnoreCase( name);
- }
-
- private Catalog catalogNamedInternal( String name) {
- for ( Iterator<Catalog> stream = this.catalogs(); stream.hasNext(); ) {
- Catalog catalog = stream.next();
- if ( catalog.getName().equals( name)) {
- return catalog;
- }
- }
- return null;
- }
-
- private Catalog catalogNamedIgnoreCase( String name) {
- for ( Iterator<Catalog> stream = this.catalogs(); stream.hasNext(); ) {
- Catalog catalog = stream.next();
- if ( StringTools.stringsAreEqualIgnoreCase( catalog.getName(), name)) {
- return catalog;
- }
- }
- return null;
- }
-
- /**
- * return the catalog for the specified dtp catalog
- */
- Catalog catalog( org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog) {
- for ( Iterator<Catalog> stream = this.catalogs(); stream.hasNext(); ) {
- Catalog catalog = stream.next();
- if (catalog.wraps( dtpCatalog)) {
- return catalog;
- }
- }
- throw new IllegalArgumentException( "invalid dtp catalog: " + dtpCatalog);
- }
-
-
- // ***** schemata
-
- abstract Set<Schema> getSchemata();
-
- public Iterator<Schema> schemata() {
- return this.getSchemata().iterator();
- }
-
- public int schemataSize() {
- return this.getSchemata().size();
- }
-
- public boolean schemataContains( Column column) {
- return this.getSchemata().contains( column);
- }
-
- public Iterator<String> schemaNames() {
- return new TransformationIterator<Schema, String>( this.schemata()) {
- @Override
- protected String transform( Schema schema) {
- return schema.getName();
- }
- };
- }
-
- public boolean containsSchemaNamed( String name) {
- return this.schemaNamed( name) != null;
- }
-
- public Schema schemaNamed( String name) {
- return this.isCaseSensitive() ? this.schemaNamedInternal( name) : this.schemaNamedIgnoreCase( name);
- }
-
- private Schema schemaNamedInternal( String name) {
- for ( Iterator<Schema> stream = this.schemata(); stream.hasNext(); ) {
- Schema schema = stream.next();
- if ( schema.getName().equals( name)) {
- return schema;
- }
- }
- return null;
- }
-
- private Schema schemaNamedIgnoreCase( String name) {
- for ( Iterator<Schema> stream = this.schemata(); stream.hasNext(); ) {
- Schema schema = stream.next();
- if ( StringTools.stringsAreEqualIgnoreCase( schema.getName(), name)) {
- return schema;
- }
- }
- return null;
- }
-
- /**
- * return the schema for the specified dtp schema
- */
- Schema schema( org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- for ( Iterator<Schema> stream = this.schemata(); stream.hasNext(); ) {
- Schema schema = stream.next();
- if ( schema.wraps( dtpSchema)) {
- return schema;
- }
- }
- throw new IllegalArgumentException( "invalid dtp schema: " + dtpSchema);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ForeignKey.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ForeignKey.java
deleted file mode 100644
index 6fc0501d6a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ForeignKey.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.text.Collator;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Wrap a DTP ForeignKey
- */
-public final class ForeignKey extends DTPWrapper implements Comparable<ForeignKey> {
- private final Table baseTable;
- private final org.eclipse.datatools.modelbase.sql.constraints.ForeignKey dtpForeignKey;
- private ICatalogObjectListener foreignKeyListener;
-
- private Table referencedTable; // lazy-initialized
- private Set<ColumnPair> columnPairs; // lazy-initialized
- private String defaultEntityFieldName; // lazy-initialized
- private boolean defaultEntityFieldNameCalculated = false;
-
-
- // ********** constructors **********
-
- ForeignKey(Table baseTable, org.eclipse.datatools.modelbase.sql.constraints.ForeignKey dtpForeignKey) {
- super();
- this.baseTable = baseTable;
- this.dtpForeignKey = dtpForeignKey;
- this.initialize();
- }
-
- // ********** behavior **********
-
- private void initialize() {
- if( this.connectionIsOnline()) {
- this.foreignKeyListener = this.buildForeignKeyListener();
- this.addCatalogObjectListener(( ICatalogObject) this.dtpForeignKey, this.foreignKeyListener);
- }
- }
-
- @Override
- protected boolean connectionIsOnline() {
- return this.baseTable.connectionIsOnline();
- }
-
- private ICatalogObjectListener buildForeignKeyListener() {
- return new ICatalogObjectListener() {
- public void notifyChanged( final ICatalogObject foreignKey, final int eventType) {
-// TODO
-// if( foreignKey == ForeignKey.this.dtpForeignKey) {
-// ForeignKey.this.baseTable.foreignKeyChanged( ForeignKey.this, eventType);
-// }
- }
- };
- }
-
- @Override
- protected void dispose() {
-
- this.removeCatalogObjectListener(( ICatalogObject) this.dtpForeignKey, this.foreignKeyListener);
- }
-
- // ********** queries **********
-
- public Table getBaseTable() {
- return this.baseTable;
- }
-
- @Override
- public String getName() {
- return this.dtpForeignKey.getName();
- }
-
- boolean isCaseSensitive() {
- return this.baseTable.isCaseSensitive();
- }
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.constraints.ForeignKey foreignKey) {
- return this.dtpForeignKey == foreignKey;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getName() + ": " + this.getColumnPairs());
- }
-
- public Table getReferencedTable() {
- if (this.referencedTable == null) {
- this.referencedTable = this.baseTable.table(this.dtpForeignKey.getUniqueConstraint().getBaseTable());
- }
- return this.referencedTable;
- }
-
- /**
- * return the foreign key's "base" columns
- */
- public Iterator<Column> baseColumns() {
- return new TransformationIterator<ColumnPair, Column>(this.columnPairs()) {
- @Override
- protected Column transform(ColumnPair pair) {
- return pair.getBaseColumn();
- }
- };
- }
-
- /**
- * return the foreign key's "base" columns that are not part of
- * the base table's primary key
- */
- public Iterator<Column> nonPrimaryKeyBaseColumns() {
- return new FilteringIterator<Column>(this.baseColumns()) {
- @Override
- protected boolean accept(Object o) {
- return ! ForeignKey.this.getBaseTable().primaryKeyColumnsContains((Column) o);
- }
- };
- }
-
- /**
- * return the foreign key's "referenced" columns
- */
- public Iterator<Column> referencedColumns() {
- return new TransformationIterator<ColumnPair, Column>(this.columnPairs()) {
- @Override
- protected Column transform(ColumnPair columnPair) {
- return columnPair.getReferencedColumn();
- }
- };
- }
-
- public String javaFieldName() {
- String fieldName = this.getDefaultEntityFieldName();
- return (fieldName == null) ?
- this.nonDefaultEntityFieldName()
- :
- fieldName;
- }
-
- public boolean matchesJavaFieldName(String javaFieldName) {
- return this.isCaseSensitive() ?
- javaFieldName.equals(this.getDefaultEntityFieldName())
- :
- javaFieldName.equalsIgnoreCase(this.getDefaultEntityFieldName());
- }
-
- public boolean isDefaultFor(String javaFieldName) {
- if (this.columnPairsSize() != 1) {
- return false;
- }
-
- if (this.getReferencedTable().primaryKeyColumnsSize() != 1) {
- return false;
- }
-
- ColumnPair columnPair = this.columnPairs().next();
- Column pkColumn = this.getReferencedTable().primaryKeyColumns().next();
- if (columnPair.getReferencedColumn() != pkColumn) {
- return false;
- }
-
- return columnPair.getBaseColumn().matchesJavaFieldName(javaFieldName + "_" + pkColumn.getName());
- }
-
-
- // ***** column pairs
-
- private synchronized Set<ColumnPair> getColumnPairs() {
- if (this.columnPairs == null) {
- this.columnPairs = this.buildColumnPairs();
- }
- return this.columnPairs;
- }
-
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> dtpBaseColumns() {
- return this.dtpForeignKey.getMembers();
- }
-
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> dtpRefColumns() {
- return this.dtpForeignKey.getUniqueConstraint().getMembers();
- }
-
- private Set<ColumnPair> buildColumnPairs() {
- List<org.eclipse.datatools.modelbase.sql.tables.Column> baseColumns = this.dtpBaseColumns();
- int size = baseColumns.size();
- List<org.eclipse.datatools.modelbase.sql.tables.Column> refColumns = this.dtpRefColumns();
- if (refColumns.size() != size) {
- throw new IllegalStateException("mismatched sizes: " + size + " vs. " + refColumns.size());
- }
- Set<ColumnPair> result = new HashSet<ColumnPair>(baseColumns.size());
- for (int i = baseColumns.size(); i-- > 0; ) {
- Column baseColumn = this.baseTable.column(baseColumns.get(i));
- Column refColumn = this.baseTable.column(refColumns.get(i));
- result.add(new ColumnPair(baseColumn, refColumn));
- }
- return result;
- }
-
- public Iterator<ColumnPair> columnPairs() {
- return this.getColumnPairs().iterator();
- }
-
- public int columnPairsSize() {
- return this.getColumnPairs().size();
- }
-
-
- // ***** default entity field name
-
- /**
- * If the name of the "base" column adheres to the EJB standard for a
- * default mapping (i.e. it ends with an underscore followed by the name
- * of the "referenced" column, and the "referenced" column is the single
- * primary key column of the "referenced" table), return the corresponding
- * default entity field name:
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.ID) => "CUBICLE"
- * Return a null if it does not adhere to the EJB standard:
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.CUBICLE_ID) => null
- */
- private String getDefaultEntityFieldName() {
- if ( ! this.defaultEntityFieldNameCalculated) {
- this.defaultEntityFieldNameCalculated = true;
- this.defaultEntityFieldName = this.buildDefaultEntityFieldName();
- }
- return this.defaultEntityFieldName;
- }
-
- /**
- * @see #getDefaultEntityFieldName()
- */
- private String buildDefaultEntityFieldName() {
- if ( ! this.referencesSingleColumnPrimaryKey()) {
- return null;
- }
- ColumnPair columnPair = this.columnPairs().next();
- String baseColName = columnPair.getBaseColumn().getName();
- String refColName = columnPair.getReferencedColumn().getName();
- if (baseColName.length() <= (refColName.length() + 1)) {
- return null;
- }
- if ( ! baseColName.endsWith(refColName)) {
- return null;
- }
- int _index = baseColName.length() - refColName.length() - 1;
- if (baseColName.charAt(_index) != '_') {
- return null;
- }
- String name = baseColName.substring(0, _index);
- return this.isCaseSensitive() ? name : name.toLowerCase();
- }
-
- /**
- * Return whether the foreign key references the primary key of the
- * "referenced" table and that primary key has only a single column.
- */
- public boolean referencesSingleColumnPrimaryKey() {
- if (this.columnPairsSize() != 1) {
- return false;
- }
- if (this.getReferencedTable().primaryKeyColumnsSize() != 1) {
- return false;
- }
-
- ColumnPair columnPair = this.columnPairs().next();
- return columnPair.getReferencedColumn() == this.getReferencedTable().primaryKeyColumns().next();
- }
-
- /**
- * If this is a simple (single-column) foreign key, return the java field
- * name of the single base column. If this is a compound foreign key,
- * return the java field name of the referenced table.
- */
- // TODO if there is only one FK to a given table, use the table's name instead of the column's name?
- // TODO if the FK column name ends with the PK column name, strip the PK column name?
- private String nonDefaultEntityFieldName() {
- return (this.columnPairsSize() == 1) ?
- this.columnPairs().next().getBaseColumn().javaFieldName()
- :
- this.getReferencedTable().javaFieldName();
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(ForeignKey foreignKey) {
- return Collator.getInstance().compare(this.getName(), foreignKey.getName());
- }
-
-
- // ********** member class **********
-
- public static class ColumnPair implements Comparable<ColumnPair> {
- private final Column baseColumn;
- private final Column referencedColumn;
-
- ColumnPair(Column baseColumn, Column referencedColumn) {
- super();
- this.baseColumn = baseColumn;
- this.referencedColumn = referencedColumn;
- }
-
- public Column getBaseColumn() {
- return this.baseColumn;
- }
-
- public Column getReferencedColumn() {
- return this.referencedColumn;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, baseColumn.getName() + "=>" + this.referencedColumn.getName());
- }
-
- public int compareTo(ColumnPair cp) {
- return Collator.getInstance().compare(this.getBaseColumn().getName(), cp.getBaseColumn().getName());
- }
-
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/JptDbPlugin.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/JptDbPlugin.java
deleted file mode 100644
index 0d9f21777f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/JptDbPlugin.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class JptDbPlugin extends Plugin {
- private ConnectionProfileRepository connectionProfileRepository;
-
- // The shared instance
- private static JptDbPlugin plugin;
-
- /**
- * Returns the shared instance
- */
- public static JptDbPlugin getDefault() {
- return plugin;
- }
-
- /**
- * The constructor
- */
- public JptDbPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- this.connectionProfileRepository = ConnectionProfileRepository.instance();
- this.connectionProfileRepository.initializeListeners();
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- this.connectionProfileRepository.disposeListeners();
- this.connectionProfileRepository = null;
- plugin = null;
- super.stop(context);
- }
-
-
- public ConnectionProfileRepository getConnectionProfileRepository() {
- return this.connectionProfileRepository;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnection.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnection.java
deleted file mode 100644
index f09563360a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnection.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-
-/**
- * NullConnection
- */
-public final class NullConnection extends Connection {
-
- private static NullConnection INSTANCE;
-
- /**
- * singleton support
- */
- static synchronized Connection instance() {
- if( INSTANCE == null) {
- INSTANCE = new NullConnection();
- }
- return INSTANCE;
- }
-
- private NullConnection() {
- super();
- }
-
- // ********** behavior **********
-
- @Override
- protected void dispose() {
- // do nothing
- }
-
- @Override
- public String getName() {
- return ClassTools.shortClassNameForObject( this);
- }
-
- @Override
- void databaseChanged( Database database, int eventType) {
- // do nothing
- }
-
- @Override
- void schemaChanged( Schema schema, Database database, int eventType) {
- // do nothing
- }
-
- @Override
- void tableChanged( Table table, Schema schema, Database database, int eventType) {
- // do nothing
- }
-
- @Override
- public boolean isConnected() {
- return false;
- }
-
- @Override
- public String getFactoryId() {
- return "";
- }
-
- @Override
- public void addConnectionListener( ConnectionListener listener) {
- // do nothing
- }
-
- @Override
- public void removeConnectionListener( ConnectionListener listener) {
- // do nothing
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnectionProfile.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnectionProfile.java
deleted file mode 100644
index deb6369283..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnectionProfile.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-
-/**
- * NullConnectionProfile
- */
-public final class NullConnectionProfile extends ConnectionProfile {
-
- private static NullConnectionProfile INSTANCE;
-
- /**
- * singleton support
- */
- static synchronized ConnectionProfile instance() {
- if( INSTANCE == null) {
- INSTANCE = new NullConnectionProfile();
- }
- return INSTANCE;
- }
-
- private NullConnectionProfile() {
- super( null);
- }
-
- // ********** behavior **********
-
- @Override
- protected Connection buildConnection() {
- return NullConnection.instance();
- }
-
- @Override
- protected Database buildDatabase() {
- return NullDatabase.instance();
- }
-
- @Override
- public void connect() {
- // do nothing
- }
-
- @Override
- public void disconnect() {
- // do nothing
- }
-
- @Override
- void databaseChanged( Database database, int eventType) {
- // do nothing
- }
-
- @Override
- void catalogChanged( Catalog catalog, Database database, int eventType) {
- // do nothing
- }
-
- @Override
- void schemaChanged( Schema schema, Database database, int eventType) {
- // do nothing
- }
-
- @Override
- void tableChanged( Table table, Schema schema, Database database, int eventType) {
- // do nothing
- }
-
- // ********** queries **********
-
- @Override
- public Connection getConnection() {
- return NullConnection.instance();
- }
-
- @Override
- public Database getDatabase() {
- return NullDatabase.instance();
- }
-
- @Override
- public String getName() {
- return ClassTools.shortClassNameForObject( this);
- }
-
- @Override
- public String getDatabaseName() {
- return "";
- }
-
- @Override
- public String getDatabaseProduct() {
- return "";
- }
-
- @Override
- public String getDatabaseVendor() {
- return "";
- }
-
- @Override
- public String getDatabaseVersion() {
- return "";
- }
-
- @Override
- public String getUserName() {
- return "";
- }
-
- @Override
- public String getUserPassword() {
- return "";
- }
-
- @Override
- public String getDriverClass() {
- return "";
- }
-
- @Override
- public String getUrl() {
- return "";
- }
-
- @Override
- public String getInstanceId() {
- return "";
- }
-
- @Override
- public String getProviderId() {
- return "";
- }
-
- @Override
- public boolean isConnected() {
- return false;
- }
-
- @Override
- boolean wraps( org.eclipse.datatools.connectivity.IConnectionProfile dtpProfile) {
- return false;
- }
-
- // ********** listeners **********
-
- @Override
- public void addProfileListener( ProfileListener listener) {
- // do nothing
- }
-
- @Override
- public void removeProfileListener( ProfileListener listener) {
- // do nothing
- }
-
- @Override
- public void addConnectionListener( ConnectionListener listener) {
- // do nothing
- }
-
- @Override
- public void removeConnectionListener( ConnectionListener listener) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullDatabase.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullDatabase.java
deleted file mode 100644
index fa316b82ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullDatabase.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.util.Collections;
-import java.util.Set;
-import org.eclipse.jpt.utility.internal.ClassTools;
-
-/**
- * NullDatabase
- */
-public final class NullDatabase extends Database {
-
- private static NullDatabase INSTANCE;
-
- /**
- * singleton support
- */
- static synchronized Database instance() {
- if( INSTANCE == null) {
- INSTANCE = new NullDatabase();
- }
- return INSTANCE;
- }
-
- private NullDatabase() {
- super();
- }
-
- // ********** behavior **********
-
- @Override
- void catalogChanged( Catalog catalog, int eventType) {
- // do nothing
- }
-
- @Override
- void schemaChanged( Schema schema, int eventType) {
- // do nothing
- }
-
- @Override
- void tableChanged( Table table, Schema schema,int eventType) {
- // do nothing
- }
-
- @Override
- void refresh() {
- // do nothing
- }
-
- @Override
- protected void dispose() {
- // do nothing
- }
-
- @Override
- protected boolean connectionIsOnline() {
- return false;
- }
-
- // ********** queries **********
-
- @Override
- public String getName() {
- return ClassTools.shortClassNameForObject( this);
- }
-
- @Override
- public String getVendor() {
- return this.getName();
- }
-
- @Override
- public String getVersion() {
- return "";
- }
-
- // ***** catalogs
-
- @Override
- public boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- public String getDefaultCatalogName() {
- return "";
- }
-
- @Override
- Set<Catalog> getCatalogs() {
- return Collections.emptySet();
- }
-
- // ***** schemata
-
- @Override
- Set<Schema> getSchemata() {
- return Collections.emptySet();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ProfileListener.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ProfileListener.java
deleted file mode 100644
index 677b38c031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ProfileListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-/**
- * ProfileListener integrate th DTP IProfileListener listener.
- * This class purpose is to decouple from the DTP listeners by accepting wrappers as parameter.
- *
- * @see org.eclipse.datatools.connectivity.IProfileListener
- */
-public interface ProfileListener {
- /**
- * The specified profile has been added.
- */
- public void profileAdded( ConnectionProfile profile);
-
- /**
- * The specified profile has been deleted.
- */
- public void profileDeleted( String profileName);
-
- /**
- * The specified profile has been modified. Modification includes
- * changes to any properties, the name, auto-connect flag, etc.
- */
- public void profileChanged( ConnectionProfile profile);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Schema.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Schema.java
deleted file mode 100644
index 9ef2c7fb04..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Schema.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.text.Collator;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Wrap a DTP Schema
- */
-public final class Schema extends DTPWrapper implements Comparable<Schema> {
- final Database database;
- final org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema;
- private ICatalogObjectListener schemaListener;
-
- private Set<Table> tables; // lazy-initialized
- private Set<Sequence> sequences; // lazy-initialized
-
-
- // ********** constructors **********
-
- Schema( Database database, org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- super();
- this.database = database;
- this.dtpSchema = dtpSchema;
- this.initialize();
- }
-
- // ********** behavior **********
-
- private void initialize() {
- if( this.connectionIsOnline()) {
- this.schemaListener = this.buildSchemaListener();
- this.addCatalogObjectListener(( ICatalogObject) this.dtpSchema, this.schemaListener);
- }
- }
-
- @Override
- protected boolean connectionIsOnline() {
- return this.database.connectionIsOnline();
- }
-
- private ICatalogObjectListener buildSchemaListener() {
- return new ICatalogObjectListener() {
- public void notifyChanged( final ICatalogObject schema, final int eventType) {
- if( schema == Schema.this.dtpSchema) {
- Schema.this.refresh();
- Schema.this.database.schemaChanged( Schema.this, eventType);
- }
- }
- };
- }
-
- void refresh() {
- this.disposeTables();
- this.disposeSequences();
-
- this.tables = null;
- this.sequences = null;
- }
-
- void tableChanged( Table table, int eventType) {
- this.database.tableChanged( table, this, eventType);
- }
-
- protected Table wrap( org.eclipse.datatools.modelbase.sql.tables.Table table) {
- return new Table( this, table);
- }
-
- protected Sequence wrap( org.eclipse.datatools.modelbase.sql.schema.Sequence sequence) {
- return new Sequence( this, sequence);
- }
-
- @Override
- protected void dispose() {
- this.removeCatalogObjectListener(( ICatalogObject) this.dtpSchema, this.schemaListener);
-
- this.disposeTables();
- this.disposeSequences();
- }
-
- private void disposeTables() {
- if( this.tables != null) {
- for( Iterator<Table> stream = this.tables(); stream.hasNext(); ) {
- stream.next().dispose();
- }
- }
- }
-
- private void disposeSequences() {
- if( this.sequences != null) {
- for( Iterator<Sequence> stream = this.sequences(); stream.hasNext(); ) {
- stream.next().dispose();
- }
- }
- }
-
- // ********** queries **********
-
- @Override
- public String getName() {
- return this.dtpSchema.getName();
- }
-
- boolean isCaseSensitive() {
- return this.database.isCaseSensitive();
- }
-
- Column column( org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.database.column(dtpColumn);
- }
-
-
- // ********** tables **********
-
- private synchronized Collection<Table> getTables() {
- if( this.tables == null) {
- this.tables = this.buildTables();
- }
- return this.tables;
- }
-
- @SuppressWarnings("unchecked")
- private Collection<org.eclipse.datatools.modelbase.sql.tables.Table> dtpTables() {
- return this.dtpSchema.getTables();
- }
-
- private Set<Table> buildTables() {
- Collection<org.eclipse.datatools.modelbase.sql.tables.Table> dtpTables = this.dtpTables();
- Set<Table> result = new HashSet<Table>( dtpTables.size());
- for (org.eclipse.datatools.modelbase.sql.tables.Table dtpTable : dtpTables) {
- result.add( this.wrap(dtpTable));
- }
- return result;
- }
-
- public Iterator<Table> tables() {
- return this.getTables().iterator();
- }
-
- public int tablesSize() {
- return this.getTables().size();
- }
-
- public boolean tablesContains( Column column) {
- return this.getTables().contains( column);
- }
-
- public Iterator<String> tableNames() {
- return new TransformationIterator<Table, String>( this.tables()) {
- @Override
- protected String transform( Table table) {
- return table.getName();
- }
- };
- }
-
- public boolean containsTableNamed( String name) {
- return this.tableNamed( name) != null;
- }
-
- public Table tableNamed( String name) {
- return this.isCaseSensitive() ? this.tableNamedInternal( name) : this.tableNamedIgnoreCase( name);
- }
-
- private Table tableNamedInternal( String name) {
- for( Iterator<Table> stream = this.tables(); stream.hasNext(); ) {
- Table table = stream.next();
- if( table.getName().equals( name)) {
- return table;
- }
- }
- return null;
- }
-
- private Table tableNamedIgnoreCase( String name) {
- for( Iterator<Table> stream = this.tables(); stream.hasNext(); ) {
- Table table = stream.next();
- if( StringTools.stringsAreEqualIgnoreCase( table.getName(), name)) {
- return table;
- }
- }
- return null;
- }
-
- /**
- * return the table for the specified dtp table
- */
- Table table( org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- if( dtpTable.getSchema() != this.dtpSchema) {
- return this.database.table( dtpTable);
- }
- for( Iterator<Table> stream = this.tables(); stream.hasNext(); ) {
- Table table = stream.next();
- if( table.wraps( dtpTable)) {
- return table;
- }
- }
- throw new IllegalArgumentException( "invalid DTP table: " + dtpTable);
- }
-
- // ***** sequences
-
- private synchronized Collection<Sequence> getSequences() {
- if( this.sequences == null) {
- this.sequences = this.buildSequences();
- }
- return this.sequences;
- }
-
- @SuppressWarnings("unchecked")
- private Collection<org.eclipse.datatools.modelbase.sql.schema.Sequence> dtpSequences() {
- return this.dtpSchema.getSequences();
- }
-
- private Set<Sequence> buildSequences() {
- Collection<org.eclipse.datatools.modelbase.sql.schema.Sequence> dtpSequences = this.dtpSequences();
- Set<Sequence> result = new HashSet<Sequence>( dtpSequences.size());
- for (org.eclipse.datatools.modelbase.sql.schema.Sequence dtpSequence : dtpSequences) {
- result.add( this.wrap(dtpSequence));
- }
- return result;
- }
-
- public Iterator<Sequence> sequences() {
- return this.getSequences().iterator();
- }
-
- public int sequencesSize() {
- return this.getSequences().size();
- }
-
- public boolean sequencesContains( Column column) {
- return this.getSequences().contains( column);
- }
-
- public Iterator<String> sequenceNames() {
- return new TransformationIterator<Sequence, String>(this.sequences()) {
- @Override
- protected String transform( Sequence sequence) {
- return sequence.getName();
- }
- };
- }
-
- public boolean containsSequenceNamed( String name) {
- return this.sequenceNamed( name) != null;
- }
-
- public Sequence sequenceNamed( String name) {
- return this.isCaseSensitive() ? this.sequenceNamedInternal( name) : this.sequenceNamedIgnoreCase( name);
- }
-
- private Sequence sequenceNamedInternal( String name) {
- for( Iterator<Sequence> stream = this.sequences(); stream.hasNext(); ) {
- Sequence sequence = stream.next();
- if( sequence.getName().equals( name)) {
- return sequence;
- }
- }
- return null;
- }
-
- private Sequence sequenceNamedIgnoreCase( String name) {
- for( Iterator<Sequence> stream = this.sequences(); stream.hasNext(); ) {
- Sequence sequence = stream.next();
- if( sequence.getName().equalsIgnoreCase( name)) {
- return sequence;
- }
- }
- return null;
- }
-
- boolean wraps( org.eclipse.datatools.modelbase.sql.schema.Schema schema) {
- return this.dtpSchema == schema;
- }
-
- // ********** Comparable implementation **********
-
- public int compareTo( Schema schema) {
- return Collator.getInstance().compare( this.getName(), schema.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Sequence.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Sequence.java
deleted file mode 100644
index 7cb68a47e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Sequence.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.text.Collator;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-
-/**
- * Wrap a DTP Sequence
- */
-public final class Sequence extends DTPWrapper implements Comparable<Sequence> {
- private final Schema schema;
- private final org.eclipse.datatools.modelbase.sql.schema.Sequence dtpSequence;
- private ICatalogObjectListener sequenceListener;
-
- Sequence( Schema schema, org.eclipse.datatools.modelbase.sql.schema.Sequence dtpSequence) {
- super();
- this.schema = schema;
- this.dtpSequence = dtpSequence;
- this.initialize();
- }
-
- // ********** behavior **********
-
- private void initialize() {
- if( this.connectionIsOnline()) {
- this.sequenceListener = this.buildSequenceListener();
- this.addCatalogObjectListener(( ICatalogObject) this.dtpSequence, this.sequenceListener);
- }
- }
-
- @Override
- protected boolean connectionIsOnline() {
- return this.schema.connectionIsOnline();
- }
-
- private ICatalogObjectListener buildSequenceListener() {
- return new ICatalogObjectListener() {
- public void notifyChanged( final ICatalogObject sequence, final int eventType) {
-// TODO
-// if( sequence == Sequence.this.dtpSequence) {
-// Sequence.this.schema.sequenceChanged( Sequence.this, eventType);
-// }
- }
- };
- }
-
-
- // ********** queries **********
-
- @Override
- protected void dispose() {
-
- this.removeCatalogObjectListener(( ICatalogObject) this.dtpSequence, this.sequenceListener);
- }
-
- @Override
- public String getName() {
- return this.dtpSequence.getName();
- }
-
- public int compareTo( Sequence sequence) {
- return Collator.getInstance().compare( this.getName(), sequence.getName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Table.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Table.java
deleted file mode 100644
index 7b49b72f8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Table.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.internal;
-
-import java.text.Collator;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-import org.eclipse.datatools.modelbase.sql.constraints.PrimaryKey;
-import org.eclipse.datatools.modelbase.sql.tables.BaseTable;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.NameTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Wrap a DTP Table
- */
-public final class Table extends DTPWrapper implements Comparable<Table> {
- final Schema schema;
- final org.eclipse.datatools.modelbase.sql.tables.Table dtpTable;
- private ICatalogObjectListener tableListener;
-
- private Set<Column> columns; // lazy-initialized
- private Set<Column> primaryKeyColumns; // lazy-initialized
- private Set<ForeignKey> foreignKeys; // lazy-initialized
- private Set<Column> foreignKeyColumns; // lazy-initialized
-
- // ********** constructors **********
-
- Table(Schema schema, org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- super();
- this.schema = schema;
- this.dtpTable = dtpTable;
- this.initialize();
- }
-
-
- // ********** behavior **********
-
- private void initialize() {
- if( this.connectionIsOnline()) {
- this.tableListener = this.buildTableListener();
- this.addCatalogObjectListener(( ICatalogObject) this.dtpTable, this.tableListener);
- }
- }
-
- @Override
- protected boolean connectionIsOnline() {
- return this.schema.connectionIsOnline();
- }
-
- private ICatalogObjectListener buildTableListener() {
- return new ICatalogObjectListener() {
- public void notifyChanged( final ICatalogObject table, final int eventType) {
- if( table == Table.this.dtpTable) {
- Table.this.refresh();
- Table.this.schema.tableChanged( Table.this, eventType);
- }
- }
- };
- }
-
- void refresh() {
- this.disposeColumns();
-
- this.columns = null;
- this.primaryKeyColumns = null;
- this.foreignKeys = null;
- this.foreignKeyColumns = null;
- }
-
- @Override
- protected void dispose() {
- this.removeCatalogObjectListener(( ICatalogObject) this.dtpTable, this.tableListener);
-
- this.disposeColumns();
- this.disposeForeignKey();
- }
-
- private void disposeColumns() {
- if( this.columns != null) {
- for( Iterator<Column> stream = this.columns(); stream.hasNext(); ) {
- stream.next().dispose();
- }
- }
- }
-
- private void disposeForeignKey() {
- if( this.foreignKeys != null) {
- for( Iterator<ForeignKey> stream = this.foreignKeys(); stream.hasNext(); ) {
- stream.next().dispose();
- }
- }
- }
-
- // ********** queries **********
-
- @Override
- public String getName() {
- return this.dtpTable.getName();
- }
-
- boolean isCaseSensitive() {
- return this.schema.isCaseSensitive();
- }
-
- public String shortJavaClassName() {
- String jName = this.getName();
- if ( ! this.isCaseSensitive()) {
- jName = StringTools.capitalize(jName.toLowerCase());
- }
- return NameTools.convertToJavaIdentifier(jName);
- }
-
- public boolean matchesShortJavaClassName(String shortJavaClassName) {
- return this.isCaseSensitive() ?
- this.getName().equals(shortJavaClassName)
- :
- this.getName().equalsIgnoreCase(shortJavaClassName);
- }
-
- public String javaFieldName() {
- String jName = this.getName();
- if ( ! this.isCaseSensitive()) {
- jName = jName.toLowerCase();
- }
- return NameTools.convertToJavaIdentifier(jName);
- }
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.tables.Table table) {
- return this.dtpTable == table;
- }
-
- /**
- * return the table for the specified DTP table
- */
- Table table(org.eclipse.datatools.modelbase.sql.tables.Table table) {
- return this.schema.table(table);
- }
-
- // ***** columns
-
- private synchronized Set<Column> getColumns() {
- if (this.columns == null) {
- this.columns = this.buildColumns();
- }
- return this.columns;
- }
-
- @SuppressWarnings("unchecked")
- private Collection<org.eclipse.datatools.modelbase.sql.tables.Column> dtpColumns() {
- return this.dtpTable.getColumns();
- }
-
- private Set<Column> buildColumns() {
- Collection<org.eclipse.datatools.modelbase.sql.tables.Column> dtpColumns = this.dtpColumns();
- Set<Column> result = new HashSet<Column>(dtpColumns.size());
- for (org.eclipse.datatools.modelbase.sql.tables.Column c : dtpColumns) {
- result.add(new Column(this, c));
- }
- return result;
- }
-
- public Iterator<Column> columns() {
- return this.getColumns().iterator();
- }
-
- public int columnsSize() {
- return this.getColumns().size();
- }
-
- public boolean columnsContains(Column column) {
- return this.getColumns().contains(column);
- }
-
- public Iterator<String> columnNames() {
- return new TransformationIterator<Column, String>(this.columns()) {
- @Override
- protected String transform(Column next) {
- return next.getName();
- }
- };
- }
-
- public boolean containsColumnNamed(String name) {
- return this.columnNamed(name) != null;
- }
-
- public Column columnNamed(String name) {
- return this.isCaseSensitive() ? this.columnNamedInternal(name) : this.columnNamedIgnoreCase(name);
- }
-
- private Column columnNamedInternal(String name) {
- for (Iterator<Column> stream = this.columns(); stream.hasNext(); ) {
- Column column = stream.next();
- if (column.getName().equals(name)) {
- return column;
- }
- }
- return null;
- }
-
- private Column columnNamedIgnoreCase(String name) {
- for (Iterator<Column> stream = this.columns(); stream.hasNext(); ) {
- Column column = stream.next();
- if (StringTools.stringsAreEqualIgnoreCase(column.getName(), name)) {
- return column;
- }
- }
- return null;
- }
-
- /**
- * return the column for the specified dtp column
- */
- Column column(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- if (dtpColumn.getTable() != this.dtpTable) {
- return this.schema.column(dtpColumn);
- }
- for (Iterator<Column> stream = this.columns(); stream.hasNext(); ) {
- Column column = stream.next();
- if (column.wraps(dtpColumn)) {
- return column;
- }
- }
- throw new IllegalArgumentException("invalid dtp column: " + dtpColumn);
- }
-
-
- // ***** primaryKeyColumns
-
- private synchronized Set<Column> getPrimaryKeyColumns() {
- if (this.primaryKeyColumns == null) {
- this.primaryKeyColumns = this.buildPrimaryKeyColumns();
- }
- return this.primaryKeyColumns;
- }
-
- @SuppressWarnings("unchecked")
- private Collection<org.eclipse.datatools.modelbase.sql.tables.Column> columns(PrimaryKey pk) {
- return pk.getMembers();
- }
-
- private Set<Column> buildPrimaryKeyColumns() {
- if ( ! (this.dtpTable instanceof BaseTable)) {
- return Collections.emptySet();
- }
- PrimaryKey pk = ((BaseTable) this.dtpTable).getPrimaryKey();
- if (pk == null) {
- // no PK was defined
- return Collections.emptySet();
- }
- Collection<org.eclipse.datatools.modelbase.sql.tables.Column> pkColumns = this.columns(pk);
- Set<Column> result = new HashSet<Column>(pkColumns.size());
- for (org.eclipse.datatools.modelbase.sql.tables.Column pkColumn : pkColumns) {
- result.add(this.column(pkColumn));
- }
- return result;
- }
-
- public Iterator<Column> primaryKeyColumns() {
- return this.getPrimaryKeyColumns().iterator();
- }
-
- public int primaryKeyColumnsSize() {
- return this.getPrimaryKeyColumns().size();
- }
-
- public boolean primaryKeyColumnsContains(Column column) {
- return this.getPrimaryKeyColumns().contains(column);
- }
-
-
- // ***** foreignKeys
-
- private synchronized Set<ForeignKey> getForeignKeys() {
- if (this.foreignKeys == null) {
- this.foreignKeys = this.buildForeignKeys();
- }
- return this.foreignKeys;
- }
-
- @SuppressWarnings("unchecked")
- private Collection<org.eclipse.datatools.modelbase.sql.constraints.ForeignKey> dtpForeignKeys() {
- return ((BaseTable) this.dtpTable).getForeignKeys();
- }
-
- private Set<ForeignKey> buildForeignKeys() {
- if ( ! (this.dtpTable instanceof BaseTable)) {
- return Collections.emptySet();
- }
- Collection<org.eclipse.datatools.modelbase.sql.constraints.ForeignKey> dtpForeignKeys = this.dtpForeignKeys();
- Set<ForeignKey> result = new HashSet<ForeignKey>(dtpForeignKeys.size());
- for (org.eclipse.datatools.modelbase.sql.constraints.ForeignKey dtpForeignKey : dtpForeignKeys) {
- result.add(new ForeignKey(this, dtpForeignKey));
- }
- return result;
- }
-
- public Iterator<ForeignKey> foreignKeys() {
- return this.getForeignKeys().iterator();
- }
-
- public int foreignKeysSize() {
- return this.getForeignKeys().size();
- }
-
-
- // ***** foreignKeyColumns
-
- private synchronized Set<Column> getForeignKeyColumns() {
- if (this.foreignKeyColumns == null) {
- this.foreignKeyColumns = this.buildForeignKeyColumns();
- }
- return this.foreignKeyColumns;
- }
-
- private Set<Column> buildForeignKeyColumns() {
- if ( ! (this.dtpTable instanceof BaseTable)) {
- return Collections.emptySet();
- }
- Set<Column> result = new HashSet<Column>(this.columnsSize());
- for (Iterator<ForeignKey> stream = this.foreignKeys(); stream.hasNext(); ) {
- CollectionTools.addAll(result, stream.next().baseColumns());
- }
- return result;
- }
-
- public Iterator<Column> foreignKeyColumns() {
- return this.getForeignKeyColumns().iterator();
- }
-
- public int foreignKeyColumnsSize() {
- return this.getForeignKeyColumns().size();
- }
-
- public boolean foreignKeyColumnsContains(Column column) {
- return this.getForeignKeyColumns().contains(column);
- }
-
- // ********** Comparable implementation **********
-
- public int compareTo( Table table) {
- return Collator.getInstance().compare( this.getName(), table.getName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/.project b/jpa/plugins/org.eclipse.jpt.doc.user/.project
deleted file mode 100644
index 61670ff4fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.doc.user</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF
deleted file mode 100644
index a3e8ae5c6a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.doc.user;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Eclipse-LazyStart: true
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/about.html b/jpa/plugins/org.eclipse.jpt.doc.user/about.html
deleted file mode 100644
index 794af750a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/about.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:59 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>About this content</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="About this content" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref250" name="sthref250"></a>
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>About this content</h1>
-</td>
-</tr>
-</table>
-<p>June 06, 2007</p>
-<a id="sthref251" name="sthref251"></a>
-<p class="subhead2">License</p>
-<p>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 <code><a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></code>. For purposes of the EPL, "Program" will mean the Content.</p>
-<p>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 <code><a href="http://www.eclipse.org">http://www.eclipse.org</a></code>.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/build.properties b/jpa/plugins/org.eclipse.jpt.doc.user/build.properties
deleted file mode 100644
index ade565e3e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/build.properties
+++ /dev/null
@@ -1,102 +0,0 @@
-bin.includes = cheatsheets/,\
- dcommon/,\
- img/,\
- META-INF/,\
- about.html,\
- build.properties,\
- concept_mapping.htm,\
- concept_persistence.htm,\
- concepts.htm,\
- concepts001.htm,\
- concepts002.htm,\
- concepts003.htm,\
- contexts.xml,\
- getting_started.htm,\
- getting_started001.htm,\
- getting_started002.htm,\
- getting_started003.htm,\
- getting_started004.htm,\
- getting_started005.htm,\
- getting_started006.htm,\
- getting_started007.htm,\
- getting_started008.htm,\
- getting_started009.htm,\
- getting_started010.htm,\
- getting_started011.htm,\
- getting_started012.htm,\
- getting_started013.htm,\
- getting_started014.htm,\
- getting_started015.htm,\
- getting_started016.htm,\
- getting_started017.htm,\
- getting_started018.htm,\
- getting_started019.htm,\
- index.xml,\
- legal.htm,\
- plugin.properties,\
- plugin.xml,\
- ref_details_orm.htm,\
- ref_jpa_facet.htm,\
- ref_mapping_general.htm,\
- ref_new_jpa_project.htm,\
- ref_new_jpa_project_wizard.htm,\
- ref_persistence_map_view.htm,\
- ref_persistence_outline.htm,\
- ref_persistence_perspective.htm,\
- ref_persistence_prop_view.htm,\
- ref_primary_key.htm,\
- ref_project_properties.htm,\
- reference.htm,\
- reference001.htm,\
- reference002.htm,\
- reference003.htm,\
- reference004.htm,\
- reference005.htm,\
- reference006.htm,\
- reference007.htm,\
- reference008.htm,\
- reference009.htm,\
- reference010.htm,\
- reference011.htm,\
- reference012.htm,\
- reference013.htm,\
- reference014.htm,\
- reference015.htm,\
- reference016.htm,\
- reference017.htm,\
- task_add_persistence.htm,\
- task_additonal_tables.htm,\
- task_create_new_project.htm,\
- task_generate_entities.htm,\
- task_inheritance.htm,\
- task_manage_orm.htm,\
- task_manage_persistence.htm,\
- task_mapping.htm,\
- tasks.htm,\
- tasks001.htm,\
- tasks002.htm,\
- tasks003.htm,\
- tasks004.htm,\
- tasks005.htm,\
- tasks006.htm,\
- tasks007.htm,\
- tasks008.htm,\
- tasks009.htm,\
- tasks010.htm,\
- tasks011.htm,\
- tasks012.htm,\
- tasks013.htm,\
- tasks014.htm,\
- tasks015.htm,\
- tasks016.htm,\
- tasks017.htm,\
- tasks018.htm,\
- tasks019.htm,\
- tasks020.htm,\
- tasks021.htm,\
- tips_and_tricks.htm,\
- toc.xml,\
- whats_new.htm,\
- whats_new001.htm,\
- whats_new002.htm,\
- whats_new003.htm
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml b/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml
deleted file mode 100644
index 6dbeedbeca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cheatsheet title="Create a JPA Project">
- <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
- This cheat sheet will automatically launch wizards, perform actions, and guide you through the steps to create a JPA project.
-
-To learn more about using cheat sheets, or to see a list of available cheat sheets, click Help (?).
-To start work working on this cheat sheet click the &quot;Click to Begin&quot; button below.
-
-Let&apos;s get started!
- </description>
- </intro>
- <item title="Setup the Environment" dialog="false" skip="true" href="/org.eclipse.datatools.doc.user/c_database_development_setup.html">
- <description>
- Your environment must be set up before you can perform the steps in this cheat sheet.
-
-Create a database profile and connect to the database.
-
-The Database Connection dialog automatically appears when you click the &quot;Click to Perform&quot; button.
- </description>
- <command serialization="org.eclipse.datatools.sqltools.sqleditor.attachProfileAction" confirm="false">
- </command>
- </item>
- <item title="Create a JPA Project" dialog="false" skip="false" href="/org.eclipse.jpt.doc.user/task_create_new_project.htm">
- <description>
- Use the New Project Wizard to create a JPA project.
-Select <b>File-&gt;New-&gt;Project...</b> and choose <b>JPA-&gt;JPA Project</b> in the list.
-
-On the first page of the wizard, enter a project name and location, select your target runtime, and select a predefined project configuration.
-
-Click <b>Next</b> to display the next page of the wizard.
-
-The &quot;New JPA Project&quot; wizard is automatically displayed when you click the &quot;Click to Perform&quot; button.
- </description>
- <action class="org.eclipse.jdt.internal.ui.wizards.OpenProjectWizardAction" pluginId="org.eclipse.jdt.ui" confirm="false">
- </action>
- </item>
- <item title="Select Project Facet" dialog="false" skip="false" href="/org.eclipse.jst.j2ee.doc.user/topics/ph-projects.html">
- <description>
- Use the Project Facet page to select a predefined project configuration or specific specific facets to include in the project.
-
-Click &quot;Next&quot; to display the next page of the wizard.
- </description>
- </item>
- <item title="Specify the JPA Facet" dialog="false" skip="false" href="/org.eclipse.jdt.doc.user/ref_jpa_facet.htm">
- <description>
- Use the JPA Facet page to specify the the vendor-specific JPA platform, the database connection to use, and the specific JPA implementation library.
-
-You can also specify if Dali should create an orm.xml file.
-
-If you do not have an active database connection, click <b>Add Connections</b> to create one.
-
-If you do not have a defined JPA implementation library, click <b>Configure default JPA implementation library</b> or <b>Configure user libraries</b> to define one.
-
-Click <b>Finish</b> to complete the wizard and open the open the project.
- </description>
- </item>
- <item title="Finish" dialog="false" skip="false">
- <description>
- Congratulations! You have successfully created a JPA project. Complete the additional cheat sheets to add Java persistent entities and map those entities to database tables.
- </description>
- </item>
-</cheatsheet>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml b/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml
deleted file mode 100644
index b64e8afdee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cheatsheet title="Create a Persistent Entity">
- <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
-This cheat sheet will automatically launch wizards, perform actions, and guide you through the steps to add a Java persistent entity to your Java project.
-To learn more about using cheat sheets or to see a list of available cheat sheets, click Help (?).
-To start work working on this cheat sheet, click the <b>Click to Begin</b> button below.
-Let's get started!
- </description>
- </intro>
- <item title="Create a JPA Project" skip="true">
- <description>
-To create a Persistent entity, you must create a JPA project. If you already have a JPA project, you may skip this step by clicking the "Click to Skip" button.
-If not, select <b>File->New->Project...</b> and choose <b>JPA->JPA Project</b> in the list. Complete each page of the Create JPA Project wizard to create a new JPA project.
- </description>
- </item>
- <item title="Open the JPA Development Perspective" skip="true" href="/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm">
- <action pluginId="org.eclipse.ui.cheatsheets" class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" param1="org.eclipse.jpt.ui.PersistencePerspective"/>
- <description>
-When working with JPA persistence, you should use the Persistence perspective. If you already have the Persistence perspective active, you may skip this step by clicking the "Click to Skip" button.
-If not, select <b>Window->Open Perspective->Other</b> in the menubar at the top of the workbench. In the Select Perspectives dialog, select <b>JPA Development</b> and click OK. This step changes the perspective to set up the Eclipse workbench for JPA development.
-You can click the "Click to Perform" button to have the "Persistence" perspective opened automatically.
- </description>
- </item>
- <item title="Create a Java Class">
- <description>
-The next step is to create a new Java class. In the main toolbar again, click on <b>New Java Class</b> button (or the link below).
-The Java editor will automatically open showing your new class.
- </description>
- </item>
- <item title="Create a Persistent Entity">
- <description>
-Finally we will make the Java class a persistent entity.
-In the JPA Structure view select the Java class.
-In the JPA Details view, use the "Map As" field to select <b>Entity</b>. Dali automatically adds the @Entity annotation to the class in the Java editor.
-Use the Table, Catalog, and Schema fields to associate the entity with a specific table in the database.
- </description>
- </item>
- <item title="Finish">
- <description>
-Congratulations! You have successfully added a JPA entity to your JPA project. Complete the additional cheat sheets to map the entity's fields to database tables.
- </description>
- </item>
-</cheatsheet>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml b/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml
deleted file mode 100644
index 63307f226e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cheatsheet title="Map a Java Persistent Entity">
- <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
- This cheat sheet will automatically launch wizards, perform actions, and guide you through the steps to map the fields of a JPA entity entity to your database.
-
-To learn more about using cheat sheets or to see a list of available cheat sheets, click Help (?).
-To start work working on this cheat sheet, click the &quot;Click to Begin&quot; button below.
-
-Let&apos;s get started!
- </description>
- </intro>
- <item title="Setup the Environment" dialog="false" skip="true" href="/org.eclipse.datatools.doc.user/c_database_development_setup.html">
- <description>
- Your environment must be set up before you can perform the steps in this cheat sheet.
-
-Create a database profile and connect to the database.
-
-If you already have (and are connected to) a database connection, you may skip this step by clicking the &quot;Click to Skip&quot; button.
-
-The Database Connection dialog automatically appears when you click the &quot;Click to Perform&quot; button.
- </description>
- <command serialization="org.eclipse.datatools.sqltools.sqleditor.attachProfileAction" confirm="false">
- </command>
- </item>
- <item title="Create a JPA Project" dialog="false" skip="true" href="/org.eclipse.jpt.doc.user/task_create_new_project.htm">
- <description>
- Use the New Project Wizard to create a JPA project.
-Select <b>File-&gt;New-&gt;Project...</b> and choose <b>JPA-&gt;JPA Project</b> in the list.
-
-Complete each page of the wizard to create a new JPA project.
-
-The &quot;New JPA Project&quot; wizard is automatically displayed when you click the &quot;Click to Perform&quot; button.
-
-If you already have a JPA project, you may skip this step by clicking the &quot;Click to Skip&quot; button.
- </description>
- <action class="org.eclipse.jdt.internal.ui.wizards.OpenProjectWizardAction" pluginId="org.eclipse.jdt.ui" confirm="false">
- </action>
- </item>
- <item title="Open the JPA Development Perspective" dialog="false" skip="true" href="/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm">
- <description>
- When working with JPA persistence, you should use the Persistence perspective. If you already have the Persistence perspective active, you may skip this step by clicking the &quot;Click to Skip&quot; button.
-If not, select <b>Window-&gt;Open Perspective-&gt;Other</b> in the menubar at the top of the workbench. In the Select Perspectives dialog, select <b>JPA Development</b> and click OK. This step changes the perspective to set up the Eclipse workbench for JPA development.
-You can click the &quot;Click to Perform&quot; button to have the &quot;Persistence&quot; perspective opened automatically.
- </description>
- <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.jpt.ui.PersistencePerspective">
- </action>
- </item>
- <item title="Create a Java Class" dialog="false" skip="false">
- <description>
- The next step is to create a new Java class. In the main toolbar again, click on <b>New Java Class</b> button (or the link below).
-The Java editor will automatically open showing your new class.
- </description>
- </item>
- <item title="Create a Persistent Entity" dialog="false" skip="false">
- <description>
- Finally we will make the Java class a persistent entity.
-In the JPA Structure view select the Java class.
-In the JPA Details view, use the &quot;Map As&quot; field to select <b>Entity</b>. Dali automatically adds the @Entity annotation to the class in the Java editor.
-Use the Table, Catalog, and Schema fields to associate the entity with a specific table in the database.
- </description>
- </item>
- <item title="Add Fields to the Class" dialog="false" skip="true">
- <description>
- Now you will add some fields to the entity to map to rows in the database table.
-
-If your persistent entity already has fields to map, you may skip this step by clicking the &quot;Click to Skip&quot; button. If not, use the Java editor to add fields to the entity.
- </description>
- <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.dali.ui.PersistencePerspective">
- </action>
- </item>
- <item title="Create the Mapping" dialog="false" skip="false" href="/org.eclipse.dali.doc.user/ref_entity_page.htm">
- <description>
- Now you are ready to map the entity fields to columns in the database table. In the Package Explorer, select the Java class.
-
-In the JPA Structure view, expand the persistent entity to display the fields. Select a field.
-
-The JPA Details view displays the information for the field. Use the Map As field to select the Basic mapping. Use the Column field to select a column from the database table.
- </description>
- <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.dali.ui.PersistencePerspective">
- </action>
- </item>
- <item title="Finish" dialog="false" skip="false">
- <description>
- Congratulations! You have successfully mapped the fields from a Java persistent entity to a column in a database table.
- </description>
- </item>
-</cheatsheet>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm
deleted file mode 100644
index c17e916319..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Understanding OR mappings</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Understanding OR mappings" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABBDJFI" name="BABBDJFI"></a></p>
-<div class="sect1">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Understanding OR mappings</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref44" name="sthref44"></a><a id="sthref45" name="sthref45"></a>The Dali OR (object-relational) Mapping Tool allows you to describe how your entity objects <span class="italic">map</span> to the data source (or other objects). This approach isolates persistence information from the object model&ndash;developers are free to design their ideal object model, and DBAs are free to design their ideal schema.</p>
-<p>These mappings transform an object data member type to a corresponding relational database data source representation. These OR mappings can also transform object data members that reference other domain objects stored in other tables in the database and are related through foreign keys.</p>
-<p>You can use these mappings to map simple data types including primitives (such as <code>int</code>), JDK classes (such as <code>String</code>), and large object (LOB) values. You can also use them to transform object data members that reference other domain objects by way of association where data source representations require object identity maintenance (such as sequencing and back references) and possess various types of multiplicity and navigability. The appropriate mapping class is chosen primarily by the cardinality of the relationship.</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm
deleted file mode 100644
index cf984163c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Understanding Java persistence</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Understanding Java persistence" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABCAHIC" name="BABCAHIC"></a></p>
-<div class="sect1">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Understanding Java persistence</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref42" name="sthref42"></a><span class="italic">Persistence</span> refers to the ability to store objects in a database and use those objects with transactional integrity. In a J2EE application, data is typically stored and persisted in the data tier, in a relational database.</p>
-<p><a id="sthref43" name="sthref43"></a><span class="italic">Entity beans</span> are enterprise beans that contain persistent data and that can be saved in various persistent data stores. The entity beans represent data from a database; each entity bean carries its own identity. Entity beans can be deployed using <span class="italic">application-managed persistence</span> or <span class="italic">container-managed persistence</span>.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm
deleted file mode 100644
index e709730f90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Concepts</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content=" Concepts" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="sthref41" name="sthref41"></a></p>
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Concepts</h1>
-</td>
-</tr>
-</table>
-<p>This section contains an overview of concepts you should be familiar with when using Dali to create mappings for Java persistent entities.</p>
-<ul>
-<li type="disc">
-<p><a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a></p>
-</li>
-<li type="disc">
-<p><a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a></p>
-</li>
-<li type="disc">
-<p><a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></p>
-</li>
-</ul>
-<p>In addition to these sections, you should review the following resources for additional information:</p>
-<ul>
-<li type="disc">
-<p>Eclipse Dali project: <code><a href="http://www.eclipse.org/webtools/dali">http://www.eclipse.org/webtools/dali</a></code></p>
-</li>
-<li type="disc">
-<p>Eclipse Web Tools Platform project: <code><a href="http://www.eclipse.org/webtools">http://www.eclipse.org/webtools</a></code></p>
-</li>
-<li type="disc">
-<p>JSR 220 EJB 3.0 specification: <code><a href="http://www.jcp.org/en/jsr/detail?id=220">http://www.jcp.org/en/jsr/detail?id=220</a></code></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm
deleted file mode 100644
index c9ac9b2dae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Understanding EJB 3.0 Java Persistence API</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Understanding EJB 3.0 Java Persistence API" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABBGFJG" name="BABBGFJG"></a></p>
-<div class="sect1">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Understanding EJB 3.0 Java Persistence API</h1>
-</td>
-</tr>
-</table>
-<p>The Java 2 Enterprise Edition(J2EE) Enterprise JavaBeans (EJB) are a component architecture that you use to develop and deploy object-oriented, distributed, enterprise-scale applications. An application written according to the Enterprise JavaBeans architecture is scalable, transactional, and secure.</p>
-<p>The EJB 3.0 Java Persistence API (JPA) improves the EJB architecture by reducing its complexity through the use of metadata (annotations) and specifying programmatic defaults of that metadata.</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm
deleted file mode 100644
index 2d86027a37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>The persistence.xml file</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="The persistence.xml file" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CHDHAGIH" name="CHDHAGIH"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1><a id="sthref46" name="sthref46"></a>The persistence.xml file</h1>
-</td>
-</tr>
-</table>
-<p>The JPA specification requires the use of a <code>persistence.xml</code> file for deployment. This file defines the database and entity manager options, and may contain more than one persistence unit. Dali can use the Eclipse XML Editor to create and maintain this information. See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for more information.</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm
deleted file mode 100644
index 5f4bd90908..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>The orm.xml file</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="The orm.xml file" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CHDBIJAC" name="CHDBIJAC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1><a id="sthref47" name="sthref47"></a>The orm.xml file</h1>
-</td>
-</tr>
-</table>
-<p>Although the JPA specification emphasizes the use of annotations to specify persistence, you can also the <code>orm.xml</code> file to store this metadata. Dali can use the Eclipse XML Editor to create and maintain this information. The metadata must match the XSD specification of your selected JPA implementation. See <a href="task_manage_orm.htm#CIHDGDCD">"Managing the orm.xml file"</a> for more information.</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_orm.htm#CIHDGDCD">Managing the orm.xml file</a><br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml b/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml
deleted file mode 100644
index 34de0ef6d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml
+++ /dev/null
@@ -1,422 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.contexts"?>
-<contexts>
- <context id="entity_accessType">
- <description>Specify how the variable is accessed: Property (default) or Field.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_name">
- <description>The name of this entity. By default, the class name is used as the entity name.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_table">
- <description>The database table assigned to this entity. By default, the class name is used as the database table name.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverrides">
- <description>Specify a property or field to be overridden (from the default mappings).</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesName">
- <description>Name of the database column.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesColumn">
- <description>The database column that overrides a property or field.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesInsertable">
- <description>Specifies if the column is always included in SQL INSERT statements.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesUpdatable">
- <description>Specifies if the column is always included in SQL UPDATE statements.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="mapping_mapAs">
- <description>Specify how this attribute maps to the database.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_column">
- <description>The database column that contains the value for the attribute.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_columnTable">
- <description>Name of the database table that contains the selected column.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_columnInsertable">
- <description>Specifies if the column is always included in SQL INSERT statements.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_columnUpdatable">
- <description>Specifies if the column is always included in SQL UPDATE statements.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_fetchType">
- <description>Defines how data is loaded from the database: Eager (default) or Lazy</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_optional">
- <description>Specifies if this field is can be null.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_generatedValueStrategy">
- <description>Determines how the primary key is generated: Auto (default), Sequence, Identity, or Table.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_generatedValueGeneratorName">
- <description>Unique name of the generator.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_targetEntity">
- <description>The entity to which this attribute is mapped. </description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_cascadeType">
- <description>Specify which operations are propagated throughout the entity: All, Persist, Merge, or Move.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_mappedBy">
- <description>The field in the database table that owns the relationship.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_joinColumnName">
- <description>The name of the database column that contains the foreign key reference for the entity association.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_joinReferencedColumn">
- <description>Name of the join table that contains the foreign key column.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_embeddedAttributeOverrides">
- <description>Specify to override the default mapping of an entity’s attribute.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_embeddedAttributeOverridesColumn">
- <description>The database column that is being mapped to the entity’s attribute.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="entity_mapAs">
- <description>Specify the type of persistent domain object for the Java class: Persistent, Embedded, or Mapped Superclass.</description>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_inheritanceStrategy">
- <description>Specify how an entity may inherit properties from other entities: Single table, One table per class, or Joined tables.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="entity_inheritanceDiscriminatorColumn">
- <description>Use to specify the name of the discriminator column when using a Single or Joined inheritance strategy.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="entity_inheritanceDiscriminatorType">
- <description>Use this field to set the discriminator type to CHAR or INTEGER (instead of its default: String). The discriminator value must conform to this type.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="entity_inheritanceDiscriminatorValue">
- <description>Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified discriminator type.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="mapping_orderBy">
- <description>Specify the default order for objects returned from a query.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an Entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_joinTableName">
- <description>Specify the name of the database table that defines the foreign key for a many-to-many or a unidirectional one-to-many association. You can configure the join table with a specific catalog or schema, configure one or more join table columns with a unique constraint, and use multiple join columns per entity.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_joinTableJoinColumns">
- <description>Specify two or more join columns (that is, a composite primary key).</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_joinTableInverseJoinColumns">
- <description>Specify the join column on the owned (or inverse side) of the association: the owned entity's primary key column. </description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="properties_javaPersistence">
- <description>Use the Java Persistence options on the Properties page to select the database connection to use with the project.</description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Adding persistence" href="ref_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="properties_javaPersistenceConnection">
- <description>The database connection used to map the persistent entities.</description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="properties_javaPersistenceSchema">
- <description>The database schema used to map the persistent entities.</description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="dialog_addPersistence">
- <description>Use the Add Persistence dialog to define the database connection use to store the persistence entities.</description>
- <topic label="Adding persistence" href="ref_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="persistenceOutline">
- <description>The JPA Structure view displays an outline of the structure (its attributes and mappings) of the entity that is currently selected or opened in the editor.</description>
- <topic label="JPA Structure view" href="ref_persistence_outline.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="dialog_generateEntities">
- <description>Use the Generate Entities dialog to create Java persistent entities based on your database tables.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm.htm" />
- <topic label="Project properties" href="ref_project_properties"/>
- </context>
- <context id="dialog_generateEntities_source">
- <description>The project folder name in which to generate the Java persistent entities. Click Browse to select an existing folder.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm"/>
- </context>
- <context id="dialog_generateEntities_package">
- <description>The package in which to generate the Java persistent entities, or click Browse to select an existing package.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm"/>
- </context>
- <context id="dialog_generateEntities_tables">
- <description>Select the tables from which to create Java persistent entities.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm"/>
- <topic label="Project properties" href="ref_project_properties"/>
- </context>
- <context id="dialog_addJavaPersistence">
- <description>Use this dialog to define the database connection used to store the persistence entities and to create the persistence.xml file.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence.htm" />
- </context>
- <context id="dialog_newJPAProject">
- <description>Use this dialog to define the new JPA project name, its location, target runtime, and other configuration settings.</description>
- <topic label="New JPA Project page" href="ref_new_jpa_project.htm" />
- <topic label="New JPA Project wizard" href="ref_new_jpa_project_wizard" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- <topic label="Creating a new JPA project" href="task_create_new_project.htm" />
- </context>
- <context id="dialog_addJavaPersistence_database">
- <description>Use these fields to define the database connection used to store the persistent entities.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- </context>
- <context id="dialog_addJavaPersistence_classpath">
- <description>Use this option to add libraries or JARs that contain the Java Persistence API (JPA) and entities to the project’s Java Build Path.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- </context>
- <context id="dialog_addJavaPersistence_packaging">
- <description>Use these fields to create the persistence.xml file. Select the persistence version, the name of the JPA provider, and a unique name to identify the persistence unit.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence.htm" />
- </context>
- <context id="wizard_generateDDL_options ">
- <description>Use this page to select which script options will be included in the generated script.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- <topic label="Options page " href="ref_options.htm" />
- </context>
- <context id="wizard_generateDDL_objects ">
- <description>Use this page to select which elements will be included in the generated script.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- <topic label="Objects page " href="ref_objects.htm" />
- </context>
- <context id="wizard_generateDDL_save ">
- <description>Use this page to select the filename and location of the generated script. You can also preview the script and specify to run or continue editing the script after generation.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- <topic label="Save and Run DDL page " href="ref_save_and_run.htm" />
- </context>
- <context id="wizard_generateDDL_summary ">
- <description>This page shows the settings that you selected for the generated DDL. To change any option click "Back" or click "Finish" to continue.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- </context>
- <context id="mapping_tableGeneratorName">
- <description>The name of the table sequence generator. This name is global to to the persistence unit (across all generator types).</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorTable">
- <description>The database table that stores the generated ID values. </description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorPrimaryKeyColumn">
- <description>The database column of the generator table that stores the generated ID values.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorValueColumn">
- <description>The name for the column that stores the generated ID values.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorPrimaryKeyColumnValue">
- <description>The database column of the generator table that defines the primary key value.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="dialog_databaseAuthorization">
- <description>Use to connect (log in) to a database connection to use with your Java persistent entities.
- You must have a defined database connection (and be connected) to add persistence. </description>
- <topic label="Add persistence to a Java project" href="task_add_persistence_project.htm"/>
- </context>
- <context id="mapping_temporal">
- <description>Specify if the mapped field contains a Date (java.sql.Date), Time (java.sql.Time), or Timestamp (java.sql.Timestamp) value.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_primaryKeyGeneration">
- <description>Define how the primary key is generated</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGenerator">
- <description>Specify to use a specific database table for generating the primary key.</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_sequenceGenerator">
- <description>Specify to use a specific sequence for generating the primary key.</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_sequenceGeneratorName">
- <description>Name of the sequence.</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_sequenceGeneratorSequence">
- <description> </description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_lob">
- <description>Specify if the field is mapped to java.sql.Clob or java.sql.Blob.</description>
- <topic label="General information" href="ref_mapping_general.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_enumerated">
- <description>Specify how to persist enumerated constraints if the String value suits your application requirements or to match an existing database schema.</description>
- <topic label="General information" href="ref_mapping_general.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="dialog_editInverseJoinColumn">
- <description>.</description>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="entity_catalog">
- <description>The database catalog that contains the Table. This field overrides the defaults in the orm.xml file.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_schema">
- <description>The database schema that contains the Table. This field overrides the defaults in the orm.xml file.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="orm_package">
- <description>The Java package that contains the persistent entities to which the orm.xml file applies.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_schema">
- <description>The database schema to use as the default for all entities managed by this persistence unit.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_catalog">
- <description>The database catalog to use as the default for all entities managed by this persistence unit.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_access">
- <description>The default access method for variables in this project: Property or Field.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_cascade">
- <description>Adds cascade-persist to the set of cascade options in entity relationships of the persistence unit.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_xml">
- <description>Specifies that the Java classes in this persistence unit are fully specified by their metadata. Any annotations will be ignored.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="dialog_JPAPlatform">
- <description>Specify the vendor-specific JPA implementation.Default is Generic..</description>
- <topic label="JPA Facet page" href="ref_jpa_facet.htm"/>
- </context>
- <context id="dialog_createORM">
- <description>Create an initial orm.xml file. Use this file to specify project and persistence unit defaults.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Facet page" href="ref_jpa_facet.htm"/>
- </context>
-
-
-
-
-</contexts>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css b/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css
deleted file mode 100644
index 4fa017b8b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css
+++ /dev/null
@@ -1,21 +0,0 @@
-@import "../../../PRODUCT_PLUGIN/book.css";
-
-span.control, span.gui-object-action, p.subhead2, span.bold, p.notep1 {
- font-weight: bold;
-}
-
-span.name, p.titleinfigure, span.italic {
- font-style: italic;
-}
-
-p.titleinfigure, p.subhead2 {
- padding-top: 10px;
-}
-
-span.code {
- font-family: monospace;
-}
-
-span.copyrightlogo {font-size: 75%}
-
-.footer {padding-top: 2em;} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm b/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm
deleted file mode 100644
index 382ec67619..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
-<!-- <meta http-equiv="refresh" content="0;url=../../legal.htm"> -->
-</head>
-<body>
-<p><a href="../../legal.htm">License Information</a></p>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm
deleted file mode 100644
index c0f78f6584..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Getting started</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content=" Getting started" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="sthref2" name="sthref2"></a></p>
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Getting started</h1>
-</td>
-</tr>
-</table>
-<p>This section provides information on getting started with the Java Persistence Tools.</p>
-<ul>
-<li type="disc">
-<p><a href="getting_started001.htm#BABEFHCD">Requirements and installation</a></p>
-</li>
-<li type="disc">
-<p><a href="getting_started002.htm#BABIGCJA">Dali quick start</a></p>
-</li>
-<li type="disc">
-<p><a href="getting_started006.htm#BABCDECJ">Dali basic tutorial</a></p>
-</li>
-</ul>
-<p>For additional information, please visit the Dali home page at: <code><a href="http://www.eclipse.org/webtools/dali/main.php/">http://www.eclipse.org/webtools/dali/main.php/</a></code>.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm
deleted file mode 100644
index ffee83ab0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Requirements and installation</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Requirements and installation" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABEFHCD" name="BABEFHCD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Requirements and installation<a id="sthref3" name="sthref3"></a><a id="sthref4" name="sthref4"></a></h1>
-</td>
-</tr>
-</table>
-<p>Before installing Dali, ensure that your environment meets the following <span class="italic">minimum</span> requirements:</p>
-<ul>
-<li type="disc">
-<p>Eclipse 3.3 (<code><a href="http://www.eclipse.org/downloads">http://www.eclipse.org/downloads</a></code>)</p>
-</li>
-<li type="disc">
-<p>Java Runtime Environment (JRE) 1.5 (<code><a href="http://java.com">http://java.com</a></code>)</p>
-</li>
-<li type="disc">
-<p>Eclipse Web Tools Platform (WTP) 2.0 (<code><a href="http://www.eclipse.org/webtools">http://www.eclipse.org/webtools</a></code>)</p>
-</li>
-<li type="disc">
-<p>Java Persistence API (JPA) for Java EE 5. The reference implementation can be obtained from:</p>
-</li>
-</ul>
-<pre xml:space="preserve" class="oac_no_warn">
-<code><a href="https://glassfish.dev.java.net/downloads/persistence/JavaPersistence.html">https://glassfish.dev.java.net/downloads/persistence/JavaPersistence.html</a></code>
-
-</pre>
-<p>Refer to <code><a href="http://www.eclipse.org/webtools/dali/gettingstarted_main.html">http://www.eclipse.org/webtools/dali/gettingstarted_main.html</a></code> for additional installation information.</p>
-<p>Review the <a href="getting_started002.htm#BABIGCJA">Dali quick start</a> and <a href="getting_started006.htm#BABCDECJ">Dali basic tutorial</a> to build your first Dali project.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm
deleted file mode 100644
index efba0eb9f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Dali quick start</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Dali quick start" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABIGCJA" name="BABIGCJA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Dali quick start</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref5" name="sthref5"></a>This section includes information to help you quickly start using Dali to create relational mappings between Java persistent entities and database tables.</p>
-<ul>
-<li type="disc">
-<p><a href="getting_started003.htm#BABDFHDA">Creating a new project</a></p>
-</li>
-<li type="disc">
-<p><a href="getting_started004.htm#BABFGDDG">Creating a Java persistent entity</a></p>
-</li>
-<li type="disc">
-<p><a href="getting_started005.htm#BABHACAF">Mapping an entity</a></p>
-</li>
-</ul>
-<p>The <a href="getting_started006.htm#BABCDECJ">Dali basic tutorial</a> contains detailed procedures for building you first Dali project.</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="getting_started006.htm#BABCDECJ">Dali basic tutorial</a><br />
-<a href="tips_and_tricks.htm#CHDHGHBF">Tips and tricks</a><br />
-<a href="whats_new.htm#BGGEDBGF">What's new</a> <!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm
deleted file mode 100644
index c0bc5e6268..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm
+++ /dev/null
@@ -1,90 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Creating a new project</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Creating a new project" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABDFHDA" name="BABDFHDA"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Creating a new project</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref6" name="sthref6"></a>This quick start shows how to create a new JPA project.</p>
-<ol type="1" start="1">
-<li>
-<p>Select <span class="gui-object-action">File &gt; New &gt; Project</span>. The New Project dialog appears.</p>
-</li>
-<li>
-<p>On the <span class="gui-object-title">New Project</span> dialog, select <span class="gui-object-action">JPA &gt; JPA Project</span> and click <span class="gui-object-action">Next</span>. The Create a Java Project dialog appears.</p>
-<div class="figure"><a id="sthref7" name="sthref7"></a>
-<p class="titleinfigure">New JPA Project</p>
-<img src="img/new_jpa_project_dialog.png" alt="New JPA Project dialog." title="New JPA Project dialog." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>On the <span class="gui-object-title">Create a JPA Project</span> dialog, enter a <span class="gui-object-action">Project name</span> (such as <code>QuickStart</code>).</p>
-</li>
-<li>
-<p>Select your <span class="bold">Target Runtime</span> (such as <code>Apache Tomcat</code>) and click <span class="bold">Next</span>. The Project Facets dialog appears.</p>
-</li>
-<li>
-<p>Verify that the <span class="bold">Java Persistence 1.0</span> facet is selected and click <span class="bold">Next</span>. The JPA Facet dialog appears.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-You must configure your project to use Java version 5.0 (or higher). See <a href="getting_started001.htm#BABEFHCD">"Requirements and installation"</a> for more information.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>On the JPA Facet dialog, select your vendor-specific JPA platform, database connection (or create a new connection), JPA implementation library (such as TopLink Essentials), define how Dali should manage persistent classes, and click <span class="bold">Finish</span>.</p>
-<div class="figure"><a id="sthref8" name="sthref8"></a>
-<p class="titleinfigure">JPA Facet Dialog</p>
-<img src="img/jpa_facet_dialog.png" alt="JPA Facet dialog." title="JPA Facet dialog." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<p>Eclipse adds the project to the workbench and opens the JPA perspective.</p>
-<div class="figure"><a id="sthref9" name="sthref9"></a>
-<p class="titleinfigure">Project in Package Explorer</p>
-<img src="img/quickstart_project.png" alt="Package Explorer showing the JPA project." title="Package Explorer showing the JPA project." /><br /></div>
-<!-- class="figure" -->
-<p>Now that you have created a project with persistence, you can continue with <a href="getting_started004.htm#BABFGDDG">Creating a Java persistent entity</a>.</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm
deleted file mode 100644
index da7900a1b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm
+++ /dev/null
@@ -1,111 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Creating a Java persistent entity</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Creating a Java persistent entity" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABFGDDG" name="BABFGDDG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Creating a Java persistent entity</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref10" name="sthref10"></a>This quick start shows how to create a new persistent Java entity. We will create an entity to associate with a database table. You will also need to add the ADDRESS table to your database.</p>
-<ol type="1" start="1">
-<li>
-<p>Right-click the project in the Package Explorer and select <span class="bold">New &gt; Class</span>. The New Java Class page appears.</p>
-</li>
-<li>
-<p>On the Java Class page, enter a package name (such as <code>quickstart.demo.model</code>), class name (such as <code>Address</code>), and click <span class="bold">Finish</span>.</p>
-</li>
-<li>
-<p>Right-click the <code>Address.java</code> file in the Package Explorer and select <span class="bold">Open</span>.</p>
-<div class="figure"><a id="sthref11" name="sthref11"></a>
-<p class="titleinfigure">Open Address.java</p>
-<img src="img/address_java_open.png" alt="Opening a Java class." title="Opening a Java class." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select the <code>Address</code> entity in the JPA Structure view.</p>
-<div class="figure"><a id="sthref12" name="sthref12"></a>
-<p class="titleinfigure">Address Class in JPA Structure View</p>
-<img src="img/address_jpa_structure.png" alt="Address class in JPA Structure view." title="Address class in JPA Structure view." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>In the JPA Details view, in the Map As field, select <span class="bold">Entity</span>. In the Table field, select the <span class="bold">ADDRESS</span> database table.</p>
-<div class="figure"><a id="sthref13" name="sthref13"></a>
-<p class="titleinfigure">Address Entity in JPA Details View</p>
-<img src="img/address_jpa_details.png" alt="JPA Details view." title="JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<p>Eclipse creates the persistent entity and adds the <code>@Entity</code> annotation to the class.</p>
-<div class="figure"><a id="sthref14" name="sthref14"></a>
-<p class="titleinfigure">Address Entity</p>
-<img src="img/java_editor_address.png" alt="Java editor with the Address entity." title="Java editor with the Address entity." /><br /></div>
-<!-- class="figure" -->
-<p>Eclipse also displays the <span class="bold">Address</span> entity in the JPA Structure view:</p>
-<div class="figure"><a id="sthref15" name="sthref15"></a>
-<p class="titleinfigure">Address Entity</p>
-<img src="img/persistence_outline_entity.png" alt="Address entity in the JPA Structure view." title="Address entity in the JPA Structure view." /><br /></div>
-<!-- class="figure" -->
-<p>After creating the entity, you must associate it with a database table.</p>
-<ol type="1" start="1">
-<li>
-<p>Select the <span class="gui-object-action">Address</span> class in the Explorer view.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Persistence Properties</span> view, notice that Dali has automatically associated the ADDRESS database table with the entity because they are named identically.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Depending on your database connection type, you may need to specify the <span class="bold">Schema</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="figure"><a id="sthref16" name="sthref16"></a>
-<p class="titleinfigure">JPA Details View for Address Entity</p>
-<img src="img/persistence_view_address.png" alt="Address entity in the JPA Details view." title="Address entity in the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<p>After associating the entity with the database table, you must update the <code>persistence.xml</code> file to include this JPA entity.</p>
-<p>Right-click the <code>persistence.xml</code> file in the Package Explorer and select <span class="bold">JPA Tools &gt; Synchronize Classes</span>. Dali adds the following to the <code>persistence.xml</code> file:</p>
-<p><code>&lt;class&gt;quickstart.demo.model.Address&lt;/class&gt;</code></p>
-<p>&nbsp;</p>
-<p>Now that you have created a persistent entity, you can continue with <a href="getting_started005.htm#BABHACAF">Mapping an entity</a> to map the entity's fields to columns on the database table.</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started005.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started005.htm
deleted file mode 100644
index f3e564ea9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started005.htm
+++ /dev/null
@@ -1,140 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Mapping an entity</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Mapping an entity" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABHACAF" name="BABHACAF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Mapping an entity</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref17" name="sthref17"></a><a id="sthref18" name="sthref18"></a>This quick start shows how to map fields in a Java persistent entity. Before beginning, add the following fields to the Address class:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-private Long id;
-private String city;
-private String country;
-private String stateOrProvince;
-private String postalCode;
-private String street;
-
-</pre>
-<p>Eclipse updates the Address entity in the JPA Structure view to show its fields:</p>
-<div class="figure"><a id="sthref19" name="sthref19"></a>
-<p class="titleinfigure">Address Entity and Fields</p>
-<img src="img/persistence_outline_fields.png" alt="Address entity and its fields in the JPA Structure view." title="Address entity and its fields in the JPA Structure view." /><br /></div>
-<!-- class="figure" -->
-<p>You will also need to add the following columns to the ADDRESS database table:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-NUMBER(10,0) ADDRESS_ID (primary key)
-VARCHAR2(80) PROVINCE
-VARCHAR2(80) COUNTRY
-VARCHAR2(20) P_CODE
-VARCHAR2(80) STREET
-VARCHAR2(80) CITY
-</pre>
-<pre xml:space="preserve" class="oac_no_warn">
-</pre>
-<p>Now we are ready to map each fields in the Address class to a column in the database table.</p>
-<ol type="1" start="1">
-<li>
-<p>Select the <span class="gui-object-action">id</span> field in the JPA Details view.</p>
-</li>
-<li>
-<p>In the JPA Details view:</p>
-<ul>
-<li type="disc">
-<p>For the Map As field, select <span class="bold">Id</span></p>
-</li>
-<li type="disc">
-<p>For the Column field, select <span class="bold">ADDRESS_ID</span>.</p>
-</li>
-</ul>
-<div class="figure"><a id="sthref20" name="sthref20"></a>
-<p class="titleinfigure">JPA Details View for addressId Field</p>
-<img src="img/persistence_view_addressid.png" alt="JPA Details view for the id field." title="JPA Details view for the id field." /><br /></div>
-<!-- class="figure" -->
-<p>Eclipse adds the following annotations to the Address entity:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Id
-@Column(name="ADDRESS_ID")
-
-</pre></li>
-<li>
-<p>Map each of the following fields (as <span class="bold">Basic</span> mappings) to the appropriate database column:</p>
-<div class="inftblhruleinformal">
-<table class="HRuleInformal" title="This table describes the mappings for each of the fields in the Address entity." summary="This table describes the mappings for each of the fields in the Address entity." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t4">Field</th>
-<th align="left" valign="bottom" id="r1c2-t4">Map As</th>
-<th align="left" valign="bottom" id="r1c3-t4">Database Column</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t4" headers="r1c1-t4">city</td>
-<td align="left" headers="r2c1-t4 r1c2-t4">Basic</td>
-<td align="left" headers="r2c1-t4 r1c3-t4">CITY</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t4" headers="r1c1-t4">country</td>
-<td align="left" headers="r3c1-t4 r1c2-t4">Basic</td>
-<td align="left" headers="r3c1-t4 r1c3-t4">COUNTRY</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t4" headers="r1c1-t4">postalCode</td>
-<td align="left" headers="r4c1-t4 r1c2-t4">Basic</td>
-<td align="left" headers="r4c1-t4 r1c3-t4">P_CODE</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t4" headers="r1c1-t4">provinceOrState</td>
-<td align="left" headers="r5c1-t4 r1c2-t4">Basic</td>
-<td align="left" headers="r5c1-t4 r1c3-t4">PROVINCE</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t4" headers="r1c1-t4">street</td>
-<td align="left" headers="r6c1-t4 r1c2-t4">Basic</td>
-<td align="left" headers="r6c1-t4 r1c3-t4">STREET</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblhruleinformal" --></li>
-</ol>
-<p>Notice that Dali will automatically map some fields to the correct database column (such as the <span class="bold">city</span> field to the CITY column) if the names are identical.</p>
-<p>Refer to the <a href="getting_started006.htm#BABCDECJ">Dali basic tutorial</a> to map a complete object model using basic and relational mappings.</p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started006.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started006.htm
deleted file mode 100644
index 28dc86e8e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started006.htm
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Dali basic tutorial</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Dali basic tutorial" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABCDECJ" name="BABCDECJ"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Dali basic tutorial<a id="sthref21" name="sthref21"></a></h1>
-</td>
-</tr>
-</table>
-<p>In this tutorial, you will use Dali to map the object model of a company's HR application to track its employees. <a href="#BABIDCBA">Figure: Tutorial Object Model</a> illustrates the object model for the tutorial.</p>
-<div class="figure"><a id="BABIDCBA" name="BABIDCBA"></a>
-<p class="titleinfigure">Tutorial Object Model</p>
-<img src="img/tutorial_object_model.png" alt="This figure shows the object model for the tutorial." title="This figure shows the object model for the tutorial." /><br /></div>
-<!-- class="figure" -->
-<p>Next, you will <a href="getting_started007.htm#BABBBBID">Generate the tutorial database schema</a>.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started007.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started007.htm
deleted file mode 100644
index 909ad1f3c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started007.htm
+++ /dev/null
@@ -1,215 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Generate the tutorial database schema</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Generate the tutorial database schema" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABBBBID" name="BABBBBID"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Generate the tutorial database schema</h1>
-</td>
-</tr>
-</table>
-<p>The tutorial application uses three database tables to store each employee's information: EMPLOYEE, ADDRESS and PHONE. <a href="#BABDEFDF">Table: Tutorial Database Schema</a> describes the columns for each table.</p>
-<p>You can download SQL scripts to build and populate the database tables with sample data from <code><a href="http://www.eclipse.org/webtools/dali/docs/dbscripts.zip">http://www.eclipse.org/webtools/dali/docs/dbscripts.zip</a></code>.</p>
-<div class="tblhruleformal"><a id="sthref22" name="sthref22"></a><a id="BABDEFDF" name="BABDEFDF"></a>
-<p class="titleintable">Tutorial Database Schema</p>
-<table class="HRuleFormal" title="Tutorial Database Schema" summary="This table lists the database schema." dir="ltr" border="1" width="100%" frame="hsides" rules="rows" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t5">Table</th>
-<th align="left" valign="bottom" id="r1c2-t5">Column</th>
-<th align="left" valign="bottom" id="r1c3-t5">Type</th>
-<th align="left" valign="bottom" id="r1c4-t5">Details</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t5" headers="r1c1-t5" rowspan="5">
-<p>EMPLOYEE</p>
-</td>
-<td align="left" headers="r2c1-t5 r1c2-t5">
-<p>EMP_ID</p>
-</td>
-<td align="left" headers="r2c1-t5 r1c3-t5">
-<p>NUMBER(15)</p>
-</td>
-<td align="left" headers="r2c1-t5 r1c4-t5">
-<p>Primary Key</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t5" headers="r2c1-t5 r1c1-t5">
-<p>F_NAME</p>
-</td>
-<td align="left" headers="r2c1-t5 r3c1-t5 r1c2-t5">
-<p>VARCHAR(40)</p>
-</td>
-<td align="left" headers="r2c1-t5 r3c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t5" headers="r2c1-t5 r1c1-t5">
-<p>L_NAME</p>
-</td>
-<td align="left" headers="r2c1-t5 r4c1-t5 r1c2-t5">
-<p>VARCHAR(40)</p>
-</td>
-<td align="left" headers="r2c1-t5 r4c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t5" headers="r2c1-t5 r1c1-t5">
-<p>ADDR_ID</p>
-</td>
-<td align="left" headers="r2c1-t5 r5c1-t5 r1c2-t5">
-<p>NUMBER(15)</p>
-</td>
-<td align="left" headers="r2c1-t5 r5c1-t5 r1c3-t5">
-<p>Foreign Key, references ADDRESS.ADDRES_ID</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t5" headers="r2c1-t5 r1c1-t5">
-<p>VERSION</p>
-</td>
-<td align="left" headers="r2c1-t5 r6c1-t5 r1c2-t5">
-<p>NUMBER(15)</p>
-</td>
-<td align="left" headers="r2c1-t5 r6c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t5" headers="r1c1-t5" rowspan="6">
-<p>ADDRESS</p>
-</td>
-<td align="left" headers="r7c1-t5 r1c2-t5">
-<p>ADDRESS_ID</p>
-</td>
-<td align="left" headers="r7c1-t5 r1c3-t5">
-<p>NUMBER(15)</p>
-</td>
-<td align="left" headers="r7c1-t5 r1c4-t5">
-<p>Primary Key</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t5" headers="r7c1-t5 r1c1-t5">
-<p>PROVINCE</p>
-</td>
-<td align="left" headers="r7c1-t5 r8c1-t5 r1c2-t5">
-<p>VARCHAR(80)</p>
-</td>
-<td align="left" headers="r7c1-t5 r8c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t5" headers="r7c1-t5 r1c1-t5">
-<p>COUNTRY</p>
-</td>
-<td align="left" headers="r7c1-t5 r9c1-t5 r1c2-t5">
-<p>VARCHAR(80)</p>
-</td>
-<td align="left" headers="r7c1-t5 r9c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t5" headers="r7c1-t5 r1c1-t5">
-<p>STREET</p>
-</td>
-<td align="left" headers="r7c1-t5 r10c1-t5 r1c2-t5">
-<p>VARCHAR(80)</p>
-</td>
-<td align="left" headers="r7c1-t5 r10c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t5" headers="r7c1-t5 r1c1-t5">
-<p>P_CODE</p>
-</td>
-<td align="left" headers="r7c1-t5 r11c1-t5 r1c2-t5">
-<p>VARCHAR(20)</p>
-</td>
-<td align="left" headers="r7c1-t5 r11c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t5" headers="r7c1-t5 r1c1-t5">
-<p>CITY</p>
-</td>
-<td align="left" headers="r7c1-t5 r12c1-t5 r1c2-t5">
-<p>VARCHAR(80)</p>
-</td>
-<td align="left" headers="r7c1-t5 r12c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t5" headers="r1c1-t5" rowspan="4">
-<p>PHONE</p>
-</td>
-<td align="left" headers="r13c1-t5 r1c2-t5">
-<p>EMP_ID</p>
-</td>
-<td align="left" headers="r13c1-t5 r1c3-t5">
-<p>NUMBER(15)</p>
-</td>
-<td align="left" headers="r13c1-t5 r1c4-t5">
-<p>Foreign Key, reference to EMPLOYEE.EMP_ID</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r14c1-t5" headers="r13c1-t5 r1c1-t5">
-<p>AREA_CODE</p>
-</td>
-<td align="left" headers="r13c1-t5 r14c1-t5 r1c2-t5">
-<p>VARCHAR(3)</p>
-</td>
-<td align="left" headers="r13c1-t5 r14c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r15c1-t5" headers="r13c1-t5 r1c1-t5">
-<p>P_NUMBER</p>
-</td>
-<td align="left" headers="r13c1-t5 r15c1-t5 r1c2-t5">
-<p>VARCHAR(7)</p>
-</td>
-<td align="left" headers="r13c1-t5 r15c1-t5 r1c3-t5">
-<p>Primary key</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r16c1-t5" headers="r13c1-t5 r1c1-t5">
-<p>TYPE</p>
-</td>
-<td align="left" headers="r13c1-t5 r16c1-t5 r1c2-t5">
-<p>VARCHAR(15)</p>
-</td>
-<td align="left" headers="r13c1-t5 r16c1-t5 r1c3-t5"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblhruleformal" -->
-<p>Next, you will <a href="getting_started008.htm#BABDHFCD">Create a database connection</a>.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started008.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started008.htm
deleted file mode 100644
index 4e4585c8c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started008.htm
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Create a database connection</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Create a database connection" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABDHFCD" name="BABDHFCD"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Create a database connection</h1>
-</td>
-</tr>
-</table>
-<p>After creating the database you will need to create a database connection to use with the tutorial application. An active database connection is required to complete tutorial application.</p>
-<p>Use the <a href="../org.eclipse.wst.datatools.connection.ui.doc.user/topics/tconnecting_wiz.html">New Connection wizard</a> to create a database connection.</p>
-<div class="figure"><a id="sthref23" name="sthref23"></a>
-<p class="titleinfigure">Database Explorer</p>
-<img src="img/database_explorer.png" alt="This figure shows the Database Explorer." title="This figure shows the Database Explorer." /><br /></div>
-<!-- class="figure" -->
-<p>Now you're ready to <a href="getting_started009.htm#BABBBAIG">Create a JPA project</a>.</p>
-</div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started009.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started009.htm
deleted file mode 100644
index c9190e570d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started009.htm
+++ /dev/null
@@ -1,68 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Create a JPA project</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Create a JPA project" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABBBAIG" name="BABBBAIG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Create a JPA project</h1>
-</td>
-</tr>
-</table>
-<p>In order to begin, you must create a new Java project.</p>
-<ol type="1" start="1">
-<li>
-<p>Select <span class="gui-object-action">File &gt; New &gt; Project</span>. The New Project dialog appears.</p>
-</li>
-<li>
-<p>On the <span class="gui-object-title">New Project</span> dialog, select <span class="gui-object-action">JPA &gt; JPA Project</span> and click <span class="gui-object-action">OK</span>. The New JPA Project dialog appears.</p>
-</li>
-<li>
-<p>On the <span class="gui-object-title">New JPA Project</span> dialog, enter <code>Employee</code> as the <span class="gui-object-action">Project name</span> and click <span class="gui-object-action">Next</span>. The Project Facets page appears.</p>
-</li>
-<li>
-<p>Verify that you have selected a Java 5.0 (or higher) and JPA 1.0 facet, and click <span class="bold">Next</span>. The JPA Facet page appears.</p>
-</li>
-<li>
-<p>Select your vender-specific platform, database connection, and JPA implementation library, and click <span class="bold">Finish</span>.</p>
-</li>
-</ol>
-<p>Eclipse adds the project to the workbench and opens the Java perspective.</p>
-<div class="figure"><a id="sthref24" name="sthref24"></a>
-<p class="titleinfigure">Persistence Perspective</p>
-<img src="img/persistence_perspective.png" alt="This figure shows the main parts of the JPA Development Perspective: The JPA Structure and JPA Details views." title="This figure shows the main parts of the JPA Development Perspective: The JPA Structure and JPA Details views." /><br /></div>
-<!-- class="figure" -->
-<p>The next step is to <a href="getting_started010.htm#BABIJIGF">Create persistent Java entities</a>.</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started010.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started010.htm
deleted file mode 100644
index df685ef8ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started010.htm
+++ /dev/null
@@ -1,63 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Create persistent Java entities</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Create persistent Java entities" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABIJIGF" name="BABIJIGF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Create persistent Java entities</h1>
-</td>
-</tr>
-</table>
-<p>The <a href="getting_started006.htm#BABIDCBA">Tutorial Object Model</a> contains three entities: <span class="bold">Employee</span>, <span class="bold">Address</span>, and <span class="bold">PhoneNumber</span>. Use this procedure to add the entities to the project.</p>
-<ol type="1" start="1">
-<li>
-<p>Right-click the <span class="bold">Employee</span> project in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">New &gt; Class</span>. The New Java Class dialog appears.</p>
-</li>
-<li>
-<p>On the <span class="gui-object-title">Java Class</span> dialog, enter a package name (such as <code>dali.tutorial.model</code>), class name (such as <code>Employee</code>), and click <span class="gui-object-action">Finish</span>. Eclipse adds the Employee entity to the Package Explorer.</p>
-</li>
-<li>
-<p>Select the <code>Employee</code> entity in the JPA Structure view.</p>
-</li>
-<li>
-<p>In the JPA Details view, in the Map As field, select <span class="bold">Entity</span>. In the Table field, select the <span class="bold">EMPLOYEE</span> database table.</p>
-<div class="figure"><a id="sthref25" name="sthref25"></a>
-<p class="titleinfigure">Employee Entity in JPA Details View</p>
-<img src="img/jpa_details_employee.png" alt="Employee entity in JPA Details view." title="Employee entity in JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<p>Eclipse adds the <code>@Entity</code> annotation to the class. Repeat this procedure to add the <span class="bold">PhoneNumber</span> and <span class="bold">Address</span> entities.</p>
-<p>Notice that the Problems view reports several errors for each entity. We'll address these shortly.</p>
-<p>Next, you will <a href="getting_started011.htm#BABDCBDD">Add fields to the entities</a>.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started011.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started011.htm
deleted file mode 100644
index 55ab05f72f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started011.htm
+++ /dev/null
@@ -1,85 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Add fields to the entities</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Add fields to the entities" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABDCBDD" name="BABDCBDD"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Add fields to the entities</h1>
-</td>
-</tr>
-</table>
-<p>Before mapping the entities to the database, you must add the necessary fields to each entity.</p>
-<ol type="1" start="1">
-<li>
-<p>Add the following fields to the <span class="bold">Employee</span> entity:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-private Long id;
-private String firstNname;
-private String lastName;
-private String address;
-private List&lt;PhoneNumber&gt; phoneNumbers;
-private Long version;
-
-</pre></li>
-<li>
-<p>Import <span class="bold">java.util.List</span>.</p>
-</li>
-<li>
-<p>Generate Getters and Setters for each field.</p>
-</li>
-<li>
-<p>Add the following fields to the <span class="bold">Address</span> entity:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-private Long id;
-private String street;
-private String city;
-private String stateOrProvince;
-private String country;
-private String postalCode;
-
-</pre></li>
-<li>
-<p>Add the following fields to the <span class="bold">PhoneNumber</span> entity:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-private String type;
-private String areaCode;
-private String number;
-private Employee owner;
-
-</pre></li>
-</ol>
-<p>Next, you will <a href="getting_started012.htm#BABIHGGD">Associate the entity with a database table</a>.</p>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started012.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started012.htm
deleted file mode 100644
index 3b0879844d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started012.htm
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Associate the entity with a database table</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Associate the entity with a database table" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABIHGGD" name="BABIHGGD"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Associate the entity with a database table</h1>
-</td>
-</tr>
-</table>
-<p>Now you must associate each entity with its primary database table.</p>
-<ol type="1" start="1">
-<li>
-<p>Select the <span class="gui-object-action">Employee</span> class in the Explorer view.</p>
-</li>
-<li>
-<p>In the JPA Details view, notice that Dali has automatically selected the EMPLOYEE table as the table name.</p>
-<div class="figure"><a id="sthref26" name="sthref26"></a>
-<p class="titleinfigure">JPA Details View for the Employee Entity</p>
-<img src="img/persistence_view_employee.png" alt="JPA Details view for the Employee entity." title="JPA Details view for the Employee entity." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<p>By default, Dali attempts to associate each entity with a similarly named database table. Notice that although you have not explicitly associated the <span class="bold">Address</span> entity yet, there is no error in the Problems view because the entity name, Address, is identical to the table name (ADDRESS).</p>
-<p>For the <span class="bold">PhoneNumber</span> entity, however, there is an error. This is because the entity name (PhoneNumber) is different than the database table (PHONE). You must explicitly associate the entity with the PHONE table. Dali adds the <code>@Table(name="PHONE")</code> annotation to the entity.</p>
-<p>Now you are ready to <a href="getting_started013.htm#BABEBGBC">Create OR mappings</a>.</p>
-</div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started013.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started013.htm
deleted file mode 100644
index 785a659348..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started013.htm
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Create OR mappings</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Create OR mappings" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABEBGBC" name="BABEBGBC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Create OR mappings</h1>
-</td>
-</tr>
-</table>
-<p>Now you're ready to map the attributes of each persistent entity to columns in the appropriate database table. For the tutorial application, you will use the following mapping types:</p>
-<ul>
-<li type="disc">
-<p>ID mappings</p>
-</li>
-<li type="disc">
-<p>Basic mappings</p>
-</li>
-<li type="disc">
-<p>One-to-one mappings</p>
-</li>
-<li type="disc">
-<p>Many-to-one mappings</p>
-</li>
-<li type="disc">
-<p>One-to-many mappings</p>
-</li>
-<li type="disc">
-<p>Version mappings</p>
-</li>
-</ul>
-<p>Next, you will <a href="getting_started014.htm#BABGEFDI">Create ID mappings</a>.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started014.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started014.htm
deleted file mode 100644
index de4447d1ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started014.htm
+++ /dev/null
@@ -1,132 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Create ID mappings</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Create ID mappings" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABGEFDI" name="BABGEFDI"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Create ID mappings</h1>
-</td>
-</tr>
-</table>
-<p>Use an <span class="bold">ID Mapping</span> to specify the primary key of an entity. Each persistent entity must have an ID. Notice that the Problems view reports that each entity is missing an ID.</p>
-<ol type="1" start="1">
-<li>
-<p>Select the <span class="bold">Employee</span> entity in the Package Explorer view.</p>
-</li>
-<li>
-<p>Expand the <span class="bold">Employee</span> entity in the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a> and select the <span class="bold">id</span> field. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the field.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">ID</span>.</p>
-<div class="figure"><a id="sthref27" name="sthref27"></a>
-<p class="titleinfigure">ID Mapping for emp_id Field</p>
-<img src="img/persistence_view_empid.png" alt="JPA Details view for the emp_id field." title="JPA Details view for the emp_id field." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Use this table to complete the remaining fields in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t6">Property</th>
-<th align="left" valign="bottom" id="r1c2-t6">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t6" headers="r1c1-t6">Map As</td>
-<td align="left" headers="r2c1-t6 r1c2-t6">Defines this mapping as an <span class="bold">ID Mapping</span>. Dali adds the <code>@Id</code> annotation to the entity.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t6" headers="r1c1-t6">Column</td>
-<td align="left" headers="r3c1-t6 r1c2-t6">The database column for the primary key of the table associated with the entity. Select <span class="bold">EMP_ID</span>.
-<p>Because the database column (EMP_ID) is named differently than the entity field (id), Dali adds the <code>@Column(name="EMP_ID"</code>) annotation.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Leave all other fields on the tab as their defaults. Expand the <span class="bold">Primary Key Generation</span> area.</p>
-<div class="figure"><a id="sthref28" name="sthref28"></a>
-<p class="titleinfigure">Primary Key Generation for emp_id Field</p>
-<img src="img/persistence_view_empid_pk.png" alt="JPA Details view (with Primary Key options) for the emp_id field." title="JPA Details view (with Primary Key options) for the emp_id field." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Use this table to complete the Primary Key Generation fields in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t7">Property</th>
-<th align="left" valign="bottom" id="r1c2-t7">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t7" headers="r1c1-t7">Generated Value</td>
-<td align="left" headers="r2c1-t7 r1c2-t7">These fields define how the primary key is generated.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t7" headers="r1c1-t7">&nbsp;&nbsp;Strategy</td>
-<td align="left" headers="r3c1-t7 r1c2-t7">For the tutorial project, use the <span class="bold">Auto</span> option.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t7" headers="r1c1-t7">&nbsp;&nbsp;Generator&nbsp;Name</td>
-<td align="left" headers="r4c1-t7 r1c2-t7">Leave this field blank.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>In the JPA Structure view, the <span class="bold">id</span> field is identified as the primary key by the following icon:</p>
-<div class="figure"><a id="sthref29" name="sthref29"></a>
-<p class="titleinfigure">JPA Structure for Employee Entity</p>
-<img src="img/persistence_outline_empid.png" alt="emp_id attribute of the Employee entity in the JPA Structure view." title="emp_id attribute of the Employee entity in the JPA Structure view." /><br /></div>
-<!-- class="figure" -->
-<p>Repeat this procedure to map the following primary keys (as shown in <a href="getting_started007.htm#BABDEFDF">Table: Tutorial Database Schema</a>):</p>
-<ul>
-<li type="disc">
-<p>The <span class="bold">id</span> field of the <span class="bold">Address</span> entity to the ADDRESS_ID column of the ADDRESS table.</p>
-</li>
-<li type="disc">
-<p>The <span class="bold">number</span> field of the <span class="bold">PhoneNumber</span> entity to the P_NUMBER column of the PHONE table.</p>
-</li>
-</ul>
-<p>Next, you will <a href="getting_started015.htm#BABEEFJA">Create basic mappings</a>.</p>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started015.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started015.htm
deleted file mode 100644
index 63e9f803f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started015.htm
+++ /dev/null
@@ -1,133 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:52 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Create basic mappings</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Create basic mappings" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABEEFJA" name="BABEEFJA"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Create basic mappings</h1>
-</td>
-</tr>
-</table>
-<p>Use a <span class="bold">Basic Mapping</span> to map an attribute directly to a database column. In the <a href="getting_started006.htm#BABIDCBA">Tutorial Object Model</a>, the <span class="bold">firstName</span> field of the <span class="bold">Employee</span> class maps directly to the F_NAME column of the EMPLOYEE database table.</p>
-<ol type="1" start="1">
-<li>
-<p>Select the <span class="bold">Employee</span> entity in the Package Explorer view.</p>
-</li>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the <span class="bold">firstName</span> field of the <span class="bold">Employee</span> entity. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the field.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">Basic</span>. In the Column field, select <span class="bold">F_NAME</span>.</p>
-<div class="figure"><a id="sthref30" name="sthref30"></a>
-<p class="titleinfigure">Basic Mapping for firstName</p>
-<img src="img/persistence_view_firstname.png" alt="JPA Details view for the firstName field." title="JPA Details view for the firstName field." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<p>Dali adds the <code>@Column(name="F_NAME")</code> annotation to the entity. In the JPA Structure, the <span class="bold">firstName</span> field is identified as a basic mapping as shown in the following figure:</p>
-<div class="figure"><a id="sthref31" name="sthref31"></a>
-<p class="titleinfigure">JPA Structure for Employee Entity</p>
-<img src="img/persistence_outline_fname.png" alt="The firstName attribute of the Employee entity in the JPA Structure view." title="The firstName attribute of the Employee entity in the JPA Structure view." /><br /></div>
-<!-- class="figure" -->
-<p>Repeat this procedure to map each of the following fields as <span class="bold">Basic</span> mappings:</p>
-<ul>
-<li type="disc">
-<p>Employee entity</p>
-<ul>
-<li type="circle">
-<p><span class="bold">lastName</span> field to L_NAME column</p>
-</li>
-</ul>
-</li>
-<li type="disc">
-<p>Address Entity</p>
-<ul>
-<li type="circle">
-<p><span class="bold">city</span> field to CITY column</p>
-</li>
-<li type="circle">
-<p><span class="bold">country</span> field to COUNTRY column</p>
-</li>
-<li type="circle">
-<p><span class="bold">postalCode</span> field to P_CODE column</p>
-</li>
-<li type="circle">
-<p><span class="bold">stateOrProvice</span> field to PROVINCE column</p>
-</li>
-<li type="circle">
-<p><span class="bold">street</span> field to STREET column</p>
-</li>
-</ul>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Because the <span class="bold">city</span>, <span class="bold">country</span>, and <span class="bold">street</span> fields are named identically to their database columns, Dali automatically maps the fields; no annotations are required.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li type="disc">
-<p>Phone Entity</p>
-<ul>
-<li type="circle">
-<p><span class="bold">areaCode</span> field to AREA_CODE column</p>
-</li>
-<li type="circle">
-<p><span class="bold">type</span> field to TYPE column</p>
-</li>
-</ul>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Because the <span class="bold">type</span> field is named identically to its database column, Dali automatically maps the field. No annotation is required.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-</ul>
-<p>Next, you will <a href="getting_started016.htm#BABGBGHF">Create one-to-one mappings</a>.</p>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started016.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started016.htm
deleted file mode 100644
index 0b21fc1fde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started016.htm
+++ /dev/null
@@ -1,89 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Create one-to-one mappings</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Create one-to-one mappings" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABGBGHF" name="BABGBGHF"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Create one-to-one mappings</h1>
-</td>
-</tr>
-</table>
-<p>Use a <span class="bold">One-to-One Mapping</span> to define a relationship from an attribute to another class, with one-to-one multiplicity to a database column. In the <a href="getting_started006.htm#BABIDCBA">Tutorial Object Model</a>, the <span class="bold">address</span> field of the <span class="bold">Employee</span> class has a one-to-one relationship to the <span class="bold">Address</span> class; each employee may have a single address.</p>
-<ol type="1" start="1">
-<li>
-<p>Select the <span class="bold">Employee</span> entity in the Package Explorer view.</p>
-</li>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the <span class="bold">address</span> field of the <span class="bold">Employee</span> entity. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the field.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">One-to-One</span>.</p>
-<div class="figure"><a id="sthref32" name="sthref32"></a>
-<p class="titleinfigure">One-to-one Mapping for address</p>
-<img src="img/persistence_view_onetoone.png" alt="JPA Details view for the address field." title="JPA Details view for the address field." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>For the Target Entity, click <span class="bold">Browse</span> and select the <span class="bold">Address</span> persistent entity. Dali adds the <code>@OneToOne(targetEntity=dali.tutorial.model.Address.class)</code> entity to the class.</p>
-<p>Leave the other fields with their default values.</p>
-</li>
-<li>
-<p>Select the <span class="bold">Override Default</span> option to specify the relationship between the Employee and Address entities. Because you had to explicitly define the ID field for the Address entity in its ID mapping, you will need to edit the default join relationship.</p>
-</li>
-<li>
-<p>Select the <span class="bold">address_ADDRESS_ID -&gt; ADDRESS_ID</span> relationship in the <span class="gui-object-title">Join Columns</span> area and click <span class="bold">Edit</span>.</p>
-</li>
-<li>
-<p>In the Edit Join Column dialog, select the following options and click <span class="bold">OK</span>.</p>
-<ul>
-<li type="disc">
-<p>Name: <span class="bold">ADDR_ID</span> (from the EMPLOYEE table)</p>
-</li>
-<li type="disc">
-<p>Referenced Column Name: <span class="bold">ADDRESS_ID</span> (from the ADDRESS table)</p>
-</li>
-</ul>
-<div class="figure"><a id="sthref33" name="sthref33"></a>
-<p class="titleinfigure">Editing Join Column for Address Mapping</p>
-<img src="img/edit_join_column_dialog.png" alt="Edit Join Column dialog for the address 1:1 mapping." title="Edit Join Column dialog for the address 1:1 mapping." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<p>In the JPA Structure, the <span class="bold">address</span> field is identified as a one-to-one mapping, as shown in the following figure:</p>
-<div class="figure"><a id="sthref34" name="sthref34"></a>
-<p class="titleinfigure">JPA Structure for Employee Entity</p>
-<img src="img/persistence_outline_address.png" alt="The address attribute of the Employee entity in the JPA Structure view." title="The address attribute of the Employee entity in the JPA Structure view." /><br /></div>
-<!-- class="figure" -->
-<p>Next, you will <a href="getting_started017.htm#BABBEHEG">Create one-to-many mappings</a>.</p>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started017.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started017.htm
deleted file mode 100644
index d75a00d3ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started017.htm
+++ /dev/null
@@ -1,71 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Create one-to-many mappings</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Create one-to-many mappings" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABBEHEG" name="BABBEHEG"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Create one-to-many mappings</h1>
-</td>
-</tr>
-</table>
-<p>Use a <span class="bold">One-to-Many Mapping</span> to define a relationship from an attribute to another class, with one-to-many multiplicity to a database column. In the <a href="getting_started006.htm#BABIDCBA">Tutorial Object Model</a>, the <span class="bold">phoneNumbers</span> field of the <span class="bold">Employee</span> class has a one-to-many relationship to the <span class="bold">Phone</span> class; each employee may have many phone numbers.</p>
-<ol type="1" start="1">
-<li>
-<p>Select the <span class="bold">Employee</span> entity in the Package Explorer view.</p>
-</li>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the <span class="bold">phoneNumber</span> field of the <span class="bold">Employee</span> entity. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the field.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">One-to-Many</span>.</p>
-<div class="figure"><a id="sthref35" name="sthref35"></a>
-<p class="titleinfigure">One-to-many Mapping for phoneNumbers</p>
-<img src="img/persistence_view_onetomany.png" alt="JPA Details view for the phoneNumbers field." title="JPA Details view for the phoneNumbers field." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select <span class="bold">PhoneNumber</span> as the Target Entity. Leave the other fields with their default values.</p>
-</li>
-<li>
-<p>In the Join Table area, notice that Dali has selected the correct joins, based on the foreign key associations in the database tables.</p>
-</li>
-</ol>
-<p>In the JPA Structure, the <span class="bold">phoneNumbers</span> field is identified as a one-to-many mapping as shown in the following figure:</p>
-<div class="figure"><a id="sthref36" name="sthref36"></a>
-<p class="titleinfigure">JPA Structure for Employee Entity</p>
-<img src="img/persistence_outline_phone.png" alt="The phoneNumbers attribute of the Employee entity in the JPA Structure view." title="The phoneNumbers attribute of the Employee entity in the JPA Structure view." /><br /></div>
-<!-- class="figure" -->
-<p>Next, you will <a href="getting_started018.htm#BABCHIHI">Create many-to-one mappings</a>.</p>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started018.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started018.htm
deleted file mode 100644
index f2627f0553..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started018.htm
+++ /dev/null
@@ -1,89 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Create many-to-one mappings</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Create many-to-one mappings" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABCHIHI" name="BABCHIHI"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Create many-to-one mappings</h1>
-</td>
-</tr>
-</table>
-<p>Use a <span class="bold">May-to-One Mapping</span> to define a relationship from an attribute to another class, with many-to-one multiplicity to a database column. In the <a href="getting_started006.htm#BABIDCBA">Tutorial Object Model</a>, the <span class="bold">owner</span> field of the <span class="bold">PhoneNumber</span> class has a one-to-many relationship to the <span class="bold">Employee</span> class; there are many phone numbers that each employee may have.</p>
-<p>This is the "back mapping" of the one-to-many mapping you previously defined.</p>
-<ol type="1" start="1">
-<li>
-<p>Select the <span class="bold">PhoneNumber</span> entity in the Package Explorer view.</p>
-</li>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the <span class="bold">owner</span> field of the <span class="bold">PhoneNumber</span> entity. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the field.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">Many to One</span>.</p>
-<div class="figure"><a id="sthref37" name="sthref37"></a>
-<p class="titleinfigure">Many to One Mapping for owner</p>
-<img src="img/persistence_view_manytoone.png" alt="The JPA Details view for the owner field." title="The JPA Details view for the owner field." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Leave the other fields with their default values. Dali correctly completes the information based on the database structure and previously defined mappings.</p>
-</li>
-<li>
-<p>Use the <span class="bold">Join Columns</span> area to specify the relationship between the PhoneNumber and Employee entities. Because you had to explicitly define the ID field for the Employee entity in its ID mapping, you will need to edit the default join relationship.</p>
-</li>
-<li>
-<p>Select the <span class="bold">Override Default</span> option.</p>
-</li>
-<li>
-<p>Select the <span class="bold">owner_EMP_ID -&gt; EMP_ID</span> relationship in the <span class="gui-object-title">Join Columns</span> area and click <span class="bold">Edit</span>.</p>
-</li>
-<li>
-<p>In the Edit Join Column dialog, select the following options and click <span class="bold">OK</span>.</p>
-<ul>
-<li type="disc">
-<p>Name: <span class="bold">EMP_ID</span> (from the PHONE table)</p>
-</li>
-<li type="disc">
-<p>Referenced Column Name: <span class="bold">EMP_ID</span> (from the EMPLOYEE table)</p>
-</li>
-</ul>
-</li>
-</ol>
-<p>In the JPA Structure, the <span class="bold">owner</span> field is identified as a many-to-one mapping as shown in the following figure:</p>
-<div class="figure"><a id="sthref38" name="sthref38"></a>
-<p class="titleinfigure">JPA Structure for PhoneNumber Entity</p>
-<img src="img/persistence_outline_owner.png" alt="The owner attribute of the PhoneNumber entity in the JPA Structure view." title="The owner attribute of the PhoneNumber entity in the JPA Structure view." /><br /></div>
-<!-- class="figure" -->
-<p>Next, you will <a href="getting_started019.htm#BABIDFFG">Create version mappings</a></p>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started019.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started019.htm
deleted file mode 100644
index 92230820b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started019.htm
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Create version mappings</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Create version mappings" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABIDFFG" name="BABIDFFG"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Create version mappings</h1>
-</td>
-</tr>
-</table>
-<p>Use a <span class="bold">Version Mapping</span> to specify the database field used by a persistent entity for optimistic locking.</p>
-<ol type="1" start="1">
-<li>
-<p>Select the <span class="bold">Employee</span> entity in the Package Explorer view.</p>
-</li>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the <span class="bold">version</span> field of the <span class="bold">Employee</span> entity. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the field.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">Version</span>.</p>
-<div class="figure"><a id="sthref39" name="sthref39"></a>
-<p class="titleinfigure">Version Mapping for version</p>
-<img src="img/persistence_view_version.png" alt="JPA Details view for the version field." title="JPA Details view for the version field." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<p>Dali automatically selects the Version column in the EMPLOYEE database table. In the JPA Structure, the <span class="bold">Version</span> field is identified as a version mapping, as shown in the following figure:</p>
-<div class="figure"><a id="sthref40" name="sthref40"></a>
-<p class="titleinfigure">JPA Structure for Employee Entity</p>
-<img src="img/persistence_outline_version.png" alt="The version attribute of the Employee entity in the JPA Structure view." title="The version attribute of the Employee entity in the JPA Structure view." /><br /></div>
-<!-- class="figure" -->
-<p>Congratulations! All of the entities have been successfully mapped.</p>
-</div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_open.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_open.png
deleted file mode 100644
index 7da0417133..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_open.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_details.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_details.png
deleted file mode 100644
index f96cc3f8b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_details.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_structure.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_structure.png
deleted file mode 100644
index a18a65652c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_jpa_structure.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/button_jpa_perspective.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/button_jpa_perspective.png
deleted file mode 100644
index e0a957185e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/button_jpa_perspective.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/database_explorer.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/database_explorer.png
deleted file mode 100644
index 435be3dcc1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/database_explorer.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png
deleted file mode 100644
index 5bd48850fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/edit_join_column_dialog.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/edit_join_column_dialog.png
deleted file mode 100644
index 9cc32cf47c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/edit_join_column_dialog.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png
deleted file mode 100644
index 3a4964632c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png
deleted file mode 100644
index e3cb22b69a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_11mapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_11mapping.png
deleted file mode 100644
index 6944826370..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_11mapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_1mmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_1mmapping.png
deleted file mode 100644
index 69d3193a5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_1mmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.png
deleted file mode 100644
index b193753e98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddable.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddable.png
deleted file mode 100644
index 645922c306..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddable.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedidmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedidmapping.png
deleted file mode 100644
index 0587544e2d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedidmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedmapping.png
deleted file mode 100644
index 4bef3567ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_embeddedmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_idmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_idmapping.png
deleted file mode 100644
index 2b2a94becd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_idmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_m1mapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_m1mapping.png
deleted file mode 100644
index a77a01ba6d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_m1mapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_mmmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_mmmapping.png
deleted file mode 100644
index 5d5fd1c145..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_mmmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_nonpersistent.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_nonpersistent.png
deleted file mode 100644
index 001ef86ee2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_nonpersistent.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_persistent.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_persistent.png
deleted file mode 100644
index 7ea0b1d53e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_persistent.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_superclass.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_superclass.png
deleted file mode 100644
index 952f11d131..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_superclass.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_transientmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_transientmapping.png
deleted file mode 100644
index 1a70dd9e68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_transientmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_versionmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_versionmapping.png
deleted file mode 100644
index aa7e0a6f15..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_versionmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png
deleted file mode 100644
index 22b6875f4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png
deleted file mode 100644
index 3146482609..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png
deleted file mode 100644
index a9d721fcc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png
deleted file mode 100644
index ff7eaa63b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_details_employee.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_details_employee.png
deleted file mode 100644
index d2c21ce726..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_details_employee.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_facet_dialog.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_facet_dialog.png
deleted file mode 100644
index 18c294c06b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_facet_dialog.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_dialog.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_dialog.png
deleted file mode 100644
index 0fb14b17e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_dialog.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_project_2.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_project_2.png
deleted file mode 100644
index ad3ab04aa9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_project_2.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png
deleted file mode 100644
index 88381a5a80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png
deleted file mode 100644
index 4bbc744806..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png
deleted file mode 100644
index 60af21f5ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.png
deleted file mode 100644
index b37937c5b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/open_persistence_editor.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_address.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_address.png
deleted file mode 100644
index bd9351ce90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_address.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_empid.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_empid.png
deleted file mode 100644
index 90d889fb4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_empid.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_entity.png
deleted file mode 100644
index bbcbb52d28..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_entity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fields.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fields.png
deleted file mode 100644
index 5a41682f77..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fields.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fname.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fname.png
deleted file mode 100644
index 3b8b032dc2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_fname.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_owner.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_owner.png
deleted file mode 100644
index f24fe486b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_owner.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_phone.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_phone.png
deleted file mode 100644
index 25aca17350..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_phone.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_version.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_version.png
deleted file mode 100644
index 4ba483ed2a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_version.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png
deleted file mode 100644
index 769aa825e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_perspective.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_perspective.png
deleted file mode 100644
index f92ea6422b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_perspective.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_address.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_address.png
deleted file mode 100644
index c186d3fef6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_address.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_addressid.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_addressid.png
deleted file mode 100644
index a7e71ad7ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_addressid.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_embedded.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_embedded.png
deleted file mode 100644
index 91affa5e47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_embedded.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid.png
deleted file mode 100644
index 9c2811abd5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid_pk.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid_pk.png
deleted file mode 100644
index 46fcc69d4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_empid_pk.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_employee.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_employee.png
deleted file mode 100644
index 01337ffab0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_employee.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_entity.png
deleted file mode 100644
index 0a7685ae3f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_entity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_firstname.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_firstname.png
deleted file mode 100644
index 67670ff6f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_firstname.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_manytoone.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_manytoone.png
deleted file mode 100644
index c9f02200b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_manytoone.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_mappedsprc.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_mappedsprc.png
deleted file mode 100644
index ceb79d9623..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_mappedsprc.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetomany.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetomany.png
deleted file mode 100644
index 148c735293..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetomany.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetoone.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetoone.png
deleted file mode 100644
index 3e2b739dcd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_onetoone.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_version.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_version.png
deleted file mode 100644
index fea937d9b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_view_version.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.png
deleted file mode 100644
index b14dc15936..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_xml_editor.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/properties_persistence.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/properties_persistence.png
deleted file mode 100644
index fcc9886484..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/properties_persistence.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png
deleted file mode 100644
index c7c066427e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png
deleted file mode 100644
index e6a9159fd8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png
deleted file mode 100644
index bede63b968..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png
deleted file mode 100644
index 1aa1dbe059..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/tutorial_object_model.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/tutorial_object_model.png
deleted file mode 100644
index eb25d7d6fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/tutorial_object_model.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/index.xml b/jpa/plugins/org.eclipse.jpt.doc.user/index.xml
deleted file mode 100644
index 60f79a5d52..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/index.xml
+++ /dev/null
@@ -1,546 +0,0 @@
-<?xml version='1.0' encoding='iso-8859-1'?>
-<index version="1.0">
- <entry keyword="@Basic">
- <entry keyword="Basic mapping"><topic href="tasks007.htm#sthref116" /></entry>
- </entry>
- <entry keyword="@Column">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref198" /></entry>
- </entry>
- <entry keyword="@DiscriminatorColumn">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref103" /></entry>
- </entry>
- <entry keyword="@DiscriminatorValue">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref105" /></entry>
- </entry>
- <entry keyword="@Embeddable">
- <entry keyword="Embeddable"><topic href="tasks005.htm#sthref86" /></entry>
- </entry>
- <entry keyword="@Embedded">
- <entry keyword="Embedded mapping"><topic href="tasks008.htm#sthref120" /></entry>
- </entry>
- <entry keyword="@EmbeddedId">
- <entry keyword="Embedded ID mapping"><topic href="tasks009.htm#sthref124" /></entry>
- </entry>
- <entry keyword="@Entity">
- <entry keyword="Entity"><topic href="tasks004.htm#sthref80" /></entry>
- </entry>
- <entry keyword="@Enumerated">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref208" /></entry>
- </entry>
- <entry keyword="@GeneratedValue">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref217" /></entry>
- </entry>
- <entry keyword="@Id">
- <entry keyword="ID mapping"><topic href="tasks010.htm#sthref128" /></entry>
- </entry>
- <entry keyword="@Inheritance">
- <entry keyword="Specifying additional tables"><topic href="task_additonal_tables.htm#sthref98" /></entry>
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref101" /></entry>
- </entry>
- <entry keyword="@JoinColumn">
- <entry keyword="Many-to-one mapping"><topic href="tasks012.htm#sthref139" /></entry>
- <entry keyword="One-to-one mapping"><topic href="tasks014.htm#sthref149" /></entry>
- <entry keyword="Join Table Information"><topic href="reference006.htm#sthref214" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference007.htm#sthref216" /></entry>
- </entry>
- <entry keyword="@Lob">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref203" /></entry>
- </entry>
- <entry keyword="@ManyToMany">
- <entry keyword="Many-to-many mapping"><topic href="tasks011.htm#sthref132" /></entry>
- </entry>
- <entry keyword="@ManyToOne">
- <entry keyword="Many-to-one mapping"><topic href="tasks012.htm#sthref137" /></entry>
- </entry>
- <entry keyword="@MappedSuperclass">
- <entry keyword="Mapped superclass"><topic href="tasks006.htm#sthref93" /></entry>
- </entry>
- <entry keyword="@OneToMany">
- <entry keyword="One-to-many mapping"><topic href="tasks013.htm#sthref142" /></entry>
- </entry>
- <entry keyword="@OneToOne">
- <entry keyword="One-to-one mapping"><topic href="tasks014.htm#sthref146" /></entry>
- </entry>
- <entry keyword="@OrderBy">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref211" /></entry>
- </entry>
- <entry keyword="@SequenceGenerator">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref219" /></entry>
- </entry>
- <entry keyword="@Temporal">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref205" /></entry>
- </entry>
- <entry keyword="@Transient">
- <entry keyword="Transient mapping"><topic href="tasks015.htm#sthref152" /></entry>
- </entry>
- <entry keyword="@Version">
- <entry keyword="Version mapping"><topic href="tasks016.htm#sthref156" /></entry>
- </entry>
- <entry keyword="architecture of Dali feature">
- <entry keyword="Dali Developer Documentation"><topic href="reference017.htm#sthref241" /></entry>
- </entry>
- <entry keyword="attributes">
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref197" /></entry>
- </entry>
- <entry keyword="mapping">
- <entry keyword="Understanding OR mappings"><topic href="concept_mapping.htm#sthref44" /></entry>
- </entry>
- </entry>
- <entry keyword="basic mapping">
- <entry keyword="@Basic">
- <entry keyword="Basic mapping"><topic href="tasks007.htm#sthref117" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Basic mapping"><topic href="tasks007.htm#sthref115" /></entry>
- </entry>
- <entry keyword="(See also mappings)"></entry>
- </entry>
- <entry keyword="classes">
- <entry keyword="adding persistence to">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref75" /></entry>
- </entry>
- <entry keyword="embeddable">
- <entry keyword="Embeddable"><topic href="tasks005.htm#sthref85" /></entry>
- </entry>
- <entry keyword="entity">
- <entry keyword="Entity"><topic href="tasks004.htm#sthref78" /></entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="Mapped superclass"><topic href="tasks006.htm#sthref91" /></entry>
- </entry>
- <entry keyword="synchronizing">
- <entry keyword="Synchronizing classes"><topic href="tasks002.htm#sthref65" /></entry>
- </entry>
- </entry>
- <entry keyword="columns">
- <entry keyword="discriminator">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref104" /></entry>
- </entry>
- <entry keyword="join">
- <entry keyword="Many-to-one mapping"><topic href="tasks012.htm#sthref138" /></entry>
- <entry keyword="One-to-one mapping"><topic href="tasks014.htm#sthref148" /></entry>
- <entry keyword="Join Table Information"><topic href="reference006.htm#sthref213" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference007.htm#sthref215" /></entry>
- </entry>
- <entry keyword="mapping to">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref199" /></entry>
- </entry>
- <entry keyword="value">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref106" /></entry>
- </entry>
- </entry>
- <entry keyword="database tables">
- <entry keyword="generating entities from">
- <entry keyword="Generating entities from tables"><topic href="tasks017.htm#sthref162" /></entry>
- </entry>
- </entry>
- <entry keyword="database - persistence">
- <entry keyword="connection">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref228" /></entry>
- </entry>
- <entry keyword="schema">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref230" /></entry>
- </entry>
- </entry>
- <entry keyword="developer documentation - Dali">
- <entry keyword="Dali Developer Documentation"><topic href="reference017.htm#sthref240" /></entry>
- </entry>
- <entry keyword="eager fetch">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref201" /></entry>
- </entry>
- <entry keyword="embeddable class">
- <entry keyword="@Embeddable">
- <entry keyword="Embeddable"><topic href="tasks005.htm#sthref87" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embeddable"><topic href="tasks005.htm#sthref84" /></entry>
- </entry>
- </entry>
- <entry keyword="embedded ID mapping">
- <entry keyword="@EmbeddedId">
- <entry keyword="Embedded ID mapping"><topic href="tasks009.htm#sthref125" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embedded ID mapping"><topic href="tasks009.htm#sthref123" /></entry>
- </entry>
- </entry>
- <entry keyword="embedded mapping">
- <entry keyword="@Embedded">
- <entry keyword="Embedded mapping"><topic href="tasks008.htm#sthref121" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embedded mapping"><topic href="tasks008.htm#sthref119" /></entry>
- </entry>
- </entry>
- <entry keyword="entities">
- <entry keyword="@Entity annotation">
- <entry keyword="Entity"><topic href="tasks004.htm#sthref81" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Understanding Java persistence"><topic href="concept_persistence.htm#sthref43" /></entry>
- </entry>
- <entry keyword="embeddable">
- <entry keyword="Embeddable"><topic href="tasks005.htm#sthref88" /></entry>
- </entry>
- <entry keyword="from tables">
- <entry keyword="Generating entities from tables"><topic href="tasks017.htm#sthref158" /></entry>
- <entry keyword="Generate Entities from Tables dialog"><topic href="task_generate_entities.htm#sthref234" /></entry>
- </entry>
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref188" /></entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="Mapped superclass"><topic href="tasks006.htm#sthref94" /></entry>
- </entry>
- <entry keyword="mapping">
- <entry keyword="Mapping an entity"><topic href="getting_started005.htm#sthref18" /></entry>
- </entry>
- <entry keyword="persistence">
- <entry keyword="Creating a Java persistent entity"><topic href="getting_started004.htm#sthref10" /></entry>
- </entry>
- <entry keyword="persistent">
- <entry keyword="Entity"><topic href="tasks004.htm#sthref76" /></entry>
- <entry keyword="Entity"><topic href="tasks004.htm#sthref82" /></entry>
- </entry>
- <entry keyword="secondary tables">
- <entry keyword="Secondary table information"><topic href="reference004.htm#sthref191" /></entry>
- </entry>
- </entry>
- <entry keyword="enumerated">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref207" /></entry>
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref209" /></entry>
- </entry>
- <entry keyword="error messages - Dali">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks018.htm#sthref163" /></entry>
- <entry keyword="Error messages"><topic href="tasks019.htm#sthref168" /></entry>
- </entry>
- <entry keyword="extension points - Dali feature">
- <entry keyword="Dali Developer Documentation"><topic href="reference017.htm#sthref242" /></entry>
- </entry>
- <entry keyword="fetch type">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref200" /></entry>
- </entry>
- <entry keyword="Generate Entities from Tables dialog">
- <entry keyword="Generating entities from tables"><topic href="tasks017.htm#sthref161" /></entry>
- <entry keyword="Generate Entities from Tables dialog"><topic href="task_generate_entities.htm#sthref233" /></entry>
- </entry>
- <entry keyword="generated values">
- <entry keyword="ID mappings">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref218" /></entry>
- </entry>
- <entry keyword="sequence">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref220" /></entry>
- </entry>
- </entry>
- <entry keyword="ID mapping">
- <entry keyword="@Id">
- <entry keyword="ID mapping"><topic href="tasks010.htm#sthref129" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="ID mapping"><topic href="tasks010.htm#sthref127" /></entry>
- </entry>
- </entry>
- <entry keyword="inheritance">
- <entry keyword="entity">
- <entry keyword="Specifying additional tables"><topic href="task_additonal_tables.htm#sthref97" /></entry>
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref100" /></entry>
- <entry keyword="Inheritance information"><topic href="reference005.htm#sthref194" /></entry>
- </entry>
- <entry keyword="joined tables">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref112" /></entry>
- </entry>
- <entry keyword="single table">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref107" /></entry>
- </entry>
- </entry>
- <entry keyword="Inheritance - in Java Details view">
- <entry keyword="Inheritance information"><topic href="reference005.htm#sthref193" /></entry>
- </entry>
- <entry keyword="installation - Dali">
- <entry keyword="Requirements and installation"><topic href="getting_started001.htm#sthref3" /></entry>
- </entry>
- <entry keyword="joined tables - inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref113" /></entry>
- </entry>
- <entry keyword="JPA Details view">
- <entry keyword="attributes">
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref195" /></entry>
- </entry>
- <entry keyword="entities">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref186" /></entry>
- </entry>
- </entry>
- <entry keyword="JPA Development perspective">
- <entry keyword="JPA Development perspective"><topic href="ref_persistence_perspective.htm#sthref236" /></entry>
- </entry>
- <entry keyword="JPA Facet dialog">
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref56" /></entry>
- </entry>
- <entry keyword="JPA project">
- <entry keyword="creating new">
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref50" /></entry>
- </entry>
- <entry keyword="platform">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref227" /></entry>
- </entry>
- </entry>
- <entry keyword="JPA Project dialog">
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref54" /></entry>
- </entry>
- <entry keyword="JPA Structure view">
- <entry keyword="JPA Structure view"><topic href="ref_persistence_outline.htm#sthref222" /></entry>
- </entry>
- <entry keyword="lazy fetch">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref202" /></entry>
- </entry>
- <entry keyword="many-to-many mapping">
- <entry keyword="@ManyToMany">
- <entry keyword="Many-to-many mapping"><topic href="tasks011.htm#sthref133" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Many-to-many mapping"><topic href="tasks011.htm#sthref131" /></entry>
- </entry>
- </entry>
- <entry keyword="many-to-one mapping">
- <entry keyword="@ManyToOne">
- <entry keyword="Many-to-one mapping"><topic href="tasks012.htm#sthref136" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Many-to-one mapping"><topic href="tasks012.htm#sthref135" /></entry>
- </entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="@MappedSuperclass">
- <entry keyword="Mapped superclass"><topic href="tasks006.htm#sthref92" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Mapped superclass"><topic href="tasks006.htm#sthref90" /></entry>
- </entry>
- </entry>
- <entry keyword="mapping entities">
- <entry keyword="Mapping an entity"><topic href="getting_started005.htm#sthref17" /></entry>
- </entry>
- <entry keyword="mappings">
- <entry keyword="about">
- <entry keyword="Understanding OR mappings"><topic href="concept_mapping.htm#sthref45" /></entry>
- </entry>
- <entry keyword="basic">
- <entry keyword="Basic mapping"><topic href="tasks007.htm#sthref114" /></entry>
- </entry>
- <entry keyword="embedded">
- <entry keyword="Embedded mapping"><topic href="tasks008.htm#sthref118" /></entry>
- </entry>
- <entry keyword="embedded ID">
- <entry keyword="Embedded ID mapping"><topic href="tasks009.htm#sthref122" /></entry>
- </entry>
- <entry keyword="ID">
- <entry keyword="ID mapping"><topic href="tasks010.htm#sthref126" /></entry>
- </entry>
- <entry keyword="many-to-many">
- <entry keyword="Many-to-many mapping"><topic href="tasks011.htm#sthref130" /></entry>
- </entry>
- <entry keyword="many-to-one">
- <entry keyword="Many-to-one mapping"><topic href="tasks012.htm#sthref134" /></entry>
- </entry>
- <entry keyword="one-to-many">
- <entry keyword="One-to-many mapping"><topic href="tasks013.htm#sthref140" /></entry>
- </entry>
- <entry keyword="one-to-one">
- <entry keyword="One-to-one mapping"><topic href="tasks014.htm#sthref144" /></entry>
- </entry>
- <entry keyword="problems">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks018.htm#sthref166" /></entry>
- </entry>
- <entry keyword="transient">
- <entry keyword="Transient mapping"><topic href="tasks015.htm#sthref150" /></entry>
- </entry>
- <entry keyword="version">
- <entry keyword="Version mapping"><topic href="tasks016.htm#sthref154" /></entry>
- </entry>
- </entry>
- <entry keyword="New JPA Project wizard">
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref52" /></entry>
- </entry>
- <entry keyword="nonpersistent">
- <entry keyword="classes">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref74" /></entry>
- </entry>
- <entry keyword="fields. See transient"></entry>
- </entry>
- <entry keyword="one-to-many mapping">
- <entry keyword="@OneToMany">
- <entry keyword="One-to-many mapping"><topic href="tasks013.htm#sthref143" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="One-to-many mapping"><topic href="tasks013.htm#sthref141" /></entry>
- </entry>
- </entry>
- <entry keyword="one-to-one mapping">
- <entry keyword="@OneToOne">
- <entry keyword="One-to-one mapping"><topic href="tasks014.htm#sthref147" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="One-to-one mapping"><topic href="tasks014.htm#sthref145" /></entry>
- </entry>
- </entry>
- <entry keyword="@OrderBy">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref212" /></entry>
- </entry>
- <entry keyword="ordering">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref210" /></entry>
- </entry>
- <entry keyword="orm.xml file">
- <entry keyword="about">
- <entry keyword="The orm.xml file"><topic href="concepts003.htm#sthref47" /></entry>
- </entry>
- <entry keyword="managing">
- <entry keyword="Managing the orm.xml file"><topic href="task_manage_orm.htm#sthref68" /></entry>
- </entry>
- <entry keyword="sample">
- <entry keyword="Managing the orm.xml file"><topic href="task_manage_orm.htm#sthref69" /></entry>
- </entry>
- </entry>
- <entry keyword="persistence">
- <entry keyword="about">
- <entry keyword="Understanding Java persistence"><topic href="concept_persistence.htm#sthref42" /></entry>
- </entry>
- <entry keyword="database connection">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref229" /></entry>
- </entry>
- <entry keyword="database schema">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref232" /></entry>
- </entry>
- <entry keyword="entity class">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref73" /></entry>
- </entry>
- <entry keyword="options">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref224" /></entry>
- </entry>
- </entry>
- <entry keyword="Persistence XML Editor">
- <entry keyword="Working with persistence.xml file"><topic href="tasks001.htm#sthref62" /></entry>
- </entry>
- <entry keyword="persistence.xml file">
- <entry keyword="about">
- <entry keyword="The persistence.xml file"><topic href="concepts002.htm#sthref46" /></entry>
- </entry>
- <entry keyword="editor">
- <entry keyword="Working with persistence.xml file"><topic href="tasks001.htm#sthref63" /></entry>
- </entry>
- <entry keyword="managing">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref57" /></entry>
- <entry keyword="Working with persistence.xml file"><topic href="tasks001.htm#sthref60" /></entry>
- <entry keyword="Working with orm.xml file"><topic href="tasks003.htm#sthref71" /></entry>
- </entry>
- <entry keyword="sample">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref58" /></entry>
- </entry>
- <entry keyword="synchronizing with classes">
- <entry keyword="Synchronizing classes"><topic href="tasks002.htm#sthref66" /></entry>
- </entry>
- </entry>
- <entry keyword="persistent entity">
- <entry keyword="Entity"><topic href="tasks004.htm#sthref77" /></entry>
- </entry>
- <entry keyword="perspective - JPA Development">
- <entry keyword="JPA Development perspective"><topic href="ref_persistence_perspective.htm#sthref237" /></entry>
- </entry>
- <entry keyword="platform - JPA">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref226" /></entry>
- </entry>
- <entry keyword="problems">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks018.htm#sthref165" /></entry>
- </entry>
- <entry keyword="projects - JPA">
- <entry keyword="creating new">
- <entry keyword="Creating a new project"><topic href="getting_started003.htm#sthref6" /></entry>
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref49" /></entry>
- </entry>
- <entry keyword="options">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref225" /></entry>
- </entry>
- </entry>
- <entry keyword="quick start - Dali">
- <entry keyword="Dali quick start"><topic href="getting_started002.htm#sthref5" /></entry>
- </entry>
- <entry keyword="requirements">
- <entry keyword="Dali Java Persistence Tools">
- <entry keyword="Requirements and installation"><topic href="getting_started001.htm#sthref4" /></entry>
- </entry>
- <entry keyword="persistent entities">
- <entry keyword="Entity"><topic href="tasks004.htm#sthref79" /></entry>
- </entry>
- </entry>
- <entry keyword="schema - database">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref231" /></entry>
- </entry>
- <entry keyword="secondary tables">
- <entry keyword="Secondary table information"><topic href="reference004.htm#sthref189" /></entry>
- </entry>
- <entry keyword="Secondary Tables - in Java Details view">
- <entry keyword="Secondary table information"><topic href="reference004.htm#sthref192" /></entry>
- </entry>
- <entry keyword="single table inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref108" /></entry>
- </entry>
- <entry keyword="superclass">
- <entry keyword="Mapped superclass"><topic href="tasks006.htm#sthref95" /></entry>
- </entry>
- <entry keyword="tables">
- <entry keyword="creating entities from">
- <entry keyword="Generating entities from tables"><topic href="tasks017.htm#sthref159" /></entry>
- <entry keyword="Generate Entities from Tables dialog"><topic href="task_generate_entities.htm#sthref235" /></entry>
- </entry>
- <entry keyword="inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref109" /></entry>
- </entry>
- <entry keyword="secondary">
- <entry keyword="Secondary table information"><topic href="reference004.htm#sthref190" /></entry>
- </entry>
- </entry>
- <entry keyword="temporal">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref204" /></entry>
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref206" /></entry>
- </entry>
- <entry keyword="transient mapping">
- <entry keyword="@Transient">
- <entry keyword="Transient mapping"><topic href="tasks015.htm#sthref153" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Transient mapping"><topic href="tasks015.htm#sthref151" /></entry>
- </entry>
- </entry>
- <entry keyword="tutorial - Dali">
- <entry keyword="Dali basic tutorial"><topic href="getting_started006.htm#sthref21" /></entry>
- </entry>
- <entry keyword="version mapping">
- <entry keyword="@Version">
- <entry keyword="Version mapping"><topic href="tasks016.htm#sthref157" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Version mapping"><topic href="tasks016.htm#sthref155" /></entry>
- </entry>
- </entry>
- <entry keyword="views">
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref187" /></entry>
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref196" /></entry>
- </entry>
- <entry keyword="JPA Structure view">
- <entry keyword="JPA Structure view"><topic href="ref_persistence_outline.htm#sthref221" /></entry>
- </entry>
- </entry>
- <entry keyword="warning messages - Dali">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks018.htm#sthref164" /></entry>
- </entry>
- <entry keyword="wizards">
- <entry keyword="New JPA Project wizard">
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref51" /></entry>
- </entry>
- </entry>
- <entry keyword="XML editor">
- <entry keyword="Working with persistence.xml file"><topic href="tasks001.htm#sthref59" /></entry>
- <entry keyword="Working with orm.xml file"><topic href="tasks003.htm#sthref70" /></entry>
- </entry>
-</index>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm b/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm
deleted file mode 100644
index a36a2165a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:59 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Legal</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content=" Legal" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="sthref248" name="sthref248"></a></p>
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Legal</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref249" name="sthref249"></a></p>
-<p class="subhead2">Notices</p>
-<p>The material in this guide is copyright &copy; 2006, 2007 by Oracle.</p>
-<p><a href="about.htm">Terms and conditions regarding the use of this guide.</a></p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties b/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties
deleted file mode 100644
index 85654952f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 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 = Java Persistence Documentation - Doc
-providerName = Eclipse.org
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml b/jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml
deleted file mode 100644
index e7d121acd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin name="JPA Documentation Plug-in" id="org.eclipse.jpt.doc.user" version="1.0.0" provider-name="Oracle">
- <!-- =========== -->
- <!-- Define TOC -->
- <!-- =========== -->
- <extension point="org.eclipse.help.toc">
- <toc file="toc.xml" primary="true"/>
- </extension>
- <!-- =========== -->
- <!-- Define F1 -->
- <!-- =========== -->
- <extension point="org.eclipse.help.contexts">
- <contexts file="contexts.xml" plugin="org.eclipse.jpt.ui"/>
- </extension>
- <!-- ==================== -->
- <!-- Define Keyword Index -->
- <!-- ==================== -->
- <extension point="org.eclipse.help.index">
- <index file="index.xml"/>
- </extension>
- <!-- =========== -->
- <!-- Cheatsheets -->
- <!-- =========== -->
- <extension point="org.eclipse.ui.cheatsheets.cheatSheetContent">
- <category name="JPA Development" id="com.jpa.category"/>
- <cheatsheet name="Create a JPA project" category="com.jpa.category" contentFile="$nl$/cheatsheets/add_persistence.xml" id="org.eclipse.jpa.cheatsheet.createproject1">
- <description>This cheat sheet helps you create a JPA project.</description>
- </cheatsheet>
- <cheatsheet name="Create a persistent entity" category="com.jpa.category" contentFile="$nl$/cheatsheets/create_entity.xml" id="org.eclipse.jpa.cheatsheet.addentity">
- <description>This cheat sheet helps you create a Java persistent entity.</description>
- </cheatsheet>
- <cheatsheet name="Map a persistent entity" category="com.jpa.category" contentFile="$nl$/cheatsheets/map_entity.xml" id="org.eclipse.jpa.cheatsheet.mapentity">
- <description>This cheat sheet helps you map the a Java persistent entity to a database table.</description>
- </cheatsheet>
- </extension>
-</plugin>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm
deleted file mode 100644
index 3e14b3edd7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>JPA Details view (for orm.xml)</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="JPA Details view (for orm.xml)" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACGDGHC" name="CACGDGHC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>JPA Details view (for orm.xml)</h1>
-</td>
-</tr>
-</table>
-<p>The <span class="gui-object-title">JPA Details</span> view displays the default mapping and persistence information for the project and contains the following areas:</p>
-<ul>
-<li type="disc">
-<p><a href="reference008.htm#CACCACGH">General information</a></p>
-</li>
-<li type="disc">
-<p><a href="reference009.htm#CACEAGBG">Persistence Unit information</a></p>
-</li>
-</ul>
-<p>These defaults can be overridden by the settings on a specific entity or mapping.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm
deleted file mode 100644
index 305de4fead..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm
+++ /dev/null
@@ -1,91 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>JPA Facet page</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="JPA Facet page" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACIFDIF" name="CACIFDIF"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>JPA Facet page</h1>
-</td>
-</tr>
-</table>
-<p>This table lists the properties available on the JPA Facet page of the <a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate DDL - Objects page." summary="This table describes the options on the Generate DDL - Objects page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t3">Property</th>
-<th align="left" valign="bottom" id="r1c2-t3">Description</th>
-<th align="left" valign="bottom" id="r1c3-t3">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t3" headers="r1c1-t3">Platform</td>
-<td align="left" headers="r2c1-t3 r1c2-t3">Vendor-specific JPA implementation.</td>
-<td align="left" headers="r2c1-t3 r1c3-t3">Generic</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t3" headers="r1c1-t3">Connection</td>
-<td align="left" headers="r3c1-t3 r1c2-t3">Select the database connection to use with the project. Dali requires an active database connection to use and validate the persistent entities and mappings.
-<p>Click <span class="bold">Add connection</span> to create a new database connection.</p>
-</td>
-<td align="left" headers="r3c1-t3 r1c3-t3"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t3" headers="r1c1-t3">JPA Implementation</td>
-<td align="left" headers="r4c1-t3 r1c2-t3">Select to use the <span class="bold">JPA implementation provided by the server at runtime</span>, or select a specific <span class="bold">implementation library</span> that contain the Java Persistence API (JPA) and entities to be added to the project's Java Build Path.
-<p>Click <span class="bold">Configure default JPA implementation library</span> to create a default library for the project or click <span class="bold">Configure user libraries</span> to define additional libraries.</p>
-</td>
-<td align="left" headers="r4c1-t3 r1c3-t3">Determined by server.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t3" headers="r1c1-t3">Persistent class management</td>
-<td align="left" headers="r5c1-t3 r1c2-t3">Specify if Dali will <span class="bold">discover annotated classes automatically</span>, or if the <span class="bold">annotated classes must be listed in the persistence.xml</span> file.
-<p><span class="bold">Note</span>: To insure application portability, you should explicitly list the managed persistence classes that are included in the persistence unit.</p>
-</td>
-<td align="left" headers="r5c1-t3 r1c3-t3">Determined by server.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t3" headers="r1c1-t3">Create orm.xml</td>
-<td align="left" headers="r6c1-t3 r1c2-t3">Specify if Dali should create a default <code>orm.xml</code> file for your entity mappings and persistence unit defaults.</td>
-<td align="left" headers="r6c1-t3 r1c3-t3">Selected</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" --></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm
deleted file mode 100644
index 85af149d8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm
+++ /dev/null
@@ -1,213 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>General information</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACBHFIJ" name="CACBHFIJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>General information</h1>
-</td>
-</tr>
-</table>
-<p>This table lists the General properties available in the <span class="gui-object-title">Java Details view</span> for each mapping type.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view." summary="This table describes the options on the Persistence Properties view." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t6">Property</th>
-<th align="left" valign="bottom" id="r1c2-t6">Description</th>
-<th align="left" valign="bottom" id="r1c3-t6">Default</th>
-<th align="left" valign="bottom" id="r1c4-t6">Available for Mapping Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t6" headers="r1c1-t6">Map As</td>
-<td align="left" headers="r2c1-t6 r1c2-t6">Define the mapping type for the attribute</td>
-<td align="left" headers="r2c1-t6 r1c3-t6">Basic</td>
-<td align="left" headers="r2c1-t6 r1c4-t6">All mapping types</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t6" headers="r1c1-t6"><a id="CACGCBHB" name="CACGCBHB"></a>Column</td>
-<td align="left" headers="r3c1-t6 r1c2-t6"><a id="sthref198" name="sthref198"></a><a id="sthref199" name="sthref199"></a>The database column that contains the value for the attribute. This field corresponds to the <code>@Column</code> annotation.</td>
-<td align="left" headers="r3c1-t6 r1c3-t6">By default, the Column is assumed to be named identically to the attribute.</td>
-<td align="left" headers="r3c1-t6 r1c4-t6"><a href="tasks007.htm#BABBABCE">Basic mapping</a>, <a href="tasks008.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks010.htm#BABGCBHG">ID mapping</a>, <a href="tasks016.htm#BABHIBII">Version mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t6" headers="r1c1-t6">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r4c1-t6 r1c2-t6">Name of the database column.
-<p>This field corresponds to the <code>@Column</code> annotation.</p>
-</td>
-<td align="left" headers="r4c1-t6 r1c3-t6"><br /></td>
-<td align="left" headers="r4c1-t6 r1c4-t6"><a href="tasks007.htm#BABBABCE">Basic mapping</a>, <a href="tasks008.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks010.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t6" headers="r1c1-t6">&nbsp;&nbsp;Table</td>
-<td align="left" headers="r5c1-t6 r1c2-t6">Name of the database table that contains the selected column.</td>
-<td align="left" headers="r5c1-t6 r1c3-t6"><br /></td>
-<td align="left" headers="r5c1-t6 r1c4-t6"><a href="tasks007.htm#BABBABCE">Basic mapping</a>, <a href="tasks008.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks010.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t6" headers="r1c1-t6"><a id="CACGGGHB" name="CACGGGHB"></a><a id="sthref200" name="sthref200"></a><a id="sthref201" name="sthref201"></a><a id="sthref202" name="sthref202"></a>Fetch Type</td>
-<td align="left" headers="r6c1-t6 r1c2-t6">Defines how data is loaded from the database:
-<ul>
-<li type="disc">
-<p>Eager &ndash; Data is loaded in before it is actually needed.</p>
-</li>
-<li type="disc">
-<p>Lazy &ndash; Data is loaded only when required by the transaction.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r6c1-t6 r1c3-t6">Eager</td>
-<td align="left" headers="r6c1-t6 r1c4-t6"><a href="tasks007.htm#BABBABCE">Basic mapping</a>, <a href="tasks014.htm#BABFHBCJ">One-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t6" headers="r1c1-t6">Optional</td>
-<td align="left" headers="r7c1-t6 r1c2-t6">Specifies if this field is can be null.</td>
-<td align="left" headers="r7c1-t6 r1c3-t6">Yes</td>
-<td align="left" headers="r7c1-t6 r1c4-t6"><a href="tasks007.htm#BABBABCE">Basic mapping</a>, <a href="tasks014.htm#BABFHBCJ">One-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t6" headers="r1c1-t6"><a id="CACBBIBI" name="CACBBIBI"></a><a id="sthref203" name="sthref203"></a>Lob</td>
-<td align="left" headers="r8c1-t6 r1c2-t6">Specify if the field is mapped to <code>java.sql.Clob</code> or <code>java.sql.Blob</code>.
-<p>This field corresponds to the <code>@Lob</code> annotation.</p>
-</td>
-<td align="left" headers="r8c1-t6 r1c3-t6"><br /></td>
-<td align="left" headers="r8c1-t6 r1c4-t6"><a href="tasks007.htm#BABBABCE">Basic mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t6" headers="r1c1-t6"><a id="CACEAJGD" name="CACEAJGD"></a><a id="sthref204" name="sthref204"></a><a id="sthref205" name="sthref205"></a><a id="sthref206" name="sthref206"></a>Temporal</td>
-<td align="left" headers="r9c1-t6 r1c2-t6">Specifies if this field is one of the following:
-<ul>
-<li type="disc">
-<p>Date &ndash; <code>java.sql.Date</code></p>
-</li>
-<li type="disc">
-<p>Time &ndash; <code>java.sql.Time</code></p>
-</li>
-<li type="disc">
-<p>Timestamp &ndash; <code>java.sql.Timestamp</code></p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@Temporal</code> annotation.</p>
-</td>
-<td align="left" headers="r9c1-t6 r1c3-t6"><br /></td>
-<td align="left" headers="r9c1-t6 r1c4-t6"><a href="tasks007.htm#BABBABCE">Basic mapping</a>, <a href="tasks010.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t6" headers="r1c1-t6"><a id="sthref207" name="sthref207"></a><a id="sthref208" name="sthref208"></a><a id="sthref209" name="sthref209"></a>Enumerated</td>
-<td align="left" headers="r10c1-t6 r1c2-t6">Specify how to persist enumerated constraints if the <code>String</code> value suits your application requirements or to match an existing database schema.
-<ul>
-<li type="disc">
-<p>ordinal</p>
-</li>
-<li type="disc">
-<p><code>String</code></p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@Enumerated</code> annotation.</p>
-</td>
-<td align="left" headers="r10c1-t6 r1c3-t6">Ordinal</td>
-<td align="left" headers="r10c1-t6 r1c4-t6"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t6" headers="r1c1-t6">Target Entity</td>
-<td align="left" headers="r11c1-t6 r1c2-t6">The persistent entity to which the attribute is mapped.</td>
-<td align="left" headers="r11c1-t6 r1c3-t6"><br /></td>
-<td align="left" headers="r11c1-t6 r1c4-t6"><a href="tasks014.htm#BABFHBCJ">One-to-one mapping</a>,, <a href="tasks013.htm#BABHGEBD">One-to-many mapping</a> <a href="tasks011.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks012.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t6" headers="r1c1-t6"><a id="CACJAIHB" name="CACJAIHB"></a>Cascade Type</td>
-<td align="left" headers="r12c1-t6 r1c2-t6">Specify which operations are propagated throughout the entity.
-<ul>
-<li type="disc">
-<p>All &ndash; All operations</p>
-</li>
-<li type="disc">
-<p>Persist</p>
-</li>
-<li type="disc">
-<p>Merge</p>
-</li>
-<li type="disc">
-<p>Move</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r12c1-t6 r1c3-t6"><br /></td>
-<td align="left" headers="r12c1-t6 r1c4-t6"><a href="tasks014.htm#BABFHBCJ">One-to-one mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t6" headers="r1c1-t6"><a id="CACJDJJA" name="CACJDJJA"></a>Mapped By</td>
-<td align="left" headers="r13c1-t6 r1c2-t6">The field in the database table that "owns" the relationship. This field is required only on the non-owning side of the relationship.</td>
-<td align="left" headers="r13c1-t6 r1c3-t6"><br /></td>
-<td align="left" headers="r13c1-t6 r1c4-t6"><a href="tasks014.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks013.htm#BABHGEBD">One-to-many mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r14c1-t6" headers="r1c1-t6"><a id="CACDADIH" name="CACDADIH"></a><a id="sthref210" name="sthref210"></a><a id="sthref211" name="sthref211"></a><a id="sthref212" name="sthref212"></a>Order By</td>
-<td align="left" headers="r14c1-t6 r1c2-t6">Specify the default order for objects returned from a query:
-<ul>
-<li type="disc">
-<p>No ordering</p>
-</li>
-<li type="disc">
-<p>Primary key</p>
-</li>
-<li type="disc">
-<p>Custom ordering</p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@OrderBy</code> annotation.</p>
-</td>
-<td align="left" headers="r14c1-t6 r1c3-t6">Primary key</td>
-<td align="left" headers="r14c1-t6 r1c4-t6"><a href="tasks013.htm#BABHGEBD">One-to-many mapping</a>. <a href="tasks011.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks012.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r15c1-t6" headers="r1c1-t6">Attribute Overrides</td>
-<td align="left" headers="r15c1-t6 r1c2-t6">Overrides the column mappings from the mapped, entity tabled. (for example, if the inherited column name is incompatible with a pre-existing data model, or invalid as a column name in your database).</td>
-<td align="left" headers="r15c1-t6 r1c3-t6"><br /></td>
-<td align="left" headers="r15c1-t6 r1c4-t6"><a href="tasks008.htm#BABCBHDF">Embedded mapping</a>
-<p><a href="tasks008.htm#BABCBHDF">Embedded mapping</a></p>
-<br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm
deleted file mode 100644
index 2a498d7bff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm
+++ /dev/null
@@ -1,91 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>New JPA Project page</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="New JPA Project page" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACBJAGC" name="CACBJAGC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>New JPA Project page</h1>
-</td>
-</tr>
-</table>
-<p>This table lists the properties available on the New JPA Project page of the <a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate DDL - Objects page." summary="This table describes the options on the Generate DDL - Objects page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t2">Property</th>
-<th align="left" valign="bottom" id="r1c2-t2">Description</th>
-<th align="left" valign="bottom" id="r1c3-t2">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t2" headers="r1c1-t2">Project name</td>
-<td align="left" headers="r2c1-t2 r1c2-t2">Name of the Eclipse JPA project.</td>
-<td align="left" headers="r2c1-t2 r1c3-t2"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t2" headers="r1c1-t2">Project contents</td>
-<td align="left" headers="r3c1-t2 r1c2-t2">Location of the workspace in which to save the project.
-<p>Unselect The <span class="bold">Use Default</span> option and click <span class="bold">Browse</span> to select a new location.</p>
-</td>
-<td align="left" headers="r3c1-t2 r1c3-t2">Current workspace</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t2" headers="r1c1-t2">Target runtime</td>
-<td align="left" headers="r4c1-t2 r1c2-t2">Select a pre-defined target for the project.
-<p>Click <span class="bold">New</span> to create a new environment with the New Server Runtime wizard.</p>
-</td>
-<td align="left" headers="r4c1-t2 r1c3-t2"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t2" headers="r1c1-t2">Configurations</td>
-<td align="left" headers="r5c1-t2 r1c2-t2">Select a project configuration with pre-defined facets.
-<p>Select <span class="bold">&lt;custom&gt;</span> to manually select the facets for this project.</p>
-</td>
-<td align="left" headers="r5c1-t2 r1c3-t2">Utility JPA project with Java 5.0</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t2" headers="r1c1-t2">EAR membership</td>
-<td align="left" headers="r6c1-t2 r1c2-t2">Specify if this project should be included in an EAR file for deployment.
-<p>Select the <span class="bold">EAR Project Name</span>, or click <span class="bold">New</span> to create a new EAR project.</p>
-</td>
-<td align="left" headers="r6c1-t2 r1c3-t2"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm
deleted file mode 100644
index b68d3feaab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Create New JPA Project wizard</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Create New JPA Project wizard" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACBJGBG" name="CACBJGBG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Create New JPA Project wizard</h1>
-</td>
-</tr>
-</table>
-<p>The Create New JPA Project wizard allows you to create a new Java project using JPA. The wizard consists of the following pages:</p>
-<ul>
-<li type="disc">
-<p><a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a></p>
-</li>
-<li type="disc">
-<p>Project Facets page</p>
-</li>
-<li type="disc">
-<p><a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm
deleted file mode 100644
index 12fffe6c47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>JPA Details view (for attributes)</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="JPA Details view (for attributes)" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABIFBAF" name="BABIFBAF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>JPA Details view (for attributes)</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref195" name="sthref195"></a><a id="sthref196" name="sthref196"></a><a id="sthref197" name="sthref197"></a>The <span class="gui-object-title">JPA Details</span> view displays the persistence information for the currently selected mapped attribute and contains the following areas:</p>
-<ul>
-<li type="disc">
-<p><a href="ref_mapping_general.htm#CACBHFIJ">General information</a></p>
-</li>
-<li type="disc">
-<p><a href="reference006.htm#CACBAEBC">Join Table Information</a></p>
-</li>
-<li type="disc">
-<p><a href="reference007.htm#CACFCEJC">Join Columns Information</a></p>
-</li>
-<li type="disc">
-<p><a href="ref_primary_key.htm#CACFCCAB">Primary Key Generation information</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm
deleted file mode 100644
index 083c276125..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>JPA Structure view</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="JPA Structure view" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABEGGFE" name="BABEGGFE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>JPA Structure view</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref221" name="sthref221"></a><a id="sthref222" name="sthref222"></a>The <span class="gui-object-title">JPA Structure</span> view displays an outline of the structure (its attributes and mappings) of the entity that is currently selected or opened in the editor. The structural elements shown in the outline are the entity and its fields.</p>
-<div class="figure"><a id="sthref223" name="sthref223"></a>
-<p class="titleinfigure">Sample JPA Structure View</p>
-<img src="img/persistence_outline_view.png" alt="Sample JPA Structure view for an entity." title="Sample JPA Structure view for an entity." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm
deleted file mode 100644
index 92641ca69c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>JPA Development perspective</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="JPA Development perspective" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABIFBDB" name="BABIFBDB"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>JPA Development perspective</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref236" name="sthref236"></a><a id="sthref237" name="sthref237"></a>The <span class="bold">JPA Development perspective</span> defines the initial set and layout of views in the Workbench window when using Dali. By default, the <span class="gui-object-title">JPA Development perspective</span> includes the following vies:</p>
-<ul>
-<li type="disc">
-<p><a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a></p>
-</li>
-<li type="disc">
-<p><a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></p>
-</li>
-<li type="disc">
-<p><a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></p>
-</li>
-<li type="disc">
-<p><a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></p>
-</li>
-</ul>
-<div class="figure"><a id="sthref238" name="sthref238"></a>
-<p class="titleinfigure">Sample JPA Development Perspective</p>
-<img src="img/persistence_perspective.png" alt="JPA Development perspective with the JPA Structure and JPA Details views." title="JPA Development perspective with the JPA Structure and JPA Details views." /><br /></div>
-<!-- class="figure" -->
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/concepts-4.htm">Perspectives</a></p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm
deleted file mode 100644
index 83e0d102ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>JPA Details view (for entities)</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="JPA Details view (for entities)" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABFAEBB" name="BABFAEBB"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>JPA Details view (for entities)</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref186" name="sthref186"></a><a id="sthref187" name="sthref187"></a><a id="sthref188" name="sthref188"></a>The <span class="gui-object-title">JPA Details</span> view displays the persistence information for the currently selected entity and contains the following tabs:</p>
-<ul>
-<li type="disc">
-<p><a href="reference003.htm#CACCAGGC">General information</a></p>
-</li>
-<li type="disc">
-<p><a href="reference004.htm#CACBHIDA">Secondary table information</a></p>
-</li>
-<li type="disc">
-<p><a href="reference005.htm#CACFHGHE">Inheritance information</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm
deleted file mode 100644
index 887580090e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm
+++ /dev/null
@@ -1,144 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Primary Key Generation information</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Primary Key Generation information" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACFCCAB" name="CACFCCAB"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Primary Key Generation information</h1>
-</td>
-</tr>
-</table>
-<p>This table lists the fields available in the <span class="gui-object-title">Primary Key Generation</span> area in JPA Details view for <a href="tasks010.htm#BABGCBHG">ID mapping</a> types.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Join Columns tab." summary="This table describes the options on the Join Columns tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t9">Property</th>
-<th align="left" valign="bottom" id="r1c2-t9">Description</th>
-<th align="left" valign="bottom" id="r1c3-t9">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t9" headers="r1c1-t9"><a id="CACBAJBC" name="CACBAJBC"></a>Primary Key Generation</td>
-<td align="left" headers="r2c1-t9 r1c2-t9"><a id="sthref217" name="sthref217"></a><a id="sthref218" name="sthref218"></a>These fields define how the primary key is generated. These fields correspond to the <code>@GeneratedValue</code> annotation.</td>
-<td align="left" headers="r2c1-t9 r1c3-t9">Generated Value</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t9" headers="r1c1-t9"><a id="CACJEEEC" name="CACJEEEC"></a>&nbsp;&nbsp;&nbsp;Strategy</td>
-<td align="left" headers="r3c1-t9 r1c2-t9">
-<ul>
-<li type="disc">Auto</li>
-<li type="disc">
-<p>Identity &ndash; Values are assigned by the database's <span class="bold">Identity</span> column.</p>
-</li>
-<li type="disc">
-<p>Sequence &ndash; Values are assigned by a sequence table (see <a href="#CACFFHEH">Sequence&nbsp;Generator</a>).</p>
-</li>
-<li type="disc">
-<p>Table &ndash; Values are assigned by a database table (see <a href="#CACGFEAH">Table Generator</a>).</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t9 r1c3-t9">Auto</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t9" headers="r1c1-t9"><a id="BABEEAHJ" name="BABEEAHJ"></a>&nbsp;&nbsp;Generator Name</td>
-<td align="left" headers="r4c1-t9 r1c2-t9">Unique name of the generated value.</td>
-<td align="left" headers="r4c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t9" headers="r1c1-t9"><a id="CACGFEAH" name="CACGFEAH"></a>Table Generator</td>
-<td align="left" headers="r5c1-t9 r1c2-t9">These fields define the database table used for generating the primary key and correspond to the <code>@TableGenerator</code> annotation.
-<p>These fields apply only when <span class="bold">Strategy</span>&nbsp;=&nbsp;<span class="bold">Table</span>.</p>
-</td>
-<td align="left" headers="r5c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t9" headers="r1c1-t9">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r6c1-t9 r1c2-t9">Unique name of the generator.</td>
-<td align="left" headers="r6c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t9" headers="r1c1-t9">&nbsp;&nbsp;Table</td>
-<td align="left" headers="r7c1-t9 r1c2-t9">Database table that stores the generated ID values.</td>
-<td align="left" headers="r7c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t9" headers="r1c1-t9">&nbsp;&nbsp;Primary Key Column</td>
-<td align="left" headers="r8c1-t9 r1c2-t9">The column in the table generator's <span class="bold">Table</span> that contains the primary key.</td>
-<td align="left" headers="r8c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t9" headers="r1c1-t9">&nbsp;&nbsp;Value Column</td>
-<td align="left" headers="r9c1-t9 r1c2-t9">The column that stores the generated ID values.</td>
-<td align="left" headers="r9c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t9" headers="r1c1-t9">&nbsp;&nbsp;Primary Key Column Value</td>
-<td align="left" headers="r10c1-t9 r1c2-t9">The value for the <span class="bold">Primary Key Column</span> in the generator table.</td>
-<td align="left" headers="r10c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t9" headers="r1c1-t9"><a id="CACFFHEH" name="CACFFHEH"></a>Sequence&nbsp;Generator</td>
-<td align="left" headers="r11c1-t9 r1c2-t9"><a id="sthref219" name="sthref219"></a><a id="sthref220" name="sthref220"></a>These fields define the specific sequence used for generating the primary key and correspond to the <code>@SequenceGenerator</code> annotation.
-<p>These fields apply only when <span class="bold">Strategy</span> = <span class="bold">Sequence</span>.</p>
-</td>
-<td align="left" headers="r11c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t9" headers="r1c1-t9">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r12c1-t9 r1c2-t9">Name of the sequence table to use for defining primary key values.</td>
-<td align="left" headers="r12c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t9" headers="r1c1-t9">&nbsp;&nbsp;Sequence</td>
-<td align="left" headers="r13c1-t9 r1c2-t9">Unique name of the sequence.</td>
-<td align="left" headers="r13c1-t9 r1c3-t9"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks010.htm#BABGCBHG">ID mapping</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm
deleted file mode 100644
index 9b7ac94a87..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm
+++ /dev/null
@@ -1,80 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Project Properties page - JPA Options</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Project Properties page - JPA Options" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABJHBCI" name="BABJHBCI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Project Properties page &ndash; JPA Options</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref224" name="sthref224"></a><a id="sthref225" name="sthref225"></a>Use the <span class="gui-object-title">JPA</span> options on the <span class="gui-object-title">Properties</span> page to select the database connection to use with the project.</p>
-<p>This table lists the properties available in the <span class="gui-object-title">Persistence Properties page</span>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Persistence Properties page." summary="This table describes the options on the Persistence Properties page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t12">Property</th>
-<th align="left" valign="bottom" id="r1c2-t12">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t12" headers="r1c1-t12"><a id="sthref226" name="sthref226"></a><a id="sthref227" name="sthref227"></a><a id="sthref228" name="sthref228"></a><a id="sthref229" name="sthref229"></a>Platform</td>
-<td align="left" headers="r2c1-t12 r1c2-t12">Select the vendor-specific platform.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t12" headers="r1c1-t12"><a id="sthref230" name="sthref230"></a><a id="sthref231" name="sthref231"></a><a id="sthref232" name="sthref232"></a>Connection</td>
-<td align="left" headers="r3c1-t12 r1c2-t12">The database connection used to map the persistent entities.
-<ul>
-<li type="disc">
-<p>To create a new connection, click <span class="bold">Add Connections</span>.</p>
-</li>
-<li type="disc">
-<p>To reconnect to an existing connection, click <span class="bold">Reconnect</span>.</p>
-</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks021.htm#BABDBCBI">Modifying persistent project properties</a></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm
deleted file mode 100644
index 7e82de0d86..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Reference</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content=" Reference" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="sthref185" name="sthref185"></a></p>
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Reference</h1>
-</td>
-</tr>
-</table>
-<p>This section includes detailed help information for each of the following elements in the Dali OR Mapping Tool:</p>
-<ul>
-<li type="disc">
-<p><a href="reference001.htm#CACJJJJH">Wizards</a></p>
-</li>
-<li type="disc">
-<p><a href="reference002.htm#CACDJIIG">Property pages</a></p>
-</li>
-<li type="disc">
-<p><a href="reference010.htm#CACDEIEE">Preferences</a></p>
-</li>
-<li type="disc">
-<p><a href="reference011.htm#CACGEJDA">Dialogs</a></p>
-</li>
-<li type="disc">
-<p><a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a></p>
-</li>
-<li type="disc">
-<p><a href="reference013.htm#CACDHCIA">Icons and buttons</a></p>
-</li>
-<li type="disc">
-<p><a href="reference017.htm#CACBBDIB">Dali Developer Documentation</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm
deleted file mode 100644
index cc6300ff36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Wizards</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Wizards" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACJJJJH" name="CACJJJJH"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Wizards</h1>
-</td>
-</tr>
-</table>
-<p>This section includes information on the following wizards:</p>
-<ul>
-<li type="disc">
-<p><a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm
deleted file mode 100644
index 8a6374bf83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Property pages</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Property pages" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACDJIIG" name="CACDJIIG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Property pages</h1>
-</td>
-</tr>
-</table>
-<p>This section includes information on the following property pages:</p>
-<ul>
-<li type="disc">
-<p><a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></p>
-</li>
-<li type="disc">
-<p><a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></p>
-</li>
-<li type="disc">
-<p><a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></p>
-</li>
-<li type="disc">
-<p><a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm
deleted file mode 100644
index 57d9770f64..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm
+++ /dev/null
@@ -1,115 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>General information</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACCAGGC" name="CACCAGGC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>General information</h1>
-</td>
-</tr>
-</table>
-<p>This table lists the General information fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t4">Property</th>
-<th align="left" valign="bottom" id="r1c2-t4">Description</th>
-<th align="left" valign="bottom" id="r1c3-t4">Default</th>
-<th align="left" valign="bottom" id="r1c4-t4">Available for Entity&nbsp;Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t4" headers="r1c1-t4">Map As</td>
-<td align="left" headers="r2c1-t4 r1c2-t4">Specify the type of entity: <span class="bold">Entity</span>, Mapped Superclass, Embeddable.</td>
-<td align="left" headers="r2c1-t4 r1c3-t4">Entity</td>
-<td align="left" headers="r2c1-t4 r1c4-t4"><a href="tasks004.htm#BABGBIEE">Entity</a>, <a href="tasks005.htm#BABFEICE">Embeddable</a>, and <a href="tasks006.htm#BABDAGCI">Mapped superclass</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t4" headers="r1c1-t4">Name</td>
-<td align="left" headers="r3c1-t4 r1c2-t4">The name of this entity. By default, the class name is used as the entity name.</td>
-<td align="left" headers="r3c1-t4 r1c3-t4"><br /></td>
-<td align="left" headers="r3c1-t4 r1c4-t4"><a href="tasks004.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t4" headers="r1c1-t4">Table</td>
-<td align="left" headers="r4c1-t4 r1c2-t4">The primary database table associated with the entity.</td>
-<td align="left" headers="r4c1-t4 r1c3-t4"><br /></td>
-<td align="left" headers="r4c1-t4 r1c4-t4"><a href="tasks004.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t4" headers="r1c1-t4">Catalog</td>
-<td align="left" headers="r5c1-t4 r1c2-t4">The database catalog that contains the <span class="bold">Table</span>.</td>
-<td align="left" headers="r5c1-t4 r1c3-t4">As defined in <code>orm.xml</code>.</td>
-<td align="left" headers="r5c1-t4 r1c4-t4"><a href="tasks004.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t4" headers="r1c1-t4">Schema</td>
-<td align="left" headers="r6c1-t4 r1c2-t4">The database schema that contains the <span class="bold">Table</span>.</td>
-<td align="left" headers="r6c1-t4 r1c3-t4">As defined in <code>orm.xml</code>.</td>
-<td align="left" headers="r6c1-t4 r1c4-t4"><a href="tasks004.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t4" headers="r1c1-t4">Attribute Overrides</td>
-<td align="left" headers="r7c1-t4 r1c2-t4">Specify a property or field to be overridden (from the default mappings). Select <span class="bold">Override Default</span>.</td>
-<td align="left" headers="r7c1-t4 r1c3-t4"><br /></td>
-<td align="left" headers="r7c1-t4 r1c4-t4"><a href="tasks004.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t4" headers="r1c1-t4">&nbsp;&nbsp;Column</td>
-<td align="left" headers="r8c1-t4 r1c2-t4">The database column (from the <span class="bold">Table Name</span>) mapped to the entity.</td>
-<td align="left" headers="r8c1-t4 r1c3-t4"><br /></td>
-<td align="left" headers="r8c1-t4 r1c4-t4"><a href="tasks004.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t4" headers="r1c1-t4">&nbsp;&nbsp;Table</td>
-<td align="left" headers="r9c1-t4 r1c2-t4">Name of the database table that contains the selected column.</td>
-<td align="left" headers="r9c1-t4 r1c3-t4"><br /></td>
-<td align="left" headers="r9c1-t4 r1c4-t4"><a href="tasks004.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm
deleted file mode 100644
index b695f6856c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Secondary table information</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Secondary table information" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACBHIDA" name="CACBHIDA"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Secondary table information</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref189" name="sthref189"></a><a id="sthref190" name="sthref190"></a><a id="sthref191" name="sthref191"></a><a id="sthref192" name="sthref192"></a>Use the <span class="gui-object-title">Secondary Tables</span> area in the <span class="gui-object-title">Java Details</span> view to associate additional tables with an entity. Use this area if the data associated with an entity is spread across multiple tables.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm
deleted file mode 100644
index 6fa75a1e4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm
+++ /dev/null
@@ -1,108 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Inheritance information</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Inheritance information" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACFHGHE" name="CACFHGHE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Inheritance information</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref193" name="sthref193"></a><a id="sthref194" name="sthref194"></a>This table lists the fields available on the <span class="gui-object-title">Inheritance</span> area in the <span class="gui-object-title">Java Details</span> view for each entity type.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, Inheritance tab." summary="This table describes the options on the Persistence Properties view, Inheritance tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t5">Property</th>
-<th align="left" valign="bottom" id="r1c2-t5">Description</th>
-<th align="left" valign="bottom" id="r1c3-t5">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t5" headers="r1c1-t5">Strategy</td>
-<td align="left" headers="r2c1-t5 r1c2-t5">Specify the strategy to use when mapping a class or class hierarchy:
-<ul>
-<li type="disc">
-<p>Single table &ndash; All classes in the hierarchy are mapped to a single table.</p>
-</li>
-<li type="disc">
-<p>Joined &ndash; The root of the hierarchy is mapped to a single table; each child maps to its own table.</p>
-</li>
-<li type="disc">
-<p>Table per class &ndash; Each class is mapped to a separate table.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t5 r1c3-t5">Single table</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t5" headers="r1c1-t5">Discriminator Column</td>
-<td align="left" headers="r3c1-t5 r1c2-t5">Use to specify the name of the discriminator column when using a <span class="bold">Single</span> or <span class="bold">Joined</span> inheritance strategy.</td>
-<td align="left" headers="r3c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t5" headers="r1c1-t5">Discriminator Type</td>
-<td align="left" headers="r4c1-t5 r1c2-t5">Set this field to set the discriminator type to <code>Char</code> or <code>Integer</code> (instead of its default: <code>String</code>). The <span class="bold">Discriminator Value</span> must conform to this type.</td>
-<td align="left" headers="r4c1-t5 r1c3-t5">String</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t5" headers="r1c1-t5">Discriminator Value</td>
-<td align="left" headers="r5c1-t5 r1c2-t5">Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified <span class="bold">Discriminator Type</span>.</td>
-<td align="left" headers="r5c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t5" headers="r1c1-t5">Primary Key Join Columns</td>
-<td align="left" headers="r6c1-t5 r1c2-t5">
-<p>Select <span class="bold">Override Default</span>.</p>
-<p>This field corresponds with @PrimaryKeyJoinColumn annotation.</p>
-</td>
-<td align="left" headers="r6c1-t5 r1c3-t5"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm
deleted file mode 100644
index e6dee40319..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Join Table Information</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Join Table Information" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACBAEBC" name="CACBAEBC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Join Table Information</h1>
-</td>
-</tr>
-</table>
-<p>Use area to specify a mapped column for joining an entity association. By default, the mapping is assumed to have a single join.</p>
-<p>This table lists the fields available on the <span class="gui-object-title">Join Table</span> area in <span class="gui-object-title">the JPA Details</span> view for <a href="tasks013.htm#BABHGEBD">One-to-many mapping</a> and <a href="tasks011.htm#BABEIEGD">Many-to-many mapping</a> mapping types.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Join Table tab." summary="This table describes the options on the Join Table tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t7">Property</th>
-<th align="left" valign="bottom" id="r1c2-t7">Description</th>
-<th align="left" valign="bottom" id="r1c3-t7">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t7" headers="r1c1-t7">Name</td>
-<td align="left" headers="r2c1-t7 r1c2-t7">Name of the join table that contains the foreign key column.</td>
-<td align="left" headers="r2c1-t7 r1c3-t7">By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t7" headers="r1c1-t7"><a id="CACBBDFG" name="CACBBDFG"></a>Join Columns</td>
-<td align="left" headers="r3c1-t7 r1c2-t7"><a id="sthref213" name="sthref213"></a><a id="sthref214" name="sthref214"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r3c1-t7 r1c3-t7">By default, the mapping is assumed to have a single join.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t7" headers="r1c1-t7">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t7 r1c2-t7">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r4c1-t7 r1c3-t7"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="reference012.htm#CACCGEHC">Edit Join Columns Dialog</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm
deleted file mode 100644
index 9ca50cdeaa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm
+++ /dev/null
@@ -1,73 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Join Columns Information</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Join Columns Information" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACFCEJC" name="CACFCEJC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Join Columns Information</h1>
-</td>
-</tr>
-</table>
-<p>This table lists the fields available in the <span class="gui-object-title">Join Table</span> area in <span class="gui-object-title">JPA Details</span> view for <a href="tasks012.htm#BABHFAFJ">Many-to-one mapping</a> and <a href="tasks014.htm#BABFHBCJ">One-to-one mapping</a> mapping types.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Join Columns tab." summary="This table describes the options on the Join Columns tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t8">Property</th>
-<th align="left" valign="bottom" id="r1c2-t8">Description</th>
-<th align="left" valign="bottom" id="r1c3-t8">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t8" headers="r1c1-t8">Join Column</td>
-<td align="left" headers="r2c1-t8 r1c2-t8"><a id="sthref215" name="sthref215"></a><a id="sthref216" name="sthref216"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r2c1-t8 r1c3-t8">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="reference012.htm#CACCGEHC">Edit Join Columns Dialog</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm
deleted file mode 100644
index ec9b54d253..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm
+++ /dev/null
@@ -1,100 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>General information</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACCACGH" name="CACCACGH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>General information</h1>
-</td>
-</tr>
-</table>
-<p>This table lists the General information fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t10">Property</th>
-<th align="left" valign="bottom" id="r1c2-t10">Description</th>
-<th align="left" valign="bottom" id="r1c3-t10">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t10" headers="r1c1-t10">Package</td>
-<td align="left" headers="r2c1-t10 r1c2-t10">The Java package that contains the persistent entities. Click <span class="bold">Browse</span> and select the package</td>
-<td align="left" headers="r2c1-t10 r1c3-t10"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t10" headers="r1c1-t10">Schema</td>
-<td align="left" headers="r3c1-t10 r1c2-t10">The database schema that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;schema&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r3c1-t10 r1c3-t10"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t10" headers="r1c1-t10">Catalog</td>
-<td align="left" headers="r4c1-t10 r1c2-t10">The database catalog that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;catalog&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r4c1-t10 r1c3-t10"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t10" headers="r1c1-t10">Access</td>
-<td align="left" headers="r5c1-t10 r1c2-t10">Specify the default access method for the variables in the project:
-<ul>
-<li type="disc">
-<p>Property</p>
-</li>
-<li type="disc">
-<p>Field</p>
-</li>
-</ul>
-<p>This field corresponds to the <code>&lt;access&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r5c1-t10 r1c3-t10"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm
deleted file mode 100644
index efc2cf7b67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm
+++ /dev/null
@@ -1,102 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Persistence Unit information</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Persistence Unit information" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACEAGBG" name="CACEAGBG"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Persistence Unit information</h1>
-</td>
-</tr>
-</table>
-<p>This table lists the Persistence Unit information fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type. These fields are contained in the <code>&lt;persistence-unit-metadata&gt;</code> element in the <code>orm.xml</code> file.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t11">Property</th>
-<th align="left" valign="bottom" id="r1c2-t11">Description</th>
-<th align="left" valign="bottom" id="r1c3-t11">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t11" headers="r1c1-t11">XML Mapping Data Complete</td>
-<td align="left" headers="r2c1-t11 r1c2-t11">Specifies that the Java classes in this persistence unit are fully specified by their metadata. Any annotations will be ignored.
-<p>This field corresponds to the <code>&lt;xml-mapping-metadata-complete&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r2c1-t11 r1c3-t11"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t11" headers="r1c1-t11">Package</td>
-<td align="left" headers="r3c1-t11 r1c2-t11">The Java package that contains the persistent entities for this persistence unit.
-<p>Click <span class="bold">Browse</span> and select the package</p>
-</td>
-<td align="left" headers="r3c1-t11 r1c3-t11"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t11" headers="r1c1-t11">Schema</td>
-<td align="left" headers="r4c1-t11 r1c2-t11">The database schema that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;schema&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r4c1-t11 r1c3-t11"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t11" headers="r1c1-t11">Catalog</td>
-<td align="left" headers="r5c1-t11 r1c2-t11">The database catalog that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;catalog&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r5c1-t11 r1c3-t11"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t11" headers="r1c1-t11">Cascade Persist</td>
-<td align="left" headers="r6c1-t11 r1c2-t11">Adds cascade-persist to the set of cascade options in entity relationships of the persistence unit.
-<p>This field corresponds to the <code>&lt;cascade-persist&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r6c1-t11 r1c3-t11"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm
deleted file mode 100644
index bf02a646bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Preferences</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Preferences" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACDEIEE" name="CACDEIEE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Preferences</h1>
-</td>
-</tr>
-</table>
-<p>This section includes information on the following preference pages:</p>
-<ul>
-<li type="disc">
-<p><a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; JPA Options</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm
deleted file mode 100644
index ff0ec97ca8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Dialogs</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Dialogs" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACGEJDA" name="CACGEJDA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Dialogs</h1>
-</td>
-</tr>
-</table>
-<p>This section includes information on the following preference pages:</p>
-<ul>
-<li type="disc">
-<p><a href="task_generate_entities.htm#CACDAFJD">Generate Entities from Tables dialog</a></p>
-</li>
-<li type="disc">
-<p><a href="reference012.htm#CACCGEHC">Edit Join Columns Dialog</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm
deleted file mode 100644
index 6c01c652ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm
+++ /dev/null
@@ -1,71 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Edit Join Columns Dialog</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Edit Join Columns Dialog" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACCGEHC" name="CACCGEHC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Edit Join Columns Dialog</h1>
-</td>
-</tr>
-</table>
-<p>Use the <span class="gui-object-title">Join Columns</span> dialog to create or modify the join tables and columns in relationship mappings.</p>
-<p>This table lists the properties available in the <span class="gui-object-title">Join Columns</span> dialog.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Join Columns dialog." summary="This table describes the options on the Join Columns dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t14">Property</th>
-<th align="left" valign="bottom" id="r1c2-t14">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t14" headers="r1c1-t14">Name</td>
-<td align="left" headers="r2c1-t14 r1c2-t14">Name of the joint table column that contains the foreign key column.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t14" headers="r1c1-t14">Referenced Column Name</td>
-<td align="left" headers="r3c1-t14 r1c2-t14">Name of the database column that contains the foreign key reference for the entity relationship.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="reference006.htm#CACBAEBC">Join Table Information</a><br />
-<a href="reference007.htm#CACFCEJC">Join Columns Information</a></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm
deleted file mode 100644
index 8f9da2fc87..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:58 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Icons and buttons</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Icons and buttons" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACDHCIA" name="CACDHCIA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Icons and buttons</h1>
-</td>
-</tr>
-</table>
-<p>This section includes information on each of the icons and buttons used in the Dali OR Mapping Tool.</p>
-<ul>
-<li type="disc">
-<p><a href="reference014.htm#CACGEACG">Icons</a></p>
-</li>
-<li type="disc">
-<p><a href="reference015.htm#CACDJCEI">Buttons</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm
deleted file mode 100644
index 22e9292c83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm
+++ /dev/null
@@ -1,116 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:58 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Icons</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Icons" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACGEACG" name="CACGEACG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Icons</h1>
-</td>
-</tr>
-</table>
-<p>The following icons are used throughout the Dali OR Mapping Tool.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the icons used in the Dali plug-in." summary="This table describes the icons used in the Dali plug-in." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t15">Icon</th>
-<th align="left" valign="bottom" id="r1c2-t15">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t15" headers="r1c1-t15"><img src="img/icon_nonpersistent.png" alt="Nonpersistent class icon" title="Nonpersistent class icon" /><br /></td>
-<td align="left" headers="r2c1-t15 r1c2-t15">Nonpersistent class</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t15" headers="r1c1-t15"><img src="img/icon_persistent.png" alt="Persistent entity icon" title="Persistent entity icon" /><br /></td>
-<td align="left" headers="r3c1-t15 r1c2-t15"><a href="tasks004.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t15" headers="r1c1-t15"><img src="img/icon_embeddable.png" alt="Embeddable entity icon" title="Embeddable entity icon" /><br /></td>
-<td align="left" headers="r4c1-t15 r1c2-t15"><a href="tasks005.htm#BABFEICE">Embeddable</a> entity</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t15" headers="r1c1-t15"><img src="img/icon_superclass.png" alt="Mapped superclass icon" title="Mapped superclass icon" /><br /></td>
-<td align="left" headers="r5c1-t15 r1c2-t15"><a href="tasks006.htm#BABDAGCI">Mapped superclass</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t15" headers="r1c1-t15"><img src="img/icon_basicmapping.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r6c1-t15 r1c2-t15"><a href="tasks007.htm#BABBABCE">Basic mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t15" headers="r1c1-t15"><img src="img/icon_embeddedmapping.png" alt="Embedded mapping icon" title="Embedded mapping icon" /><br /></td>
-<td align="left" headers="r7c1-t15 r1c2-t15"><a href="tasks008.htm#BABCBHDF">Embedded mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t15" headers="r1c1-t15"><img src="img/icon_embeddedidmapping.png" alt="Embedded ID mapping icon" title="Embedded ID mapping icon" /><br /></td>
-<td align="left" headers="r8c1-t15 r1c2-t15"><a href="tasks009.htm#CIHDIAEE">Embedded ID mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t15" headers="r1c1-t15"><img src="img/icon_idmapping.png" alt="ID mapping icon" title="ID mapping icon" /><br /></td>
-<td align="left" headers="r9c1-t15 r1c2-t15"><a href="tasks010.htm#BABGCBHG">ID mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t15" headers="r1c1-t15"><img src="img/icon_mmmapping.png" alt="Many-to-many mapping icon" title="Many-to-many mapping icon" /><br /></td>
-<td align="left" headers="r10c1-t15 r1c2-t15"><a href="tasks011.htm#BABEIEGD">Many-to-many mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t15" headers="r1c1-t15"><img src="img/icon_m1mapping.png" alt="Many-to-one mapping icon" title="Many-to-one mapping icon" /><br /></td>
-<td align="left" headers="r11c1-t15 r1c2-t15"><a href="tasks012.htm#BABHFAFJ">Many-to-one mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t15" headers="r1c1-t15"><img src="img/icon_1mmapping.png" alt="One-to-many mapping icon" title="One-to-many mapping icon" /><br /></td>
-<td align="left" headers="r12c1-t15 r1c2-t15"><a href="tasks013.htm#BABHGEBD">One-to-many mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t15" headers="r1c1-t15"><img src="img/icon_11mapping.png" alt="One-to-one mapping icon" title="One-to-one mapping icon" /><br /></td>
-<td align="left" headers="r13c1-t15 r1c2-t15"><a href="tasks014.htm#BABFHBCJ">One-to-one mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r14c1-t15" headers="r1c1-t15"><img src="img/icon_transientmapping.png" alt="Transient mapping icon" title="Transient mapping icon" /><br /></td>
-<td align="left" headers="r14c1-t15 r1c2-t15"><a href="tasks015.htm#BABHFHEI">Transient mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r15c1-t15" headers="r1c1-t15"><img src="img/icon_versionmapping.png" alt="Version mapping icon" title="Version mapping icon" /><br /></td>
-<td align="left" headers="r15c1-t15 r1c2-t15"><a href="tasks016.htm#BABHIBII">Version mapping</a><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="reference013.htm#CACDHCIA">Icons and buttons</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm
deleted file mode 100644
index 40e1ef2249..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:58 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Buttons</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Buttons" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACDJCEI" name="CACDJCEI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Buttons</h1>
-</td>
-</tr>
-</table>
-<p>The following buttons are used throughout the Dali OR Mapping Tool.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the buttons used in the Dali plug-in." summary="This table describes the buttons used in the Dali plug-in." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t16">Icon</th>
-<th align="left" valign="bottom" id="r1c2-t16">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t16" headers="r1c1-t16"><img src="img/button_jpa_perspective.png" alt="Persistence Perspective button" title="Persistence Perspective button" /><br /></td>
-<td align="left" headers="r2c1-t16 r1c2-t16">JPA Development perspective</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="reference013.htm#CACDHCIA">Icons and buttons</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm
deleted file mode 100644
index 7c7c5271e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:58 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Javadoc</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Javadoc" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref239" name="sthref239"></a>
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Javadoc</h1>
-</td>
-</tr>
-</table>
-<p>There is no public API for Release 1.0.0. Please refer to the <a href="reference017.htm#CACBBDIB">Dali Developer Documentation</a> for additional information.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm
deleted file mode 100644
index 67612290f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:58 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Dali Developer Documentation</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Dali Developer Documentation" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACBBDIB" name="CACBBDIB"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Dali Developer Documentation</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref240" name="sthref240"></a><a id="sthref241" name="sthref241"></a><a id="sthref242" name="sthref242"></a>Additional Dali documentation is available online at:</p>
-<p><code><a href="http://wiki.eclipse.org/index.php/Dali_Developer_Documentation">http://wiki.eclipse.org/index.php/Dali_Developer_Documentation</a></code></p>
-<p>This developer documentation includes information about:</p>
-<ul>
-<li type="disc">
-<p>Dali architecture</p>
-</li>
-<li type="disc">
-<p>Plugins that comprise the Dali JPA Eclipse feature</p>
-</li>
-<li type="disc">
-<p>Extension points</p>
-</li>
-</ul>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm
deleted file mode 100644
index 9463c8bb14..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:54 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Adding persistence to a class</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Adding persistence to a class" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABHICAI" name="BABHICAI"></a></p>
-<div class="sect1">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Adding persistence to a class</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref73" name="sthref73"></a><a id="sthref74" name="sthref74"></a><a id="sthref75" name="sthref75"></a>You can make a Java class into one of the following persistent types:</p>
-<ul>
-<li type="disc">
-<p><a href="tasks004.htm#BABGBIEE">Entity</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks005.htm#BABFEICE">Embeddable</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks006.htm#BABDAGCI">Mapped superclass</a></p>
-</li>
-</ul>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts003.htm#CHDBIJAC">The orm.xml file</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a> <!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm
deleted file mode 100644
index 0674fcdf7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:54 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Specifying additional tables</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Specifying additional tables" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CIHGBIEI" name="CIHGBIEI"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Specifying additional tables</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref97" name="sthref97"></a><a id="sthref98" name="sthref98"></a>An entity may inherit properties from other entities. You can specify a specific strategy to use for inheritance.</p>
-<p>Use this procedure to specify inheritance (<code>@Inheritance)</code> for an existing entity (<code>@Entity</code>):</p>
-<ol type="1" start="1">
-<li>
-<p>Select the entity in the <span class="gui-object-title">Package Explorer</span>.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, select the <span class="gui-object-action">Secondary Tables</span> information.</p>
-<div class="figure"><a id="sthref99" name="sthref99"></a>
-<p class="titleinfigure">Specifying Secondary Tables</p>
-<img src="img/secondary_tables.png" alt="Secondary Tables area on the JPA Details view." title="Secondary Tables area on the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Click <span class="bold">Add</span> to associate an additional table with the entity. The Edit Secondary Table dialog appears</p>
-</li>
-<li>
-<p>Select the <span class="bold">Name</span>, <span class="bold">Catalog</span>, and <span class="bold">Schema</span> of the additional table to associate with the entity.</p>
-</li>
-</ol>
-<p>Eclipse adds the following annotations the entity:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@SecondaryTable(name="NAME", catalog = "CATALOG", schema = "SCHEMA"
-
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br /></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm
deleted file mode 100644
index 61239561d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm
+++ /dev/null
@@ -1,103 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Creating a new JPA project</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Creating a new JPA project" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CIHHEJCJ" name="CIHHEJCJ"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Creating a new JPA project</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref49" name="sthref49"></a><a id="sthref50" name="sthref50"></a>Use this procedure to create a new JPA project.</p>
-<ol type="1" start="1">
-<li>
-<p>Select <span class="bold">File &gt; New &gt; Other</span>. The New Project dialog appears.</p>
-</li>
-<li>
-<p><a id="sthref51" name="sthref51"></a><a id="sthref52" name="sthref52"></a>On the New Project dialog, select <span class="bold">JPA &gt; JPA Project</span> and click <span class="bold">Next</span>. The New JPA Project wizard appears.</p>
-<div class="figure"><a id="sthref53" name="sthref53"></a>
-<p class="titleinfigure"><a id="sthref54" name="sthref54"></a>New JPA Project</p>
-<img src="img/new_jpa_project_dialog.png" alt="The New JPA Project dialog." title="The New JPA Project dialog." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the fields on the <a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a> to specify the project name and location, target runtime, and pre-defined configuration.</p>
-</li>
-<li>
-<p>Click <span class="bold">Next</span>. The Project Facets page appears.</p>
-</li>
-<li>
-<p>Select the project facets to use to create the project and click <span class="bold">Next</span>. The JPA Facet page appears.</p>
-<div class="figure"><a id="sthref55" name="sthref55"></a>
-<p class="titleinfigure"><a id="sthref56" name="sthref56"></a>New JPA Project</p>
-<img src="img/jpa_facet_dialog.png" alt="The JPA Facet dialog" title="The JPA Facet dialog" /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the fields on the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> to specify your vender-specific platform, database connection, and JPA implementation library.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-If the server runtime does not provide a JPA implementation, you must explicitly select a JPA implementation library.
-<p>To insure the portability of your application, you must explicitly list the managed persistence classes that are included in the persistence unit. If the server supports EJB 3.0, the persistent classes will be discovered automatically.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>Click <span class="bold">Finish</span>. You should now open the <a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a><br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br /></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm
deleted file mode 100644
index 4ac1b09dc7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:57 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Generate Entities from Tables dialog</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Generate Entities from Tables dialog" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CACDAFJD" name="CACDAFJD"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Generate Entities from Tables dialog</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref233" name="sthref233"></a><a id="sthref234" name="sthref234"></a><a id="sthref235" name="sthref235"></a>Use the <span class="gui-object-title">Generate Entities</span> dialog to create Java persistent entities from your database tables and columns.</p>
-<p>This table lists the properties available in the <span class="gui-object-title">Generate Entities dialog</span>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate Entities dialog." summary="This table describes the options on the Generate Entities dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t13">Property</th>
-<th align="left" valign="bottom" id="r1c2-t13">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t13" headers="r1c1-t13">Source Folder</td>
-<td align="left" headers="r2c1-t13 r1c2-t13">Enter a project folder name in which to generate the Java persistent entities, or click <span class="bold">Browse</span> to select an existing folder.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t13" headers="r1c1-t13">Package</td>
-<td align="left" headers="r3c1-t13 r1c2-t13">Enter a package name in which to generate the Java persistent entities, or click <span class="bold">Browse</span> to select an existing package.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t13" headers="r1c1-t13">Tables</td>
-<td align="left" headers="r4c1-t13 r1c2-t13">Select the tables from which to create Java persistent entities. The tables shown are determined by the database connection that you defined in the <a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; JPA Options</a>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<p><a href="tasks017.htm#BABBAGFI">Generating entities from tables</a></p>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm
deleted file mode 100644
index 9073764a6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm
+++ /dev/null
@@ -1,143 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:54 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Specifying entity inheritance</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Specifying entity inheritance" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CIHCCCJD" name="CIHCCCJD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Specifying entity inheritance</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref100" name="sthref100"></a><a id="sthref101" name="sthref101"></a>An entity may inherit properties from other entities. You can specify a specific strategy to use for inheritance.</p>
-<p>Use this procedure to specify inheritance (<code>@Inheritance)</code> for an existing entity (<code>@Entity</code>):</p>
-<ol type="1" start="1">
-<li>
-<p>Select the entity in the <span class="gui-object-title">Package Explorer</span>.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, select the <span class="gui-object-action">Inheritance</span> information.</p>
-<div class="figure"><a id="sthref102" name="sthref102"></a>
-<p class="titleinfigure">Specifying Inheritance</p>
-<img src="img/inheritance_tab.png" alt="Selecting the Inheritance area on the JPA Details view." title="Selecting the Inheritance area on the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>In the <span class="bold">Strategy</span> list, select one of the following the inheritance strategies:</p>
-<ul>
-<li type="disc">
-<p>A single table (default)</p>
-</li>
-<li type="disc">
-<p>Joined table</p>
-</li>
-<li type="disc">
-<p>One table per class</p>
-</li>
-</ul>
-</li>
-<li>
-<p>Use the following table to complete the remaining fields on the tab. See <a href="reference005.htm#CACFHGHE">"Inheritance information"</a> for additional details.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, Inheritance tab." summary="This table describes the options on the Persistence Properties view, Inheritance tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t3">Property</th>
-<th align="left" valign="bottom" id="r1c2-t3">Description</th>
-<th align="left" valign="bottom" id="r1c3-t3">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t3" headers="r1c1-t3"><a id="sthref103" name="sthref103"></a><a id="sthref104" name="sthref104"></a>Discriminator Column</td>
-<td align="left" headers="r2c1-t3 r1c2-t3">Name of the discriminator column when using a <span class="bold">Single</span> or <span class="bold">Joined</span> inheritance strategy.
-<p>This field corresponds to the <code>@DiscriminatorColumn</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t3 r1c3-t3"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t3" headers="r1c1-t3">Discriminator Type</td>
-<td align="left" headers="r3c1-t3 r1c2-t3">Set the discriminator type to <code>Char</code> or <code>Integer</code> (instead of its default: <code>String</code>). The <span class="bold">Discriminator Value</span> must conform to this type.</td>
-<td align="left" headers="r3c1-t3 r1c3-t3">String</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t3" headers="r1c1-t3"><a id="sthref105" name="sthref105"></a><a id="sthref106" name="sthref106"></a>Discriminator Value</td>
-<td align="left" headers="r4c1-t3 r1c2-t3">Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified <span class="bold">Discriminator Type</span>.
-<p>This field corresponds to the <code>@DiscriminatorValue</code> annotation.</p>
-</td>
-<td align="left" headers="r4c1-t3 r1c3-t3"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t3" headers="r1c1-t3">Override Default</td>
-<td align="left" headers="r5c1-t3 r1c2-t3">Use this field to specify custom primary key join columns.
-<p>This field corresponds to the <code>@PrimaryKeyJoinClumn</code> annotation.</p>
-</td>
-<td align="left" headers="r5c1-t3 r1c3-t3"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations the entity field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Inheritance(strategy=InheritanceType.<span class="italic">&lt;INHERITANCE_STRATEGY&gt;</span>)
-@DiscriminatorColumn(name="<span class="italic">&lt;DISCRIMINATOR_COLUMN&gt;</span>",
- discriminatorType=<span class="italic">&lt;DISCRIMINATOR_TYPE&gt;</span>)
-@DiscriminatorValue(value-"<span class="italic">&lt;DISCRIMINATOR_VALUE&gt;</span>")
-@PrimaryKeyJoinColumn(name="<span class="italic">&lt;JOIN_COLUMN_NAME&gt;</span>",
- referencedColumnName = "<span class="italic">&lt;REFERENCED_COLUMN_NAME&gt;</span>")
-
-
-</pre>
-<p><a id="sthref107" name="sthref107"></a><a id="sthref108" name="sthref108"></a><a id="sthref109" name="sthref109"></a>The following figures illustrates the different inheritance strategies.</p>
-<div class="figure"><a id="sthref110" name="sthref110"></a>
-<p class="titleinfigure">Single Table Inheritance</p>
-<img src="img/inheritance_single.png" alt="This figure illustrates entity inheritance in a single table." title="This figure illustrates entity inheritance in a single table." /><br /></div>
-<!-- class="figure" -->
-<div class="figure"><a id="sthref111" name="sthref111"></a>
-<p class="titleinfigure"><a id="sthref112" name="sthref112"></a><a id="sthref113" name="sthref113"></a>Joined Table Inheritance</p>
-<img src="img/inheritance_join.png" alt="This figure shows a sample joined inheritance table strategy." title="This figure shows a sample joined inheritance table strategy." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br /></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm
deleted file mode 100644
index 5246efcd81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:54 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Managing the orm.xml file</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Managing the orm.xml file" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CIHDGDCD" name="CIHDGDCD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1><a id="sthref68" name="sthref68"></a>Managing the orm.xml file</h1>
-</td>
-</tr>
-</table>
-<p>When creating a JPA project, (see <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a>) you can also create the <code>orm.xml</code> file that defines the mapping metadata and defaults.</p>
-<p><a id="sthref69" name="sthref69"></a>Eclipse creates the <code>META-INF\orm.xml</code> file in your project's directory:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;persistence version="<span class="italic">&lt;PERSISTENCE_VERSION&gt;</span>"
- xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt;
- &lt;persistence-unit name="<span class="italic">&lt;PERSISTENCE_UNIT_NAME&gt;</span>"&gt;
- &lt;provider="<span class="italic">&lt;PERSISTENCE_PROVIDER&gt;</span>" /&gt;
- &lt;/persistence-unit&gt;
-&lt;/persistence&gt;
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks003.htm#CIHBCDCE">Working with orm.xml file</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts003.htm#CHDBIJAC">The orm.xml file</a><br />
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm
deleted file mode 100644
index 8150519565..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Managing the persistence.xml file</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Managing the persistence.xml file" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CIHDAJID" name="CIHDAJID"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1><a id="sthref57" name="sthref57"></a>Managing the persistence.xml file</h1>
-</td>
-</tr>
-</table>
-<p>When creating a JPA project, (see <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a>) you can also create the <code>persistence.xml</code> file.</p>
-<p><a id="sthref58" name="sthref58"></a>Eclipse creates the <code>META-INF\persistence.xml</code> file in your project's directory:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;persistence version="<span class="italic">&lt;PERSISTENCE_VERSION&gt;</span>"
- xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt;
- &lt;persistence-unit name="<span class="italic">&lt;PERSISTENCE_UNIT_NAME&gt;</span>"&gt;
- &lt;provider="<span class="italic">&lt;PERSISTENCE_PROVIDER&gt;</span>" /&gt;
- &lt;/persistence-unit&gt;
-&lt;/persistence&gt;
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks001.htm#CIHEJAIE">Working with persistence.xml file</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br />
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm
deleted file mode 100644
index e9bb1c3e38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm
+++ /dev/null
@@ -1,78 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:55 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Mapping an entity</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Mapping an entity" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABDGBIJ" name="BABDGBIJ"></a></p>
-<div class="sect1">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Mapping an entity</h1>
-</td>
-</tr>
-</table>
-<p>Dali supports the following mapping types for Java persistent entities:</p>
-<ul>
-<li type="disc">
-<p><a href="tasks007.htm#BABBABCE">Basic mapping</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks008.htm#BABCBHDF">Embedded mapping</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks009.htm#CIHDIAEE">Embedded ID mapping</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks010.htm#BABGCBHG">ID mapping</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks011.htm#BABEIEGD">Many-to-many mapping</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks012.htm#BABHFAFJ">Many-to-one mapping</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks013.htm#BABHGEBD">One-to-many mapping</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks014.htm#BABFHBCJ">One-to-one mapping</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks015.htm#BABHFHEI">Transient mapping</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks016.htm#BABHIBII">Version mapping</a></p>
-</li>
-</ul>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a> <!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm
deleted file mode 100644
index 0e1b27c20c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Tasks</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content=" Tasks" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="sthref48" name="sthref48"></a></p>
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Tasks</h1>
-</td>
-</tr>
-</table>
-<p>This section includes detailed step-by-step procedures for accessing the Dali OR mapping tool functionality.</p>
-<ul>
-<li type="disc">
-<p><a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a></p>
-</li>
-<li type="disc">
-<p><a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a></p>
-</li>
-<li type="disc">
-<p><a href="task_manage_orm.htm#CIHDGDCD">Managing the orm.xml file</a></p>
-</li>
-<li type="disc">
-<p><a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a></p>
-</li>
-<li type="disc">
-<p><a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a></p>
-</li>
-<li type="disc">
-<p><a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a></p>
-</li>
-<li type="disc">
-<p><a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks017.htm#BABBAGFI">Generating entities from tables</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks018.htm#BABFAIBA">Validating mappings and reporting problems</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks021.htm#BABDBCBI">Modifying persistent project properties</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm
deleted file mode 100644
index 48e3c132b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:53 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Working with persistence.xml file</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Working with persistence.xml file" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CIHEJAIE" name="CIHEJAIE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Working with persistence.xml file</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref59" name="sthref59"></a><a id="sthref60" name="sthref60"></a>You can work with the <code>persistence.xml</code> by using the XML Editor.</p>
-<p>Use this procedure to work with the <code>persistence.xml</code> file:</p>
-<ol type="1" start="1">
-<li>
-<p>Right-click the <code>persistence.xml</code> file in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">Open With &gt; XML Editor</span>.</p>
-<div class="figure"><a id="sthref61" name="sthref61"></a>
-<p class="titleinfigure">Opening the Persistence XML Editor</p>
-<img src="img/open_persistence_editor.png" alt="This figure shows the Open &gt; Persistence XML Editor option for the persistence.xml file." title="This figure shows the Open &gt; Persistence XML Editor option for the persistence.xml file." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p><a id="sthref62" name="sthref62"></a><a id="sthref63" name="sthref63"></a>Use the <span class="gui-object-title">Persistence XML Editor</span> to edit the <code>persistence.xml</code> file.</p>
-<div class="figure"><a id="sthref64" name="sthref64"></a>
-<p class="titleinfigure">Persistence XML Editor</p>
-<img src="img/persistence_xml_editor.png" alt="This figure shows the Persistence XML Editor." title="This figure shows the Persistence XML Editor." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="#CIHEJAIE">Working with persistence.xml file</a><br />
-<a href="../org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html">Working with XML Files</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br /></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm
deleted file mode 100644
index 13aa22b2c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:54 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Synchronizing classes</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Synchronizing classes" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CIHFEBAI" name="CIHFEBAI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Synchronizing classes</h1>
-</td>
-</tr>
-</table>
-<p>As you work with the classes in your Java project, you will need to update the <code>persistence.xml</code> file to reflect the changes. <a id="sthref65" name="sthref65"></a><a id="sthref66" name="sthref66"></a></p>
-<p>Use this procedure to synchronize the <code>persistence.xml</code> file:</p>
-<ol type="1" start="1">
-<li>
-<p>Right-click the <code>persistence.xml</code> file in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Synchronize Classes</span>.</p>
-<div class="figure"><a id="sthref67" name="sthref67"></a>
-<p class="titleinfigure">Synchronizing the persistence.xml File</p>
-<img src="img/synchornize_classes.png" alt="This figure shows the JPA Tools &gt; Synchronize Classes option." title="This figure shows the JPA Tools &gt; Synchronize Classes option." /><br /></div>
-<!-- class="figure" -->
-<p>Dali adds the necessary <code>&lt;class&gt;</code> elements to the <code>persistence.xml</code> file.</p>
-</li>
-<li>
-<p>Use the <span class="gui-object-title">Persistence XML Editor</span> to continue editing the <code>persistence.xml</code> file.</p>
-</li>
-</ol>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks001.htm#CIHEJAIE">Working with persistence.xml file</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br />
-<br /></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm
deleted file mode 100644
index 400091dab9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm
+++ /dev/null
@@ -1,68 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:54 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Working with orm.xml file</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Working with orm.xml file" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CIHBCDCE" name="CIHBCDCE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Working with orm.xml file</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref70" name="sthref70"></a><a id="sthref71" name="sthref71"></a>You can work with the <code>orm.xml</code> by using the JPA Details view.</p>
-<p>Use this procedure to work with the <code>orm.xml</code> file:</p>
-<ol type="1" start="1">
-<li>
-<p>Right-click the <code>orm.xml</code> file in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">Open</span>.</p>
-</li>
-<li>
-<p>In the JPA Structure view, select <span class="bold">EntityMappings</span>.</p>
-</li>
-<li>
-<p>Use the JPA Details view to configure the entity mapping and persistence unit defaults.</p>
-<div class="figure"><a id="sthref72" name="sthref72"></a>
-<p class="titleinfigure">JPA Details view for EntityMappings (orm.xml)</p>
-<img src="img/details_entitymappings.png" alt="JPA Details view for orm.xml file." title="JPA Details view for orm.xml file." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="#CIHBCDCE">Working with orm.xml file</a><br />
-<a href="../org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html">Working with XML Files</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts003.htm#CHDBIJAC">The orm.xml file</a><br /></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm
deleted file mode 100644
index feddf4d807..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:54 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Entity</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Entity" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABGBIEE" name="BABGBIEE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Entity</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref76" name="sthref76"></a><a id="sthref77" name="sthref77"></a><a id="sthref78" name="sthref78"></a><a id="sthref79" name="sthref79"></a>An <span class="bold">Entity</span> is a persistent domain object.</p>
-<p>An entity <span class="italic">can be</span>:</p>
-<ul>
-<li type="disc">
-<p>Abstract or concrete classes. Entities may also extend non-entity classes as well as entity classes, and non-entity classes may extend entity classes.</p>
-</li>
-</ul>
-<p>An entity <span class="italic">must have</span>:</p>
-<ul>
-<li type="disc">
-<p>A no-arg constructor (public or protected); the entity class may have other constructors as well.</p>
-</li>
-</ul>
-<p><a id="sthref80" name="sthref80"></a><a id="sthref81" name="sthref81"></a><a id="sthref82" name="sthref82"></a>Each persistent entity must be mapped to a database table and contain a primary key. Persistent entities are identified by the <code>@Entity</code> annotation.</p>
-<p>Use this procedure to add persistence to an existing entity:</p>
-<ol type="1" start="1">
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Package Explorer.</span></p>
-</li>
-<li>
-<p>Select the class in the JPA Structure view.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, use the <span class="gui-object-action">Map As</span> field to select <span class="gui-object-action">Entity</span>.</p>
-<div class="figure"><a id="sthref83" name="sthref83"></a>
-<p class="titleinfigure">Selecting Entity Persistence</p>
-<img src="img/persistence_view_entity.png" alt="Selecting entity persistence on the JPA Details view." title="Selecting entity persistence on the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the remaining <a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a><br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br /></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm
deleted file mode 100644
index 1d220dd4b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:54 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Embeddable</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Embeddable" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABFEICE" name="BABFEICE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Embeddable</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref84" name="sthref84"></a><a id="sthref85" name="sthref85"></a>An <span class="bold">Embedded</span> class is a class whose instances are stored as part of an owning entity; it shares the identity of the owning entity. Each field of the embedded class is mapped to the database table associated with the owning entity.</p>
-<p>To override the mapping information for a specific subclass, use the <code>@AttributeOverride</code> annotation for that specific class.</p>
-<p><a id="sthref86" name="sthref86"></a><a id="sthref87" name="sthref87"></a><a id="sthref88" name="sthref88"></a>An embeddable entity is identified by the <code>@Embeddable</code> annotation.</p>
-<p>Use this procedure to add embeddable persistence to an existing entity:</p>
-<ol type="1" start="1">
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Package Explorer</span>.</p>
-</li>
-<li>
-<p>Select the class in the JPA Structure view.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, use the <span class="gui-object-action">Map As</span> drop-list to select <span class="gui-object-action">Embeddable</span>.</p>
-<div class="figure"><a id="sthref89" name="sthref89"></a>
-<p class="titleinfigure">Selecting Embeddable Persistence</p>
-<img src="img/persistence_view_embedded.png" alt="Selecting embedded persistence on the JPA Details view." title="Selecting embedded persistence on the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the remaining <a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<dl>
-<dd><a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a></dd>
-<dd><a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a></dd>
-<dd><a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a></dd>
-</dl>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm
deleted file mode 100644
index 7486209ff6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:54 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Mapped superclass</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Mapped superclass" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABDAGCI" name="BABDAGCI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Mapped superclass</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref90" name="sthref90"></a><a id="sthref91" name="sthref91"></a>An entities that extend a <span class="bold">Mapped Superclass</span> class inherit the persistent state and mapping information from a superclass. You should use a mapped superclass to define mapping information that is common to multiple entity classes.</p>
-<p>A mapped superclass <span class="italic">can be</span>:</p>
-<ul>
-<li type="disc">
-<p>Abstract or concrete classes</p>
-</li>
-</ul>
-<p>A mapped superclass <span class="italic">cannot be</span>:</p>
-<ul>
-<li type="disc">
-<p>Be queried or passed as an argument to Entity-Manager or Query operations</p>
-</li>
-<li type="disc">
-<p>Be the target of a persistent relationship</p>
-</li>
-</ul>
-<p>A mapped superclass does not have a defined database table. Instead, its mapping information is derived from its superclass. To override the mapping information for a specific subclass, use the <code>@AttributeOverride</code> annotation for that specific class.</p>
-<p><a id="sthref92" name="sthref92"></a><a id="sthref93" name="sthref93"></a><a id="sthref94" name="sthref94"></a><a id="sthref95" name="sthref95"></a>A mapped superclass is identified by the <code>@MappedSuperclass</code> annotation.</p>
-<p>Use this procedure to add Mapped Superclass persistence to an existing entity:</p>
-<ol type="1" start="1">
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Package Explorer</span>.</p>
-</li>
-<li>
-<p>Select the class in the JPA Structure view.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, use the <span class="gui-object-action">Map As</span> drop-list to select <span class="gui-object-action">Mapped Superclass</span>.</p>
-<div class="figure"><a id="sthref96" name="sthref96"></a>
-<p class="titleinfigure">Selecting Mapped Superclass Persistence</p>
-<img src="img/persistence_view_mappedsprc.png" alt="Selecting embedded persistence on the JPA Details view." title="Selecting embedded persistence on the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the remaining <a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a><br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br /></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm
deleted file mode 100644
index 10bb4cb5ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm
+++ /dev/null
@@ -1,206 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:55 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Basic mapping</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Basic mapping" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABBABCE" name="BABBABCE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Basic mapping</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref114" name="sthref114"></a><a id="sthref115" name="sthref115"></a><a id="sthref116" name="sthref116"></a><a id="sthref117" name="sthref117"></a>Use a <span class="bold">Basic Mapping</span> to map an attribute directly to a database column. Basic mappings may be used only with the following attribute types:</p>
-<ul>
-<li type="disc">
-<p>Java primitive types and wrappers of the primitive types</p>
-</li>
-<li type="disc">
-<p><code>java.lang.String, java.math.BigInteger</code></p>
-</li>
-<li type="disc">
-<p><code>java.math.BigDecimal</code></p>
-</li>
-<li type="disc">
-<p><code>java.util.Date</code></p>
-</li>
-<li type="disc">
-<p><code>java.util.Calendar, java.sql.Date</code></p>
-</li>
-<li type="disc">
-<p><code>java.sql.Time</code></p>
-</li>
-<li type="disc">
-<p><code>java.sql.Timestamp</code></p>
-</li>
-<li type="disc">
-<p><code>byte[]</code></p>
-</li>
-<li type="disc">
-<p><code>Byte[]</code></p>
-</li>
-<li type="disc">
-<p><code>char[]</code></p>
-</li>
-<li type="disc">
-<p><code>Character[]</code></p>
-</li>
-<li type="disc">
-<p>enums</p>
-</li>
-<li type="disc">
-<p>any other type that implements <code>Serializable</code></p>
-</li>
-</ul>
-<p>To create a basic mapping:</p>
-<ol type="1" start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">Basic</span>.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields on the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t4">Property</th>
-<th align="left" valign="bottom" id="r1c2-t4">Description</th>
-<th align="left" valign="bottom" id="r1c3-t4">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t4" headers="r1c1-t4">Map As</td>
-<td align="left" headers="r2c1-t4 r1c2-t4">Defines this mapping as a <span class="bold">Basic Mapping</span>.
-<p>This field corresponds to the <code>@Basic</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t4 r1c3-t4">Basic</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t4" headers="r1c1-t4">Column</td>
-<td align="left" headers="r3c1-t4 r1c2-t4">The database column mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.
-<ul>
-<li type="disc">
-<p>Name &ndash; Name of the database column.</p>
-</li>
-<li type="disc">
-<p>Table &ndash; Name of the database table.</p>
-</li>
-<li type="disc">
-<p>Insertable &ndash; Specify if the column is always included in <code>SQL INSERT</code> statements.</p>
-</li>
-<li type="disc">
-<p>Updatable &ndash; Specify if the column is always included in <code>SQL UPDATE</code> statements.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t4 r1c3-t4">By default, the Column is assumed to be named identically to the attribute and always included in the <code>INSERT</code> and <code>UPDATE</code> statements.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t4" headers="r1c1-t4">Table</td>
-<td align="left" headers="r4c1-t4 r1c2-t4">Name of the database table.</td>
-<td align="left" headers="r4c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t4" headers="r1c1-t4">Fetch</td>
-<td align="left" headers="r5c1-t4 r1c2-t4">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li type="disc">
-<p>Eager</p>
-</li>
-<li type="disc">
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t4 r1c3-t4">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t4" headers="r1c1-t4">Optional</td>
-<td align="left" headers="r6c1-t4 r1c2-t4">Specifies if this field is can be null.</td>
-<td align="left" headers="r6c1-t4 r1c3-t4">Yes</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t4" headers="r1c1-t4">Lob</td>
-<td align="left" headers="r7c1-t4 r1c2-t4">Specifies if this is a large objects (BLOB or CLOB). See <a href="ref_mapping_general.htm#CACBBIBI">"Lob"</a> for details.</td>
-<td align="left" headers="r7c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t4" headers="r1c1-t4">Temporal</td>
-<td align="left" headers="r8c1-t4 r1c2-t4">Specifies the type of data. See <a href="ref_mapping_general.htm#CACEAJGD">"Temporal"</a> for details.
-<ul>
-<li type="disc">
-<p>Date</p>
-</li>
-<li type="disc">
-<p>Time</p>
-</li>
-<li type="disc">
-<p>Timestamp</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r8c1-t4 r1c3-t4"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Column(name="<span class="italic">&lt;COLUMN_NAME&gt;</span>", table="<span class="italic">&lt;COLUMN_TABLE&gt;</span>",
- insertable=<span class="italic">&lt;INSERTABLE&gt;</span>, updatable=<span class="italic">&lt;UPDATABLE&gt;</span>)
-@Basic(fetch=FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>, optional = <span class="italic">&lt;OPTIONAL&gt;</span>)
-@Temporal(TemporalType.<span class="italic">&lt;TEMPORAL&gt;</span>)
-
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
deleted file mode 100644
index f621a37aeb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
+++ /dev/null
@@ -1,120 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:55 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Embedded mapping</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Embedded mapping" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABCBHDF" name="BABCBHDF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Embedded mapping</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref118" name="sthref118"></a><a id="sthref119" name="sthref119"></a><a id="sthref120" name="sthref120"></a><a id="sthref121" name="sthref121"></a>Use an <span class="bold">Embedded Mapping</span> to specify a persistent field or property of an entity whose value is an instance of an embeddable class.</p>
-<ol type="1" start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">Embedded</span>.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields on the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t5">Property</th>
-<th align="left" valign="bottom" id="r1c2-t5">Description</th>
-<th align="left" valign="bottom" id="r1c3-t5">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t5" headers="r1c1-t5">Map As</td>
-<td align="left" headers="r2c1-t5 r1c2-t5">Defines this mapping as a <span class="bold">Embedded</span>.
-<p>This field corresponds to the <code>@Embedded</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t5 r1c3-t5">Embedded</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t5" headers="r1c1-t5">Attribute Overrides</td>
-<td align="left" headers="r3c1-t5 r1c2-t5">Specify to override the default mapping of an entity's attribute. Select <span class="bold">Override Default</span>.</td>
-<td align="left" headers="r3c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t5" headers="r1c1-t5">Columns</td>
-<td align="left" headers="r4c1-t5 r1c2-t5">The database column (and its table) mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.
-<ul>
-<li type="disc">
-<p>Name &ndash; Name of the database column.</p>
-</li>
-<li type="disc">
-<p>Table &ndash; Name of the database table.</p>
-</li>
-<li type="disc">
-<p>Insertable &ndash; Specify if the column is always included in <code>SQL INSERT</code> statements.</p>
-</li>
-<li type="disc">
-<p>Updatable &ndash; Specify if the column is always included in <code>SQL UPDATE</code> statements.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t5 r1c3-t5"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Embedded
-@AttributeOverride(column=@Column(table="<span class="italic">&lt;COLUMN_TABLE&gt;</span>", name = "<span class="italic">&lt;COLUMN_NAME&gt;</span>"))
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm
deleted file mode 100644
index 1df9648d7f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm
+++ /dev/null
@@ -1,94 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:55 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Embedded ID mapping</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Embedded ID mapping" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CIHDIAEE" name="CIHDIAEE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Embedded ID mapping</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref122" name="sthref122"></a><a id="sthref123" name="sthref123"></a><a id="sthref124" name="sthref124"></a><a id="sthref125" name="sthref125"></a>Use an <span class="bold">Embedded ID Mapping</span> to specify the primary key of an embedded ID. These mappings may be used with a <a href="tasks005.htm#BABFEICE">Embeddable</a> entities.</p>
-<ol type="1" start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">Embedded Id</span>.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields on the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t6">Property</th>
-<th align="left" valign="bottom" id="r1c2-t6">Description</th>
-<th align="left" valign="bottom" id="r1c3-t6">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t6" headers="r1c1-t6">Map As</td>
-<td align="left" headers="r2c1-t6 r1c2-t6">Defines this mapping as a <span class="bold">Embedded Id</span>.
-<p>This field corresponds to the <code>@EmbeddedId</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t6 r1c3-t6">Embedded Id</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@EmbeddedId
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm
deleted file mode 100644
index e8a4380d02..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm
+++ /dev/null
@@ -1,176 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:55 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>ID mapping</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="ID mapping" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABGCBHG" name="BABGCBHG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>ID mapping</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref126" name="sthref126"></a><a id="sthref127" name="sthref127"></a><a id="sthref128" name="sthref128"></a><a id="sthref129" name="sthref129"></a>Use an <span class="bold">ID Mapping</span> to specify the primary key of an entity. ID mappings may be used with a <a href="tasks004.htm#BABGBIEE">Entity</a> or <a href="tasks006.htm#BABDAGCI">Mapped superclass</a>. Each <a href="tasks004.htm#BABGBIEE">Entity</a> must have an ID mapping.</p>
-<ol type="1" start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">ID</span>.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t7">Property</th>
-<th align="left" valign="bottom" id="r1c2-t7">Description</th>
-<th align="left" valign="bottom" id="r1c3-t7">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t7" headers="r1c1-t7">Map As</td>
-<td align="left" headers="r2c1-t7 r1c2-t7">Defines this mapping as an <span class="bold">ID Mapping</span>.
-<p>This field corresponds to the <code>@Id</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t7 r1c3-t7">ID</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t7" headers="r1c1-t7">Column</td>
-<td align="left" headers="r3c1-t7 r1c2-t7">The database column mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.</td>
-<td align="left" headers="r3c1-t7 r1c3-t7">By default, the Column is assumed to be named identically to the attribute.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t7" headers="r1c1-t7">Table</td>
-<td align="left" headers="r4c1-t7 r1c2-t7">The database table mapped to the entity attribute.</td>
-<td align="left" headers="r4c1-t7 r1c3-t7">By default, the Table is assumed to be identical to the table associated with the entity.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t7" headers="r1c1-t7">Temporal</td>
-<td align="left" headers="r5c1-t7 r1c2-t7">Specifies the type of data. See <a href="ref_mapping_general.htm#CACEAJGD">"Temporal"</a> for details.
-<ul>
-<li type="disc">
-<p>Date</p>
-</li>
-<li type="disc">
-<p>Time</p>
-</li>
-<li type="disc">
-<p>Timestamp</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t7 r1c3-t7"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields in <a href="ref_primary_key.htm#CACFCCAB">Primary Key Generation information</a> area in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the PK Generation tab." summary="This table lists the fields in the PK Generation tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t8">Property</th>
-<th align="left" valign="bottom" id="r1c2-t8">Description</th>
-<th align="left" valign="bottom" id="r1c3-t8">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t8" headers="r1c1-t8">Primary Key Generation</td>
-<td align="left" headers="r2c1-t8 r1c2-t8">These fields define how the primary key is generated.</td>
-<td align="left" headers="r2c1-t8 r1c3-t8"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t8" headers="r1c1-t8">&nbsp;&nbsp;Strategy</td>
-<td align="left" headers="r3c1-t8 r1c2-t8">See <a href="ref_primary_key.htm#CACBAJBC">"Primary Key Generation"</a> for details.
-<ul>
-<li type="disc">
-<p>Auto</p>
-</li>
-<li type="disc">
-<p>Sequence</p>
-</li>
-<li type="disc">
-<p>Identity</p>
-</li>
-<li type="disc">
-<p>Table</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t8 r1c3-t8">Auto</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t8" headers="r1c1-t8">&nbsp;&nbsp;Generator&nbsp;Name</td>
-<td align="left" headers="r4c1-t8 r1c2-t8">Name of the primary key generator specified in the <span class="bold">Strategy</span></td>
-<td align="left" headers="r4c1-t8 r1c3-t8"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Additional fields will appear in the <a href="ref_primary_key.htm#CACFCCAB">Primary Key Generation information</a> area, depending on the selected Strategy. See <a href="ref_persistence_map_view.htm#BABIFBAF">"JPA Details view (for attributes)"</a> for additional information.</p>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Id
-@Column(name="<span class="italic">&lt;COLUMN_NAME&gt;</span>", table="<span class="italic">&lt;TABLE_NAME&gt;</span>", insertable=<span class="italic">&lt;INSERTABLE&gt;</span>,
- updatable=<span class="italic">&lt;UPDATABLE&gt;</span>)
-@Temporal(<span class="italic">&lt;TEMPORAL&gt;</span>)
-@GeneratedValue(strategy=GeneratorType.<span class="italic">&lt;STRATEGY&gt;</span>, generator="<span class="italic">&lt;GENERATOR_NAME&gt;</span>")@TableGenerator(name="<span class="italic">&lt;TABLE_GENERATOR_NAME&gt;</span>", table = "<span class="italic">&lt;TABLE_GENERATOR_TABLE&gt;</span>",
- pkColumnName = "<span class="italic">&lt;TABLE_GENERATOR_PK&gt;</span>",
- valueColumnName = "<span class="italic">&lt;TABLE_GENERATOR_VALUE_COLUMN&gt;</span>",
- pkColumnValue = "<span class="italic">&lt;TABLE_GENERATOR_PK_COLUMN_VALUE&gt;</span>")@SequenceGenerator(name="<span class="italic">&lt;SEQUENCE_GENERATOR_NAME&gt;</span>",
- sequenceName="<span class="italic">&lt;SEQUENCE_GENERATOR_SEQUENCE&gt;</span>")
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm
deleted file mode 100644
index d8c2ff90f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm
+++ /dev/null
@@ -1,179 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:55 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Many-to-many mapping</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Many-to-many mapping" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABEIEGD" name="BABEIEGD"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Many-to-many mapping</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref130" name="sthref130"></a><a id="sthref131" name="sthref131"></a><a id="sthref132" name="sthref132"></a><a id="sthref133" name="sthref133"></a>Use a <span class="bold">Many-to-Many Mapping</span> to define a many-valued association with many-to-many multiplicity. A many-to-many mapping has two sides: the <span class="italic">owning side</span> and <span class="italic">non-owning side</span>. You must specify the join table on the owning side. For bidirectional mappings, either side may be the owning side.</p>
-<ol type="1" start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">Many-to-Many</span>.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields of the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t9">Property</th>
-<th align="left" valign="bottom" id="r1c2-t9">Description</th>
-<th align="left" valign="bottom" id="r1c3-t9">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t9" headers="r1c1-t9">Map As</td>
-<td align="left" headers="r2c1-t9 r1c2-t9">Defines this mapping as a <span class="bold">Many to Many Mapping</span>.
-<p>This field corresponds to the <code>@ManyToMany</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t9 r1c3-t9">Many to Many</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t9" headers="r1c1-t9">Target Entity</td>
-<td align="left" headers="r3c1-t9 r1c2-t9">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t9 r1c3-t9">null
-<p>You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t9" headers="r1c1-t9">Fetch</td>
-<td align="left" headers="r4c1-t9 r1c2-t9">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li type="disc">
-<p>Eager</p>
-</li>
-<li type="disc">
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t9 r1c3-t9">Lazy</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t9" headers="r1c1-t9">Mapped By</td>
-<td align="left" headers="r5c1-t9 r1c2-t9">The database field that owns the relationship.</td>
-<td align="left" headers="r5c1-t9 r1c3-t9"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t9" headers="r1c1-t9">Order By</td>
-<td align="left" headers="r6c1-t9 r1c2-t9">Specify the default order for objects returned from a query. See <a href="ref_mapping_general.htm#CACDADIH">"Order By"</a> for details.
-<ul>
-<li type="disc">
-<p>No ordering</p>
-</li>
-<li type="disc">
-<p>Primary key</p>
-</li>
-<li type="disc">
-<p>Custom</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r6c1-t9 r1c3-t9">No ordering</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields in the <a href="reference006.htm#CACBAEBC">Join Table Information</a> area in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." summary="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t10">Property</th>
-<th align="left" valign="bottom" id="r1c2-t10">Description</th>
-<th align="left" valign="bottom" id="r1c3-t10">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t10" headers="r1c1-t10">Name</td>
-<td align="left" headers="r2c1-t10 r1c2-t10">Name of the join table that contains the foreign key column.</td>
-<td align="left" headers="r2c1-t10 r1c3-t10">You must specify the join table on the owning side.
-<p>By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t10" headers="r1c1-t10">Join Columns</td>
-<td align="left" headers="r3c1-t10 r1c2-t10">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r3c1-t10 r1c3-t10">By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t10" headers="r1c1-t10">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t10 r1c2-t10">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r4c1-t10 r1c3-t10">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>To add a new Join or Inverse Join Column, click <span class="gui-object-action">Add</span>.</p>
-<p>To edit an existing Join or Inverse Join Column, select the field to and click <span class="gui-object-action">Edit</span>.</p>
-</li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@JoinTable(joinColumns=@JoinColumn(name="<span class="italic">&lt;JOIN_COLUMN&gt;</span>"),
- name = "<span class="italic">&lt;JOIN_TABLE_NAME&gt;</span>")
-@ManyToMany(cascade=CascadeType.<span class="italic">&lt;CASCADE_TYPE&gt;</span>, fetch=FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>,
- targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>, mappedBy = "<span class="italic">&lt;MAPPED_BY&gt;</span>")
-@OrderBy("<span class="italic">&lt;ORDER_BY&gt;</span>")
-
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm
deleted file mode 100644
index 71bcf3d3df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm
+++ /dev/null
@@ -1,134 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:55 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Many-to-one mapping</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Many-to-one mapping" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABHFAFJ" name="BABHFAFJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Many-to-one mapping</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref134" name="sthref134"></a><a id="sthref135" name="sthref135"></a><a id="sthref136" name="sthref136"></a><a id="sthref137" name="sthref137"></a>Use a <span class="bold">Many-to-One</span> mapping to defines a single-valued association to another entity class that has many-to-one multiplicity.</p>
-<ol type="1" start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">Many-to-One</span>.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields ion the General tab for this mapping." summary="This table lists the fields ion the General tab for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t11">Property</th>
-<th align="left" valign="bottom" id="r1c2-t11">Description</th>
-<th align="left" valign="bottom" id="r1c3-t11">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t11" headers="r1c1-t11">Target Entity</td>
-<td align="left" headers="r2c1-t11 r1c2-t11">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r2c1-t11 r1c3-t11">null
-<p>You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t11" headers="r1c1-t11">Fetch Type</td>
-<td align="left" headers="r3c1-t11 r1c2-t11">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li type="disc">
-<p>Eager</p>
-</li>
-<li type="disc">
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t11 r1c3-t11">Eager</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields on the <a href="reference007.htm#CACFCEJC">Join Columns Information</a> tab in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t12">Property</th>
-<th align="left" valign="bottom" id="r1c2-t12">Description</th>
-<th align="left" valign="bottom" id="r1c3-t12">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t12" headers="r1c1-t12">Join Column</td>
-<td align="left" headers="r2c1-t12 r1c2-t12"><a id="sthref138" name="sthref138"></a><a id="sthref139" name="sthref139"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r2c1-t12 r1c3-t12">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@JoinTable(joinColumns=@JoinColumn(name="<span class="italic">&lt;JOIN_COLUMN&gt;</span>"),
- name = "<span class="italic">&lt;JOIN_TABLE_NAME&gt;</span>")
-@ManyToOne(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>, fetch=<span class="italic">&lt;FETCH_TYPE&gt;</span>,
- cascade=<span class="italic">&lt;CASCADE_TYPE&gt;</span>)
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm
deleted file mode 100644
index 61a72af99b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm
+++ /dev/null
@@ -1,169 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:55 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>One-to-many mapping</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="One-to-many mapping" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABHGEBD" name="BABHGEBD"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>One-to-many mapping</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref140" name="sthref140"></a><a id="sthref141" name="sthref141"></a><a id="sthref142" name="sthref142"></a><a id="sthref143" name="sthref143"></a>Use a <span class="bold">One-to-Many Mapping</span> to define a relationship with one-to-many multiplicity.</p>
-<ol type="1" start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">One-to-many</span>.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the General tab of the Persistence Properties view for this mapping." summary="This table lists the fields in the General tab of the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t13">Property</th>
-<th align="left" valign="bottom" id="r1c2-t13">Description</th>
-<th align="left" valign="bottom" id="r1c3-t13">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t13" headers="r1c1-t13">Target Entity</td>
-<td align="left" headers="r2c1-t13 r1c2-t13">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r2c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t13" headers="r1c1-t13">Fetch Type</td>
-<td align="left" headers="r3c1-t13 r1c2-t13">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li type="disc">
-<p>Eager</p>
-</li>
-<li type="disc">
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t13 r1c3-t13">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t13" headers="r1c1-t13">Mapped By</td>
-<td align="left" headers="r4c1-t13 r1c2-t13">The database field that owns the relationship.</td>
-<td align="left" headers="r4c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t13" headers="r1c1-t13">Order By</td>
-<td align="left" headers="r5c1-t13 r1c2-t13">Specify the default order for objects returned from a query. See <a href="ref_mapping_general.htm#CACDADIH">"Order By"</a> for details.
-<ul>
-<li type="disc">
-<p>No ordering</p>
-</li>
-<li type="disc">
-<p>Primary key</p>
-</li>
-<li type="disc">
-<p>Custom</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t13 r1c3-t13">No ordering</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the <a href="reference006.htm#CACBAEBC">Join Table Information</a> fields in the JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." summary="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t14">Property</th>
-<th align="left" valign="bottom" id="r1c2-t14">Description</th>
-<th align="left" valign="bottom" id="r1c3-t14">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t14" headers="r1c1-t14">Name</td>
-<td align="left" headers="r2c1-t14 r1c2-t14">Name of the join table</td>
-<td align="left" headers="r2c1-t14 r1c3-t14">By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t14" headers="r1c1-t14">Join Columns</td>
-<td align="left" headers="r3c1-t14 r1c2-t14">Specify two or more join columns (that is, a primary key).</td>
-<td align="left" headers="r3c1-t14 r1c3-t14"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t14" headers="r1c1-t14">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t14 r1c2-t14">The join column on the owned (or inverse) side of the association: the owned entity's primary key column.</td>
-<td align="left" headers="r4c1-t14 r1c3-t14"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@OneToMany(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>)
-@Column(name="<span class="italic">&lt;COLUMN&gt;</span>")
-
-
-@OneToMany(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>.class, cascade=CascadeType.<span class="italic">&lt;CASCADE_TYPE&gt;</span>,
- fetch = FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>, mappedBy = "<span class="italic">&lt;MAPPED_BY&gt;</span>")@OrderBy("<span class="italic">&lt;ORDER_BY&gt;</span>")
-@JoinTable(name="<span class="italic">&lt;JOIN_TABLE_NAME&gt;</span>", joinColumns=@JoinColumn(name=
- "<span class="italic">&lt;JOIN_COLUMN_NAME&gt;</span>", referencedColumnName="<span class="italic">&lt;JOIN_COLUMN_REFERENCED_COLUMN&gt;</span>"),
- inverseJoinColumns=@JoinColumn(name="<span class="italic">&lt;INVERSE_JOIN_COLUMN_NAME&gt;</span>",
- referencedColumnName="<span class="italic">&lt;INVERSE_JOIN_COLUMN_REFERENCED_COLUMN&gt;</span>"))
-
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm
deleted file mode 100644
index 99d29fa51c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm
+++ /dev/null
@@ -1,141 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:56 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>One-to-one mapping</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="One-to-one mapping" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABFHBCJ" name="BABFHBCJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>One-to-one mapping</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref144" name="sthref144"></a><a id="sthref145" name="sthref145"></a><a id="sthref146" name="sthref146"></a><a id="sthref147" name="sthref147"></a>Use a <span class="bold">One-to-One Mapping</span> to define a relationship with one-to-many multiplicity.</p>
-<ol type="1" start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">One-to-one</span>.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields in the JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t15">Property</th>
-<th align="left" valign="bottom" id="r1c2-t15">Description</th>
-<th align="left" valign="bottom" id="r1c3-t15">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t15" headers="r1c1-t15">Target Entity</td>
-<td align="left" headers="r2c1-t15 r1c2-t15">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r2c1-t15 r1c3-t15">null
-<p>You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t15" headers="r1c1-t15">Fetch Type</td>
-<td align="left" headers="r3c1-t15 r1c2-t15">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li type="disc">
-<p>Eager</p>
-</li>
-<li type="disc">
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t15 r1c3-t15">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t15" headers="r1c1-t15">Mapped By</td>
-<td align="left" headers="r4c1-t15 r1c2-t15">The database field that owns the relationship.</td>
-<td align="left" headers="r4c1-t15 r1c3-t15"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the <a href="reference007.htm#CACFCEJC">Join Columns Information</a> fields in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t16">Property</th>
-<th align="left" valign="bottom" id="r1c2-t16">Description</th>
-<th align="left" valign="bottom" id="r1c3-t16">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t16" headers="r1c1-t16">Join Column</td>
-<td align="left" headers="r2c1-t16 r1c2-t16"><a id="sthref148" name="sthref148"></a><a id="sthref149" name="sthref149"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r2c1-t16 r1c3-t16">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@OneToOne(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>, cascade=CascadeType.<span class="italic">&lt;CASCADE_TYPE&gt;</span>,
- fetch = FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>, mappedBy = "<span class="italic">&lt;MAPPED_BY&gt;</span>")
-@JoinColumn(name="<span class="italic">&lt;JOIN_COLUMN_NAME&gt;</span>", referencedColumnName=
- "<span class="italic">&lt;JOIN_COLUMN_REFERENCED_COLUMN&gt;</span>", insertable = <span class="italic">&lt;INSERTABLE&gt;</span>,
- updatable = <span class="italic">&lt;UPDATABLE&gt;</span>)
-
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm
deleted file mode 100644
index 92643c4ccd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:56 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Transient mapping</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Transient mapping" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABHFHEI" name="BABHFHEI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Transient mapping</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref150" name="sthref150"></a><a id="sthref151" name="sthref151"></a><a id="sthref152" name="sthref152"></a><a id="sthref153" name="sthref153"></a>Use the Transient Mapping to specify a or field of the entity class that <span class="italic">is not</span> persistent.</p>
-<p>To create a version mapping:</p>
-<ol type="1" start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">Transient</span>.</p>
-</li>
-</ol>
-<p>Eclipse adds the following annotation to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Transient
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm
deleted file mode 100644
index 3043de54ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm
+++ /dev/null
@@ -1,135 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:56 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Version mapping</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Version mapping" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABHIBII" name="BABHIBII"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Version mapping</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref154" name="sthref154"></a><a id="sthref155" name="sthref155"></a><a id="sthref156" name="sthref156"></a><a id="sthref157" name="sthref157"></a>Use a <span class="bold">Version Mapping</span> to specify the field used for optimistic locking. If the entity is associated with multiple tables, you should use a version mapping only with the primary table. You should have only a single version mapping per persistent entity. Version mappings may be used only with the following attribute types:</p>
-<ul>
-<li type="disc">
-<p><code>int</code></p>
-</li>
-<li type="disc">
-<p><code>Integer</code></p>
-</li>
-<li type="disc">
-<p><code>short, Short</code></p>
-</li>
-<li type="disc">
-<p><code>long, Long</code></p>
-</li>
-<li type="disc">
-<p><code>Timestamp</code></p>
-</li>
-</ul>
-<p>To create a version mapping:</p>
-<ol type="1" start="1">
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">Map As</span> field, select <span class="gui-object-action">Version</span>.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields in the JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t17">Property</th>
-<th align="left" valign="bottom" id="r1c2-t17">Description</th>
-<th align="left" valign="bottom" id="r1c3-t17">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t17" headers="r1c1-t17">Column</td>
-<td align="left" headers="r2c1-t17 r1c2-t17">The database column mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.</td>
-<td align="left" headers="r2c1-t17 r1c3-t17">By default, the Column is assumed to be named identically to the attribute and always included in the <code>INSERT</code> and <code>UPDATE</code> statements.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t17" headers="r1c1-t17">Table</td>
-<td align="left" headers="r3c1-t17 r1c2-t17">Name of the database table. This must be the primary table associated with the attribute's entity.</td>
-<td align="left" headers="r3c1-t17 r1c3-t17"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t17" headers="r1c1-t17">Temporal</td>
-<td align="left" headers="r4c1-t17 r1c2-t17">Specifies the type of data. See <a href="ref_mapping_general.htm#CACEAJGD">"Temporal"</a> for details.
-<ul>
-<li type="disc">
-<p>Date</p>
-</li>
-<li type="disc">
-<p>Time</p>
-</li>
-<li type="disc">
-<p>Timestamp</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t17 r1c3-t17"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Version
-@Column(table="<span class="italic">&lt;COLUMN_TABLE&gt;</span>", name="&lt;<span class="italic">COLUMN_NAME</span>&gt;")
-
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm
deleted file mode 100644
index 571448f71f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:56 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Generating entities from tables</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Generating entities from tables" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABBAGFI" name="BABBAGFI"></a></p>
-<div class="sect1">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Generating entities from tables</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref158" name="sthref158"></a><a id="sthref159" name="sthref159"></a>Use this procedure to generate Java persistent entities from database tables. You must create a JPA project and establish a database connection <span class="italic">before</span> generating persistent entities. See <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a> for more information.</p>
-<ol type="1" start="1">
-<li>
-<p>Right-click the JPA project in the <span class="gui-object-title">Package Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Generate Entities</span>.</p>
-<div class="figure"><a id="sthref160" name="sthref160"></a>
-<p class="titleinfigure">Generating Entities</p>
-<img src="img/generate_entities.png" alt="Using the JPA Tools &gt; Generate Entities menu option." title="Using the JPA Tools &gt; Generate Entities menu option." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>If you are not currently connected to the database, the Database Connection page appears. Select your database connection and schema, and click <span class="bold">Reconnect</span>.</p>
-<p>To create a new database connection, click <span class="bold">Add connection</span>.</p>
-<p>After connecting to the database, click <span class="bold">Next</span>.</p>
-</li>
-<li>
-<p><a id="sthref161" name="sthref161"></a><a id="sthref162" name="sthref162"></a>On the <a href="task_generate_entities.htm#CACDAFJD">Generate Entities from Tables dialog</a> dialog, select the tables from which to generate Java persistent entities and click <span class="bold">Finish</span>.</p>
-</li>
-</ol>
-<p>Eclipse creates a Java persistent entity for each database table. Each entity contains fields based on the table's columns. Eclipse will also generate entity relationships (such as one-to-one) based on the table constraints. <a href="#CIHJIJJC">Figure: Generating Entities from Tables</a> illustrates how Eclipse generates entities from tables.</p>
-<div class="figure"><a id="CIHJIJJC" name="CIHJIJJC"></a>
-<p class="titleinfigure">Generating Entities from Tables</p>
-<img src="img/table_entity.png" alt="This figure shows the EMPLOYEE and ADDRESS entities generated from database tabels." title="This figure shows the EMPLOYEE and ADDRESS entities generated from database tabels." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br /></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm
deleted file mode 100644
index e9cee0e579..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:56 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Validating mappings and reporting problems</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Validating mappings and reporting problems" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABFAIBA" name="BABFAIBA"></a></p>
-<div class="sect1">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Validating mappings and reporting problems</h1>
-</td>
-</tr>
-</table>
-<p><a id="sthref163" name="sthref163"></a><a id="sthref164" name="sthref164"></a><a id="sthref165" name="sthref165"></a><a id="sthref166" name="sthref166"></a>Errors and warnings on persistent entities and mappings are indicated with a red error or yellow warning next to the resource with the error, as well as the parent containers up to the project.</p>
-<div class="figure"><a id="sthref167" name="sthref167"></a>
-<p class="titleinfigure">Sample Errors and Warnings</p>
-<img src="img/error_sample.png" alt="This figure shows sample error and warning icons in the Explorer view." title="This figure shows sample error and warning icons in the Explorer view." /><br /></div>
-<!-- class="figure" -->
-<p>This section contains information on the following:</p>
-<ul>
-<li type="disc">
-<p><a href="tasks019.htm#CIHFEDEI">Error messages</a></p>
-</li>
-<li type="disc">
-<p><a href="tasks020.htm#CIHGEAIJ">Warning messages</a></p>
-</li>
-</ul>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/cprbview.htm">Problems view</a></p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm
deleted file mode 100644
index 060ae2d105..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:56 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Error messages</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Error messages" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CIHFEDEI" name="CIHFEDEI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Error messages<a id="sthref168" name="sthref168"></a></h1>
-</td>
-</tr>
-</table>
-<p>This section contains information on error messages (including how to resolve the issue) you may encounter while working with Dali.</p>
-<a id="sthref169" name="sthref169"></a>
-<p class="subhead2">Attribute "<span class="italic">&lt;ATTRIBUTE__NAME&gt;</span>" has invalid mapping type in this context</p>
-<p>The mapped attribute is invalid. Either change the mapping type or change the entity type.</p>
-<p>See <a href="task_mapping.htm#BABDGBIJ">"Mapping an entity"</a> for more information.</p>
-<a id="sthref170" name="sthref170"></a>
-<p class="subhead2">Attribute "<span class="italic">&lt;ATTRIBUTE_NAME&gt;</span>" cannot be resolved.</p>
-<p>Dali cannot map the attribute to a database table and column. Verify that you database connection information is correct.</p>
-<p>See <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a> for more information.</p>
-<a id="sthref171" name="sthref171"></a>
-<p class="subhead2">Class "<span class="italic">&lt;CLASS_NAME&gt;</span>" is not annotated as a persistent class.</p>
-<p>The class has not been identified as a persistent class. Configure the class as an Entity, Mapped Superclass, or Embeddable persistent entity.</p>
-<p>See <a href="task_add_persistence.htm#BABHICAI">"Adding persistence to a class"</a>.</p>
-<a id="sthref172" name="sthref172"></a>
-<p class="subhead2">Column "<span class="italic">&lt;COLUMN_NAME&gt;</span>" cannot be resolved.</p>
-<p>You mapped an entity's field to an incorrect or invalid column in the database table. By default, Dali will attempt to map each field in the entity with an identically named row in the database table. If the field's name differs from the row's name, you must explicitly create the mapping.</p>
-<p>Map the field to a valid row in the database table as shown in <a href="task_mapping.htm#BABDGBIJ">"Mapping an entity"</a>.</p>
-<a id="sthref173" name="sthref173"></a>
-<p class="subhead2">Duplicate class "<span class="italic">&lt;CLASS_NAME&gt;</span>".</p>
-<p>You created to persistence classes with the same name. Each Java class must have a unique name. See <a href="task_add_persistence.htm#BABHICAI">"Adding persistence to a class"</a> for more information.</p>
-<a id="sthref174" name="sthref174"></a>
-<p class="subhead2">Entity does not have an Id or Embedded Id.</p>
-<p>You created a persistent entity without identifying its primary key. A persistent entity must have a primary key field designated with an <code>@Id</code> or <code>@EmbeddedId</code> annotation.</p>
-<p>Add an ID mapping to the entity as shown in <a href="tasks010.htm#BABGCBHG">"ID mapping"</a> or <a href="tasks009.htm#CIHDIAEE">"Embedded ID mapping"</a>.</p>
-<a id="sthref175" name="sthref175"></a>
-<p class="subhead2">Multiple persistence.xml files in project.</p>
-<p>You created a JPA project with more than one <code>persistence.xml</code> file. Each JPA project must contain a <span class="italic">single</span> <code>persistence.xml</code> file.</p>
-<p>See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for more information.</p>
-<a id="sthref176" name="sthref176"></a>
-<p class="subhead2">No generator named "<span class="italic">&lt;GENERATOR_NAME&gt;</span>" is defined in persistence unit.</p>
-<p>You created a persistence entity that uses sequencing, but did not define include the sequence generator in the <code>psersistence.xml</code> file. Synchronize the <code>persistence.xml</code> file with your current project.</p>
-<p>See <a href="tasks002.htm#CIHFEBAI">"Synchronizing classes"</a> for more information.</p>
-<a id="sthref177" name="sthref177"></a>
-<p class="subhead2">No persistence unit defined.</p>
-<p>There is no <code>&lt;persistence-unit-metadata&gt;</code> information in the <code>orm.xml</code> file. Add the default persistence unit information.</p>
-<p>See <a href="task_manage_orm.htm#CIHDGDCD">"Managing the orm.xml file"</a> for more information.</p>
-<a id="sthref178" name="sthref178"></a>
-<p class="subhead2">No persistence.xml file in project.</p>
-<p>You created a JPA project without a <code>persistence.xml</code> file. Each JPA project must contain a <span class="italic">single</span> <code>persistence.xml</code> file.</p>
-<p>See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for more information.</p>
-<a id="sthref179" name="sthref179"></a>
-<p class="subhead2">Referenced column "<span class="italic">&lt;COLUMN_NAME&gt;</span>" in join column "<span class="italic">&lt;COLUMN_NAME&gt;</span>" cannot be resolved.</p>
-<p>The column that you selected to join a relationship mapping does not exist on the database table. Either select a different column on the <a href="reference006.htm#CACBAEBC">Join Table Information</a> or create the necessary column on the database table.</p>
-<p>See <a href="ref_persistence_map_view.htm#BABIFBAF">"JPA Details view (for attributes)"</a> for more information.</p>
-<a id="sthref180" name="sthref180"></a>
-<p class="subhead2">Schema "&lt;<span class="italic">SCHEMA_NAME</span>&gt;" cannot be resolved for table/join table "&lt;<span class="italic">TABLE_NAME</span>&gt;".</p>
-<p>Define the default database schema information in the persistence unit.</p>
-<p>See <a href="task_manage_orm.htm#CIHDGDCD">"Managing the orm.xml file"</a> for more information.</p>
-<a id="sthref181" name="sthref181"></a>
-<p class="subhead2">Table "<span class="italic">&lt;TABLE_NAME&gt;</span>" cannot be resolved.</p>
-<p>You associated a persistent entity to an incorrect or invalid database table. By default, Dali will attempt to associate each persistent entity with an identically named database table. If the entity's name differs from the table's name, you must explicitly create the association.</p>
-<p>Associate the entity with a valid database table as shown in <a href="task_add_persistence.htm#BABHICAI">"Adding persistence to a class"</a>.</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/cprbview.htm">Problems view</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm
deleted file mode 100644
index 3cc8ed877d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:56 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Warning messages</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Warning messages" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CIHGEAIJ" name="CIHGEAIJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Warning messages</h1>
-</td>
-</tr>
-</table>
-<p>This section contains information on warning messages (including how to resolve the issue) you may encounter while working with Dali.</p>
-<a id="sthref182" name="sthref182"></a>
-<p class="subhead2">Connection "<span class="italic">&lt;CONNECTION_NAME&gt;</span>" is not active. No validation will be done against the data source.</p>
-<p>The database connection you specified to use with the JPA project is not active. The JPA project requires an active connection.</p>
-<a id="sthref183" name="sthref183"></a>
-<p class="subhead2">No connection specified for the project. No data-specific validation will be performed.</p>
-<p>You created a JPA project without specifying a database connection. The JPA project requires an active connection.</p>
-<p>See <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a> or <a href="tasks021.htm#BABDBCBI">"Modifying persistent project properties"</a> for information on specifying a database connection.</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/cprbview.htm">Problems view</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm
deleted file mode 100644
index 16bd18b438..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm
+++ /dev/null
@@ -1,89 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:56 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Modifying persistent project properties</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Modifying persistent project properties" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BABDBCBI" name="BABDBCBI"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Modifying persistent project properties</h1>
-</td>
-</tr>
-</table>
-<p>Each persistent project must be associated with a database connection. To create a new database connection, click <span class="gui-object-action">Database Connection</span> use the New Connection wizard.</p>
-<p>Use this procedure to modify the vender-specific platform and database connection associated with your JPA project.</p>
-<ol type="1" start="1">
-<li>
-<p>Right-click the project in the <span class="gui-object-title">Explorer</span> view and select <span class="gui-object-action">Properties</span>. The Properties page appears.</p>
-<div class="figure"><a id="sthref184" name="sthref184"></a>
-<p class="titleinfigure">Properties &ndash; Persistence Page</p>
-<img src="img/properties_persistence.png" alt="This figure shows the JPA options on the Properties dialog." title="This figure shows the JPA options on the Properties dialog." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Use this table to complete the remaining fields on the Properties &ndash; JPA page and click <span class="bold">OK</span>.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Properties - Java Persistence dialog." summary="This table lists the fields in the Properties - Java Persistence dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t18">Property</th>
-<th align="left" valign="bottom" id="r1c2-t18">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t18" headers="r1c1-t18">Platform</td>
-<td align="left" headers="r2c1-t18 r1c2-t18">Select the vendor-specific platform for the JPA implementation.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t18" headers="r1c1-t18">Database Connection</td>
-<td align="left" headers="r3c1-t18 r1c2-t18">Database connection to use to store the persistent entities. To create a new connection, click <span class="bold">Add Connection</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>To create a new connection, click <span class="bold">Add connections</span>.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; JPA Options</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm
deleted file mode 100644
index f4175473f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm
+++ /dev/null
@@ -1,71 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:58 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Tips and tricks</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content=" Tips and tricks" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CHDHGHBF" name="CHDHGHBF"></a></p>
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Tips and tricks</h1>
-</td>
-</tr>
-</table>
-<p>The following tips and tricks give some helpful ideas for increasing your productivity.</p>
-<ul>
-<li type="disc">
-<p><a href="#BABFIIHA"><span class="bold">Database Connections</span></a></p>
-</li>
-<li type="disc">
-<p><a href="#BABCHAHF"><span class="bold">Schema-based persistence.xml</span></a></p>
-</li>
-</ul>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the tips and tricks in this category." summary="This table lists the tips and tricks in this category." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t2">Tip</th>
-<th align="left" valign="bottom" id="r1c2-t2">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t2" headers="r1c1-t2"><a id="BABFIIHA" name="BABFIIHA"></a><span class="bold">Database Connections</span></td>
-<td align="left" headers="r2c1-t2 r1c2-t2">When starting a new workbench session, be sure to <a href="../org.eclipse.wst.datatools.connection.ui.doc.user/topics/tdbconn_recon.html">reconnect to your database</a> (if you are working online). This allows Dali to provide database-related mapping assistance and validation.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t2" headers="r1c1-t2"><a id="BABCHAHF" name="BABCHAHF"></a><span class="bold">Schema-based persistence.xml</span></td>
-<td align="left" headers="r3c1-t2 r1c2-t2">If you are behind a firewall, you may need to configure your Eclipse workspace proxy in the <a href="../org.eclipse.platform.doc.user/reference/ref-72.htm">Preferences dialog</a> (<span class="gui-object-action">Preferences &gt; Internet &gt; Proxy Settings</span>) to properly validate a schema-based <code>persistence.xml</code> file.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml b/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml
deleted file mode 100644
index 0dc1abbc1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version='1.0' encoding='iso-8859-1'?>
-<!-- User Guide -->
- <toc label="Dali Java Persistence Tools User Guide"><topic label="Dali Java Persistence Tools User Guide">
- <topic href="getting_started.htm" label="Getting started">
- <topic href="getting_started001.htm#BABEFHCD" label="Requirements and installation" />
- <topic href="getting_started002.htm#BABIGCJA" label="Dali quick start">
- <topic href="getting_started003.htm#BABDFHDA" label="Creating a new project" />
- <topic href="getting_started004.htm#BABFGDDG" label="Creating a Java persistent entity" />
- <topic href="getting_started005.htm#BABHACAF" label="Mapping an entity" />
- </topic>
- <topic href="getting_started006.htm#BABCDECJ" label="Dali basic tutorial">
- <topic href="getting_started007.htm#BABBBBID" label="Generate the tutorial database schema">
- <topic href="getting_started008.htm#BABDHFCD" label="Create a database connection" />
- </topic>
- <topic href="getting_started009.htm#BABBBAIG" label="Create a JPA project" />
- <topic href="getting_started010.htm#BABIJIGF" label="Create persistent Java entities">
- <topic href="getting_started011.htm#BABDCBDD" label="Add fields to the entities" />
- <topic href="getting_started012.htm#BABIHGGD" label="Associate the entity with a database table" />
- </topic>
- <topic href="getting_started013.htm#BABEBGBC" label="Create OR mappings">
- <topic href="getting_started014.htm#BABGEFDI" label="Create ID mappings" />
- <topic href="getting_started015.htm#BABEEFJA" label="Create basic mappings" />
- <topic href="getting_started016.htm#BABGBGHF" label="Create one-to-one mappings" />
- <topic href="getting_started017.htm#BABBEHEG" label="Create one-to-many mappings" />
- <topic href="getting_started018.htm#BABCHIHI" label="Create many-to-one mappings" />
- <topic href="getting_started019.htm#BABIDFFG" label="Create version mappings" />
- </topic>
- </topic>
- </topic>
- <topic href="concepts.htm" label=" Concepts">
- <topic href="concept_persistence.htm#BABCAHIC" label="Understanding Java persistence" />
- <topic href="concept_mapping.htm#BABBDJFI" label="Understanding OR mappings" />
- <topic href="concepts001.htm#BABBGFJG" label="Understanding EJB 3.0 Java Persistence API">
- <topic href="concepts002.htm#CHDHAGIH" label="The persistence.xml file" />
- <topic href="concepts003.htm#CHDBIJAC" label="The orm.xml file" />
- </topic>
- </topic>
- <topic href="tasks.htm" label=" Tasks">
- <topic href="task_create_new_project.htm#CIHHEJCJ" label="Creating a new JPA project" />
- <topic href="task_manage_persistence.htm#CIHDAJID" label="Managing the persistence.xml file">
- <topic href="tasks001.htm#CIHEJAIE" label="Working with persistence.xml file" />
- <topic href="tasks002.htm#CIHFEBAI" label="Synchronizing classes" />
- </topic>
- <topic href="task_manage_orm.htm#CIHDGDCD" label="Managing the orm.xml file">
- <topic href="tasks003.htm#CIHBCDCE" label="Working with orm.xml file" />
- </topic>
- <topic href="task_add_persistence.htm#BABHICAI" label="Adding persistence to a class">
- <topic href="tasks004.htm#BABGBIEE" label="Entity" />
- <topic href="tasks005.htm#BABFEICE" label="Embeddable" />
- <topic href="tasks006.htm#BABDAGCI" label="Mapped superclass" />
- </topic>
- <topic href="task_additonal_tables.htm#CIHGBIEI" label="Specifying additional tables" />
- <topic href="task_inheritance.htm#CIHCCCJD" label="Specifying entity inheritance" />
- <topic href="task_mapping.htm#BABDGBIJ" label="Mapping an entity">
- <topic href="tasks007.htm#BABBABCE" label="Basic mapping" />
- <topic href="tasks008.htm#BABCBHDF" label="Embedded mapping" />
- <topic href="tasks009.htm#CIHDIAEE" label="Embedded ID mapping" />
- <topic href="tasks010.htm#BABGCBHG" label="ID mapping" />
- <topic href="tasks011.htm#BABEIEGD" label="Many-to-many mapping" />
- <topic href="tasks012.htm#BABHFAFJ" label="Many-to-one mapping" />
- <topic href="tasks013.htm#BABHGEBD" label="One-to-many mapping" />
- <topic href="tasks014.htm#BABFHBCJ" label="One-to-one mapping" />
- <topic href="tasks015.htm#BABHFHEI" label="Transient mapping" />
- <topic href="tasks016.htm#BABHIBII" label="Version mapping" />
- </topic>
- <topic href="tasks017.htm#BABBAGFI" label="Generating entities from tables" />
- <topic href="tasks018.htm#BABFAIBA" label="Validating mappings and reporting problems">
- <topic href="tasks019.htm#CIHFEDEI" label="Error messages" />
- <topic href="tasks020.htm#CIHGEAIJ" label="Warning messages" />
- </topic>
- <topic href="tasks021.htm#BABDBCBI" label="Modifying persistent project properties" />
- </topic>
- <topic label=" Reference">
- <topic label="Wizards">
- <topic href="ref_new_jpa_project_wizard.htm#CACBJGBG" label="Create New JPA Project wizard">
- <topic href="ref_new_jpa_project.htm#CACBJAGC" label="New JPA Project page" />
- <topic href="ref_jpa_facet.htm#CACIFDIF" label="JPA Facet page" />
- </topic>
- </topic>
- <topic label="Property pages">
- <topic href="ref_persistence_prop_view.htm#BABFAEBB" label="JPA Details view (for entities)">
- <topic href="reference003.htm#CACCAGGC" label="General information" />
- <topic href="reference004.htm#CACBHIDA" label="Secondary table information" />
- <topic href="reference005.htm#CACFHGHE" label="Inheritance information" />
- </topic>
- <topic href="ref_persistence_map_view.htm#BABIFBAF" label="JPA Details view (for attributes)">
- <topic href="ref_mapping_general.htm#CACBHFIJ" label="General information" />
- <topic href="reference006.htm#CACBAEBC" label="Join Table Information" />
- <topic href="reference007.htm#CACFCEJC" label="Join Columns Information" />
- <topic href="ref_primary_key.htm#CACFCCAB" label="Primary Key Generation information" />
- </topic>
- <topic href="ref_details_orm.htm#CACGDGHC" label="JPA Details view (for orm.xml)">
- <topic href="reference008.htm#CACCACGH" label="General information" />
- <topic href="reference009.htm#CACEAGBG" label="Persistence Unit information" />
- </topic>
- <topic href="ref_persistence_outline.htm#BABEGGFE" label="JPA Structure view" />
- </topic>
- <topic label="Preferences">
- <topic href="ref_project_properties.htm#BABJHBCI" label="Project Properties page - JPA Options" />
- </topic>
- <topic label="Dialogs">
- <topic href="task_generate_entities.htm#CACDAFJD" label="Generate Entities from Tables dialog" />
- <topic href="reference012.htm#CACCGEHC" label="Edit Join Columns Dialog" />
- </topic>
- <topic href="ref_persistence_perspective.htm#BABIFBDB" label="JPA Development perspective" />
- <topic label="Icons and buttons">
- <topic href="reference014.htm#CACGEACG" label="Icons" />
- <topic href="reference015.htm#CACDJCEI" label="Buttons" />
- </topic>
- <topic href="reference016.htm#sthref239" label="Javadoc" />
- <topic href="reference017.htm#CACBBDIB" label="Dali Developer Documentation" />
- </topic>
- <topic href="tips_and_tricks.htm" label="Tips and tricks" />
- <topic href="whats_new.htm" label=" What's new" />
- <topic href="legal.htm" label=" Legal" />
- </topic>
-</toc>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm
deleted file mode 100644
index 4d4da1ebca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:58 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>What's new</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content=" What's new" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BGGEDBGF" name="BGGEDBGF"></a></p>
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>What's new</h1>
-</td>
-</tr>
-</table>
-<p>This section contains descriptions of the following new feature and significant changes made to the Dali OR Mapping Tool for Release 1.0.0:</p>
-<ul>
-<li type="disc">
-<p><a href="whats_new001.htm#BGGCJJBD">Generate Persistent Entities from Tables wizard</a></p>
-</li>
-<li type="disc">
-<p><a href="whats_new002.htm#CEGBCIBB">Create and Manage the persistence.xml file</a></p>
-</li>
-<li type="disc">
-<p><a href="whats_new003.htm#CEGJJBEE">Create and Manage the orm.xml file</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm
deleted file mode 100644
index 65fd8a9b8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:58 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Generate Persistent Entities from Tables wizard</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Generate Persistent Entities from Tables wizard" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="BGGCJJBD" name="BGGCJJBD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Generate Persistent Entities from Tables wizard</h1>
-</td>
-</tr>
-</table>
-<p>Use the <span class="gui-object-title">Generate Entities from Tables</span> wizard to quickly create JPA entities from your database tables.</p>
-<div class="figure"><a id="sthref243" name="sthref243"></a>
-<p class="titleinfigure">Generating Entities</p>
-<img src="img/generate_entities.png" alt="Selecting the JPA Tools &gt; Generate Entities option." title="Selecting the JPA Tools &gt; Generate Entities option." /><br /></div>
-<!-- class="figure" -->
-<p>Dali automatically creates the necessary OR mappings, based on your database table constraints.</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="whats_new.htm#BGGEDBGF">What's new</a> <img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks017.htm#BABBAGFI">Generating entities from tables</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm
deleted file mode 100644
index 4fd22af74e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:58 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Create and Manage the persistence.xml file</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Create and Manage the persistence.xml file" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CEGBCIBB" name="CEGBCIBB"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Create and Manage the persistence.xml file</h1>
-</td>
-</tr>
-</table>
-<p>When creating a JPA project, Dali automatically creates the <code>perssistence.xml</code> file.</p>
-<div class="figure"><a id="sthref244" name="sthref244"></a>
-<p class="titleinfigure">JPA Project with persistence.xml File</p>
-<img src="img/new_project_2.png" alt="JPA project with persistence.xml file." title="JPA project with persistence.xml file." /><br /></div>
-<!-- class="figure" -->
-<p>Use the XML editor to edit the <code>persistence.xml</code> file.</p>
-<p>After adding your JPA entities, use the <span class="gui-object-action">Java Persistence &gt; Synchronize Classes</span> option to add the classes to the <code>persistence.xml</code> file.</p>
-<div class="figure"><a id="sthref245" name="sthref245"></a>
-<p class="titleinfigure">Synchronizing the persistence.xml File.</p>
-<img src="img/synchornize_classes.png" alt="The JPA Tools &gt; Synchronize Classes option." title="The JPA Tools &gt; Synchronize Classes option." /><br /></div>
-<!-- class="figure" -->
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="whats_new.htm#BGGEDBGF">What's new</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm
deleted file mode 100644
index f02aba41d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<!-- Run date = May 21, 2007 6:35:58 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Create and Manage the orm.xml file</title>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<meta name="generator" content="Oracle DARB XHTML Converter - Version 4.5.3 Build 02" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="all" scheme="http://www.robotstxt.org/" />
-<meta name="doctitle" content="Create and Manage the orm.xml file" />
-<meta name="relnum" content="Release 1.0.0" />
-<meta name="partnum" content="" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<link rel="start" href="../../index.htm" title="Home" type="text/html" />
-<link rel="contents" href="toc.htm" title="Contents" type="text/html" />
-</head>
-<body>
-<p><a id="CEGJJBEE" name="CEGJJBEE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr valign="bottom">
-<td align="left" width="86%">
-<h1>Create and Manage the orm.xml file</h1>
-</td>
-</tr>
-</table>
-<p>When creating a JPA project, you can also create the <code>orm.xml</code> file. Select the <span class="bold">Create orm.xml</span> option on the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> page of the <a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>.</p>
-<div class="figure"><a id="sthref246" name="sthref246"></a>
-<p class="titleinfigure">JPA Facet Dialog</p>
-<img src="img/jpa_facet_dialog.png" alt="JPA Facet dialog." title="JPA Facet dialog." /><br /></div>
-<!-- class="figure" -->
-<p>Use the <code>orm.xml</code> file to define the project and persistence unit defaults.</p>
-<div class="figure"><a id="sthref247" name="sthref247"></a>
-<p class="titleinfigure">JPA Details view for orm.xml file.</p>
-<img src="img/details_entitymappings.png" alt="JPA Details view for orm.xml file." title="JPA Details view for orm.xml file." /><br /></div>
-<!-- class="figure" -->
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="whats_new.htm#BGGEDBGF">What's new</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<tr>
-<td align="left" width="86%"><a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2007,&nbsp;Oracle.&nbsp;All&nbsp;rights&nbsp;reserved.</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.classpath b/jpa/plugins/org.eclipse.jpt.gen/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.cvsignore b/jpa/plugins/org.eclipse.jpt.gen/.cvsignore
deleted file mode 100644
index 2d14989f69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-@dot
-build.xml
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.project b/jpa/plugins/org.eclipse.jpt.gen/.project
deleted file mode 100644
index ef2d5088ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.gen</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 7e690b4d88..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:55 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 3e1d50ad46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:28:54 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF
deleted file mode 100644
index 0162a7c023..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,15 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.gen
-Bundle-Version: 1.0.0.qualifier
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jpt.gen.internal; x-friends:="org.eclipse.jpt.ui"
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.jdt.core,
- org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.utility
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/jpa/plugins/org.eclipse.jpt.gen/about.html b/jpa/plugins/org.eclipse.jpt.gen/about.html
deleted file mode 100644
index 9e73bdabb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>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
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>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
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.gen/build.properties b/jpa/plugins/org.eclipse.jpt.gen/build.properties
deleted file mode 100644
index 41837ebdd1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 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
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.gen/component.xml b/jpa/plugins/org.eclipse.jpt.gen/component.xml
deleted file mode 100644
index 7a4e04e21f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.gen"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.gen" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.gen/plugin.properties b/jpa/plugins/org.eclipse.jpt.gen/plugin.properties
deleted file mode 100644
index 4875a8b174..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 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 = Java Persistence API Tools - Entity Gen
-providerName = Eclipse.org
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java
deleted file mode 100644
index 70d07a59e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java
+++ /dev/null
@@ -1,1437 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.gen.internal;
-
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.lang.reflect.Modifier;
-import java.text.Collator;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IJavaModelStatusConstants;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.internal.content.java.mappings.JPA;
-import org.eclipse.jpt.db.internal.Column;
-import org.eclipse.jpt.db.internal.ForeignKey;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.internal.IndentingPrintWriter;
-import org.eclipse.jpt.utility.internal.JavaType;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-// TODO handle table names that are illegal class names
-// TODO handle table names that are illegal file names
-// TODO handle column names that are illegal field/method names
-// TODO format code per preferences
-// TODO organize imports per preferences
-// TODO prompt user to overwrite existing classes
-/**
- * This generator will generate an entity for a table.
- */
-public class EntityGenerator {
- final Config config;
- private final IPackageFragment packageFragment;
- private final GenTable genTable;
- private final String entityClassName;
- private final OverwriteConfirmer overwriteConfirmer;
- private final IProgressMonitor monitor;
-
-
- // ********** public API **********
-
- public static void generateEntity(Config config, IPackageFragment packageFragment, GenTable genTable, OverwriteConfirmer overwriteConfirmer, IProgressMonitor monitor) {
- if ((config == null) || (packageFragment == null) || (genTable == null)) {
- throw new NullPointerException();
- }
- new EntityGenerator(config, packageFragment, genTable, overwriteConfirmer, monitor).generateEntity();
- }
-
-
- // ********** constructor/initialization **********
-
- private EntityGenerator(Config config, IPackageFragment packageFragment, GenTable genTable, OverwriteConfirmer overwriteConfirmer, IProgressMonitor monitor) {
- super();
- this.config = config;
- this.packageFragment = packageFragment;
- this.genTable = genTable;
- this.entityClassName = this.fullyQualify(this.entityName());
- this.overwriteConfirmer = overwriteConfirmer;
- this.monitor = monitor;
- }
-
-
- // ********** code gen **********
-
- private void generateEntity() {
- try {
- this.generateEntity_();
- } catch (JavaModelException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private void generateEntity_() throws JavaModelException {
- String fileName = this.entityName() + ".java";
- String source = this.buildSource();
- try {
- this.packageFragment.createCompilationUnit(fileName, source, false, this.monitor);
- } catch (JavaModelException ex) {
- if (ex.getJavaModelStatus().getCode() == IJavaModelStatusConstants.NAME_COLLISION) {
- if (this.overwriteConfirmer.overwrite(this.entityClassName)) {
- this.packageFragment.createCompilationUnit(fileName, source, true, this.monitor);
- }
- } else {
- throw ex;
- }
- }
- }
-
- /**
- * build the "body" source first; then build the "package" and "imports" source
- * and concatenate the "body" source to it
- */
- private String buildSource() {
- // build the body source first so we can gather up the import statements
- BodySource bodySource = this.buildBodySource();
-
- StringWriter sw = new StringWriter(bodySource.length() + 1000);
- PrintWriter pw = new PrintWriter(sw);
- this.printPackageAndImportsOn(pw, bodySource);
- pw.print(bodySource.source());
- return sw.toString();
- }
-
- private BodySource buildBodySource() {
- EntitySourceWriter pw = new EntitySourceWriter(this.packageName(), this.entityClassName);
- this.printBodySourceOn(pw);
- return pw;
- }
-
- private void printBodySourceOn(EntitySourceWriter pw) {
- this.printClassDeclarationOn(pw);
-
- pw.indent();
- this.printEntityPrimaryKeyFieldsOn(pw);
- this.printEntityNonPrimaryKeyBasicFieldsOn(pw);
- this.printEntityManyToOneFieldsOn(pw);
- this.printEntityOneToManyFieldsOn(pw);
- this.printEntityOwnedManyToManyFieldsOn(pw);
- this.printEntityNonOwnedManyToManyFieldsOn(pw);
- this.printSerialVersionUID(pw);
- pw.println();
-
- this.printZeroArgumentConstructorOn(this.entityName(), this.config.methodVisibility(), pw);
- if (this.config.propertyAccessType() || this.config.generateGettersAndSetters()) {
- this.printEntityPrimaryKeyGettersAndSettersOn(pw);
- this.printEntityNonPrimaryKeyBasicGettersAndSettersOn(pw);
- this.printEntityManyToOneGettersAndSettersOn(pw);
- this.printEntityOneToManyGettersAndSettersOn(pw);
- this.printEntityOwnedManyToManyGettersAndSettersOn(pw);
- this.printEntityNonOwnedManyToManyGettersAndSettersOn(pw);
- }
-
- this.printPrimaryKeyClassOn(pw);
- pw.undent();
-
- pw.print('}');
- pw.println();
- }
-
- private void printClassDeclarationOn(EntitySourceWriter pw) {
- this.printEntityAnnotationOn(pw);
- this.printTableAnnotationOn(pw);
- this.printIdClassAnnotationOn(pw);
-
- pw.print("public class ");
- pw.printTypeDeclaration(this.entityClassName);
- if (config.serializable()) {
- pw.print(" implements ");
- pw.printTypeDeclaration(Serializable.class.getName());
- }
- pw.print(" {");
- pw.println();
- }
-
- private void printEntityAnnotationOn(EntitySourceWriter pw) {
- pw.printAnnotation(JPA.ENTITY);
- pw.println();
- }
-
- private void printTableAnnotationOn(EntitySourceWriter pw) {
- if ( ! this.table().matchesShortJavaClassName(this.entityName())) {
- pw.printAnnotation(JPA.TABLE);
- pw.print("(name=\"");
- pw.print(this.table().getName());
- pw.print("\")");
- pw.println();
- }
- }
-
- private void printIdClassAnnotationOn(EntitySourceWriter pw) {
- if ((this.table().primaryKeyColumnsSize() > 1) && this.config.generateIdClassForCompoundPK()) {
- pw.printAnnotation(JPA.ID_CLASS);
- pw.print('(');
- pw.printTypeDeclaration(this.entityClassName + ".PK");
- pw.print(".class)");
- pw.println();
- }
- }
-
- private void printEntityPrimaryKeyFieldsOn(EntitySourceWriter pw) {
- if ((this.table().primaryKeyColumnsSize() > 1) && this.config.generateEmbeddedIdForCompoundPK()) {
- this.printEntityEmbeddedIdPrimaryKeyFieldOn(pw);
- } else {
- this.printEntityReadOnlyPrimaryKeyFieldsOn(pw);
- this.printEntityWritablePrimaryKeyFieldsOn(pw);
- }
- }
-
- private void printEntityEmbeddedIdPrimaryKeyFieldOn(EntitySourceWriter pw) {
- if (this.config.fieldAccessType()) {
- pw.printAnnotation(JPA.EMBEDDED_ID);
- pw.println();
- }
- pw.printVisibility(this.config.fieldVisibility());
- pw.printTypeDeclaration(this.entityClassName + ".PK");
- pw.print(' ');
- pw.print(this.genTable.fieldNameForEmbeddedId());
- pw.print(';');
- pw.println();
- pw.println();
- }
-
- private void printEntityReadOnlyPrimaryKeyFieldsOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.genTable.readOnlyPrimaryKeyColumns(); stream.hasNext(); ) {
- this.printEntityReadOnlyPrimaryKeyFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityReadOnlyPrimaryKeyFieldOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.fieldNameFor(column);
- if (this.config.fieldAccessType()) {
- pw.printAnnotation(JPA.ID);
- pw.println();
- if (column.matchesJavaFieldName(fieldName)) {
- this.printReadOnlyColumnAnnotationOn(pw); // no Column name needed
- } else {
- this.printReadOnlyColumnAnnotationOn(column.getName(), pw);
- }
- }
- pw.printVisibility(this.config.fieldVisibility());
- pw.printTypeDeclaration(column.javaTypeDeclaration());
- pw.print(' ');
- pw.print(fieldName);
- pw.print(';');
- pw.println();
- pw.println();
- }
-
- private void printReadOnlyColumnAnnotationOn(String columnName, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.COLUMN);
- pw.print("(name=\"");
- pw.print(columnName);
- pw.print("\", insertable=false, updatable=false)");
- pw.println();
- }
-
- private void printReadOnlyColumnAnnotationOn(EntitySourceWriter pw) {
- pw.printAnnotation(JPA.COLUMN);
- pw.print("(insertable=false, updatable=false)");
- pw.println();
- }
-
- private void printEntityWritablePrimaryKeyFieldsOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.genTable.writablePrimaryKeyColumns(); stream.hasNext(); ) {
- this.printEntityWritablePrimaryKeyFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityWritablePrimaryKeyFieldOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.fieldNameFor(column);
- if (this.config.fieldAccessType()) {
- pw.printAnnotation(JPA.ID);
- pw.println();
- if ( ! column.matchesJavaFieldName(fieldName)) {
- this.printColumnAnnotationOn(column.getName(), pw);
- }
- }
- pw.printVisibility(this.config.fieldVisibility());
- pw.printTypeDeclaration(column.javaTypeDeclaration());
- pw.print(' ');
- pw.print(fieldName);
- pw.print(';');
- pw.println();
- pw.println();
- }
-
- private void printEntityNonPrimaryKeyBasicFieldsOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.genTable.nonPrimaryKeyBasicColumns(); stream.hasNext(); ) {
- this.printEntityNonPrimaryKeyBasicFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityNonPrimaryKeyBasicFieldOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.fieldNameFor(column);
- if (this.config.fieldAccessType()) {
- if ( ! column.matchesJavaFieldName(fieldName)) {
- this.printColumnAnnotationOn(column.getName(), pw);
- }
- }
- if (column.isLob()) {
- pw.printAnnotation(JPA.LOB);
- pw.println();
- }
- pw.printVisibility(this.config.fieldVisibility());
- pw.printTypeDeclaration(column.javaTypeDeclaration());
- pw.print(' ');
- pw.print(fieldName);
- pw.print(';');
- pw.println();
- pw.println();
- }
-
- private void printColumnAnnotationOn(String columnName, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.COLUMN);
- pw.print("(name=\"");
- pw.print(columnName);
- pw.print("\")");
- pw.println();
- }
-
- private void printEntityManyToOneFieldsOn(EntitySourceWriter pw) {
- for (Iterator<ManyToOneRelation> stream = this.genTable.manyToOneRelations(); stream.hasNext(); ) {
- this.printEntityManyToOneFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityManyToOneFieldOn(ManyToOneRelation relation, EntitySourceWriter pw) {
- String fieldName = this.genTable.fieldNameFor(relation);
- if (this.config.fieldAccessType()) {
- this.printManyToOneAnnotationOn(fieldName, relation, pw);
- }
- pw.printVisibility(this.config.fieldVisibility());
- pw.printTypeDeclaration(this.fullyQualify(relation.referencedEntityName()));
- pw.print(' ');
- pw.print(fieldName);
- pw.print(';');
- pw.println();
- pw.println();
- }
-
- private void printManyToOneAnnotationOn(String fieldName, ManyToOneRelation relation, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.MANY_TO_ONE);
- pw.println();
- ForeignKey fk = relation.getForeignKey();
- if (fk.matchesJavaFieldName(fieldName)) {
- return; // no JoinColumn annotation needed
- }
- if (fk.referencesSingleColumnPrimaryKey()) {
- pw.printAnnotation(JPA.JOIN_COLUMN);
- pw.print("(name=\"");
- pw.print(fk.columnPairs().next().getBaseColumn().getName());
- pw.print("\")");
- } else {
- if (fk.columnPairsSize() > 1) {
- pw.printAnnotation(JPA.JOIN_COLUMNS);
- pw.print("({");
- pw.println();
- pw.indent();
- }
- this.printJoinColumnAnnotationsOn(fk, pw);
- if (fk.columnPairsSize() > 1) {
- pw.undent();
- pw.println();
- pw.print("})");
- }
- }
- pw.println();
- }
-
- private void printJoinColumnAnnotationsOn(ForeignKey foreignKey, EntitySourceWriter pw) {
- for (Iterator<ForeignKey.ColumnPair> stream = foreignKey.columnPairs(); stream.hasNext(); ) {
- this.printJoinColumnAnnotationOn(stream.next(), pw);
- if (stream.hasNext()) {
- pw.println(',');
- }
- }
- }
-
- private void printJoinColumnAnnotationOn(ForeignKey.ColumnPair columnPair, EntitySourceWriter pw) {
- this.printJoinColumnAnnotationOn(columnPair.getBaseColumn().getName(), columnPair.getReferencedColumn().getName(), pw);
- }
-
- /**
- * assume that at least one of the two names is not null
- */
- private void printJoinColumnAnnotationOn(String baseColumnName, String referencedColumnName, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.JOIN_COLUMN);
- pw.print('(');
- if (baseColumnName != null) {
- pw.print("name=\"");
- pw.print(baseColumnName);
- }
- if (referencedColumnName != null) {
- if (baseColumnName != null) {
- pw.print("\", ");
- }
- pw.print("referencedColumnName=\"");
- pw.print(referencedColumnName);
- }
- pw.print("\")");
- }
-
- private void printEntityOneToManyFieldsOn(EntitySourceWriter pw) {
- for (Iterator<OneToManyRelation> stream = this.genTable.oneToManyRelations(); stream.hasNext(); ) {
- this.printEntityOneToManyFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityOneToManyFieldOn(OneToManyRelation relation, EntitySourceWriter pw) {
- String fieldName = this.genTable.fieldNameFor(relation);
- if (this.config.fieldAccessType()) {
- this.printOneToManyAnnotationOn(fieldName, relation, pw);
- }
- pw.printVisibility(this.config.fieldVisibility());
- pw.printTypeDeclaration(this.config.getCollectionTypeName());
- pw.print('<');
- pw.printTypeDeclaration(this.fullyQualify(relation.referencedEntityName()));
- pw.print('>');
- pw.print(' ');
- pw.print(fieldName);
- pw.print(';');
- pw.println();
- pw.println();
- }
-
- private void printOneToManyAnnotationOn(String fieldName, OneToManyRelation relation, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.ONE_TO_MANY);
- pw.print("(mappedBy=\"");
- pw.print(relation.mappedBy());
- pw.print("\")");
- pw.println();
- }
-
- private void printEntityOwnedManyToManyFieldsOn(EntitySourceWriter pw) {
- for (Iterator<ManyToManyRelation> stream = this.genTable.ownedManyToManyRelations(); stream.hasNext(); ) {
- this.printEntityOwnedManyToManyFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityOwnedManyToManyFieldOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- String fieldName = this.genTable.fieldNameFor(relation);
- if (this.config.fieldAccessType()) {
- this.printOwnedManyToManyAnnotationOn(fieldName, relation, pw);
- }
- pw.printVisibility(this.config.fieldVisibility());
- pw.printTypeDeclaration(this.config.getCollectionTypeName());
- pw.print('<');
- pw.printTypeDeclaration(this.fullyQualify(relation.nonOwningEntityName()));
- pw.print('>');
- pw.print(' ');
- pw.print(fieldName);
- pw.print(';');
- pw.println();
- pw.println();
- }
-
- /**
- * I guess you could build a state machine for all this crap,
- * but that seems like overkill...
- */
- private void printOwnedManyToManyAnnotationOn(String fieldName, ManyToManyRelation relation, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.MANY_TO_MANY);
- pw.println();
- boolean first = true;
- boolean comma = false;
- if ( ! relation.joinTableNameIsDefault()) {
- if (first) {
- first = false;
- pw.printAnnotation(JPA.JOIN_TABLE);
- pw.print('(');
- }
- pw.print("name=\"");
- pw.print(relation.getJoinTable().name());
- pw.print('\"');
- comma = true;
- }
- if ( ! relation.joinColumnsIsDefaultFor(fieldName)) {
- if (first) {
- first = false;
- pw.printAnnotation(JPA.JOIN_TABLE);
- pw.print('(');
- } else if (comma) {
- pw.print(',');
- }
- pw.println();
- pw.indent();
- this.printJoinTableJoinColumnsOn("joinColumns", fieldName, relation.getOwningForeignKey(), pw);
- pw.undent();
- comma = true;
- }
- String inverseFieldName = relation.getNonOwningTable().fieldNameFor(relation);
- if ( ! relation.inverseJoinColumnsIsDefaultFor(inverseFieldName)) {
- if (first) {
- first = false;
- pw.printAnnotation(JPA.JOIN_TABLE);
- pw.print('(');
- } else if (comma) {
- pw.print(',');
- }
- pw.println();
- pw.indent();
- this.printJoinTableJoinColumnsOn("inverseJoinColumns", inverseFieldName, relation.getNonOwningForeignKey(), pw);
- pw.undent();
- comma = true;
- }
- if ( ! first) {
- pw.print(')');
- }
- pw.println();
- }
-
- private void printJoinTableJoinColumnsOn(String elementName, String fieldName, ForeignKey foreignKey, EntitySourceWriter pw) {
- if (foreignKey.columnPairsSize() != 1) {
- this.printJoinTableJoinColumnsOn(elementName, foreignKey, pw);
- } else if (foreignKey.getReferencedTable().primaryKeyColumnsSize() != 1) {
- // if the referenced table has a composite primary key, neither of the columns can be a default
- // since both of the defaults require a single-column primary key
- this.printJoinTableJoinColumnsOn(elementName, foreignKey, pw);
- } else {
- ForeignKey.ColumnPair columnPair = foreignKey.columnPairs().next();
- Column pkColumn = foreignKey.getReferencedTable().primaryKeyColumns().next();
- if (columnPair.getBaseColumn().matchesJavaFieldName(fieldName + "_" + pkColumn.getName())) {
- if (columnPair.getReferencedColumn() == pkColumn) {
- // we shouldn't get here...
- } else {
- pw.print(elementName);
- pw.print('=');
- this.printJoinColumnAnnotationOn(null, columnPair.getReferencedColumn().getName(), pw);
- }
- } else {
- if (columnPair.getReferencedColumn() == pkColumn) {
- pw.print(elementName);
- pw.print('=');
- this.printJoinColumnAnnotationOn(columnPair.getBaseColumn().getName(), null, pw);
- } else {
- this.printJoinTableJoinColumnsOn(elementName, foreignKey, pw);
- }
- }
- }
- }
-
- private void printJoinTableJoinColumnsOn(String elementName, ForeignKey foreignKey, EntitySourceWriter pw) {
- pw.print(elementName);
- pw.print('=');
- if (foreignKey.columnPairsSize() > 1) {
- pw.print('{');
- pw.println();
- pw.indent();
- }
- this.printJoinColumnAnnotationsOn(foreignKey, pw);
- if (foreignKey.columnPairsSize() > 1) {
- pw.undent();
- pw.println();
- pw.print('}');
- pw.println();
- }
- }
-
- private void printEntityNonOwnedManyToManyFieldsOn(EntitySourceWriter pw) {
- for (Iterator<ManyToManyRelation> stream = this.genTable.nonOwnedManyToManyRelations(); stream.hasNext(); ) {
- this.printEntityNonOwnedManyToManyFieldOn(stream.next(), pw);
- }
- }
-
- private void printEntityNonOwnedManyToManyFieldOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- String fieldName = this.genTable.fieldNameFor(relation);
- if (this.config.fieldAccessType()) {
- this.printNonOwnedManyToManyAnnotationOn(fieldName, relation, pw);
- }
- pw.printVisibility(this.config.fieldVisibility());
- pw.printTypeDeclaration(this.config.getCollectionTypeName());
- pw.print('<');
- pw.printTypeDeclaration(this.fullyQualify(relation.owningEntityName()));
- pw.print('>');
- pw.print(' ');
- pw.print(fieldName);
- pw.print(';');
- pw.println();
- pw.println();
- }
-
- private void printNonOwnedManyToManyAnnotationOn(String fieldName, ManyToManyRelation relation, EntitySourceWriter pw) {
- pw.printAnnotation(JPA.MANY_TO_MANY);
- pw.print("(mappedBy=\"");
- pw.print(relation.getMappedBy());
- pw.print("\")");
- pw.println();
- }
-
- private String fullyQualify(String shortClassName) {
- String pkg = this.packageName();
- return (pkg.length() == 0) ? shortClassName : pkg + '.' + shortClassName;
- }
-
- private void printSerialVersionUID(EntitySourceWriter pw) {
- if (this.config.generateSerialVersionUID()) {
- pw.print("private static final long serialVersionUID = 1L;");
- pw.println();
- }
- }
-
- private void printZeroArgumentConstructorOn(String ctorName, String visibility, EntitySourceWriter pw) {
- if (this.config.generateDefaultConstructor()) {
- pw.printVisibility(visibility);
- pw.print(ctorName);
- pw.print("() {");
- pw.println();
- pw.indent();
- pw.println("super();");
- pw.undent();
- pw.print('}');
- pw.println();
- pw.println();
- }
- }
-
- private void printEntityPrimaryKeyGettersAndSettersOn(EntitySourceWriter pw) {
- if ((this.table().primaryKeyColumnsSize() > 1) && this.config.generateEmbeddedIdForCompoundPK()) {
- this.printEntityEmbeddedIdPrimaryKeyGetterAndSetterOn(pw);
- } else {
- this.printEntityReadOnlyPrimaryKeyGettersAndSettersOn(pw);
- this.printEntityWritablePrimaryKeyGettersAndSettersOn(pw);
- }
- }
-
- private void printEntityEmbeddedIdPrimaryKeyGetterAndSetterOn(EntitySourceWriter pw) {
- if (this.config.propertyAccessType()) {
- pw.printAnnotation(JPA.EMBEDDED_ID);
- pw.println();
- }
- pw.printGetterAndSetter(this.genTable.fieldNameForEmbeddedId(), this.entityClassName + ".PK", this.config.methodVisibility());
- }
-
- private void printEntityReadOnlyPrimaryKeyGettersAndSettersOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.genTable.readOnlyPrimaryKeyColumns(); stream.hasNext(); ) {
- this.printEntityReadOnlyPrimaryKeyGetterAndSetterOn(stream.next(), pw);
- }
- }
-
- private void printEntityReadOnlyPrimaryKeyGetterAndSetterOn(Column column, EntitySourceWriter pw) {
- String propertyName = this.genTable.fieldNameFor(column);
- if (this.config.propertyAccessType()) {
- pw.printAnnotation(JPA.ID);
- pw.println();
- if (column.matchesJavaFieldName(propertyName)) {
- this.printReadOnlyColumnAnnotationOn(pw); // no Column name needed
- } else {
- this.printReadOnlyColumnAnnotationOn(column.getName(), pw);
- }
- }
-
- pw.printGetterAndSetter(propertyName, column.javaTypeDeclaration(), this.config.methodVisibility());
- }
-
- private void printEntityWritablePrimaryKeyGettersAndSettersOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.genTable.writablePrimaryKeyColumns(); stream.hasNext(); ) {
- this.printEntityWritablePrimaryKeyGetterAndSetterOn(stream.next(), pw);
- }
- }
-
- private void printEntityWritablePrimaryKeyGetterAndSetterOn(Column column, EntitySourceWriter pw) {
- String propertyName = this.genTable.fieldNameFor(column);
- if (this.config.propertyAccessType()) {
- pw.printAnnotation(JPA.ID);
- pw.println();
- if ( ! column.matchesJavaFieldName(propertyName)) {
- this.printColumnAnnotationOn(column.getName(), pw);
- }
- }
-
- pw.printGetterAndSetter(propertyName, column.javaTypeDeclaration(), this.config.methodVisibility());
- }
-
- private void printEntityNonPrimaryKeyBasicGettersAndSettersOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.genTable.nonPrimaryKeyBasicColumns(); stream.hasNext(); ) {
- this.printEntityNonPrimaryKeyBasicGetterAndSetterOn(stream.next(), pw);
- }
- }
-
- private void printEntityNonPrimaryKeyBasicGetterAndSetterOn(Column column, EntitySourceWriter pw) {
- String propertyName = this.genTable.fieldNameFor(column);
- if (this.config.propertyAccessType()) {
- if ( ! column.matchesJavaFieldName(propertyName)) {
- this.printColumnAnnotationOn(column.getName(), pw);
- }
- }
-
- pw.printGetterAndSetter(propertyName, column.javaTypeDeclaration(), this.config.methodVisibility());
- }
-
- private void printEntityManyToOneGettersAndSettersOn(EntitySourceWriter pw) {
- for (Iterator<ManyToOneRelation> stream = this.genTable.manyToOneRelations(); stream.hasNext(); ) {
- this.printEntityManyToOneGetterAndSetterOn(stream.next(), pw);
- }
- }
-
- private void printEntityManyToOneGetterAndSetterOn(ManyToOneRelation relation, EntitySourceWriter pw) {
- String propertyName = this.genTable.fieldNameFor(relation);
- if (this.config.propertyAccessType()) {
- this.printManyToOneAnnotationOn(propertyName, relation, pw);
- }
-
- String typeDeclaration = this.fullyQualify(relation.referencedEntityName());
- pw.printGetterAndSetter(propertyName, typeDeclaration, this.config.methodVisibility());
- }
-
- private void printEntityOneToManyGettersAndSettersOn(EntitySourceWriter pw) {
- for (Iterator<OneToManyRelation> stream = this.genTable.oneToManyRelations(); stream.hasNext(); ) {
- this.printEntityOneToManyGetterAndSetterOn(stream.next(), pw);
- }
- }
-
- private void printEntityOneToManyGetterAndSetterOn(OneToManyRelation relation, EntitySourceWriter pw) {
- String propertyName = this.genTable.fieldNameFor(relation);
- if (this.config.propertyAccessType()) {
- this.printOneToManyAnnotationOn(propertyName, relation, pw);
- }
-
- String elementTypeDeclaration = this.fullyQualify(relation.referencedEntityName());
- pw.printCollectionGetterAndSetter(propertyName, this.config.getCollectionTypeName(), elementTypeDeclaration, this.config.methodVisibility());
- }
-
- private void printEntityOwnedManyToManyGettersAndSettersOn(EntitySourceWriter pw) {
- for (Iterator<ManyToManyRelation> stream = this.genTable.ownedManyToManyRelations(); stream.hasNext(); ) {
- this.printEntityOwnedManyToManyGetterAndSetterOn(stream.next(), pw);
- }
- }
-
- private void printEntityOwnedManyToManyGetterAndSetterOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- String propertyName = this.genTable.fieldNameFor(relation);
- if (this.config.propertyAccessType()) {
- this.printOwnedManyToManyAnnotationOn(propertyName, relation, pw);
- }
-
- String elementTypeDeclaration = this.fullyQualify(relation.nonOwningEntityName());
- pw.printCollectionGetterAndSetter(propertyName, this.config.getCollectionTypeName(), elementTypeDeclaration, this.config.methodVisibility());
- }
-
- private void printEntityNonOwnedManyToManyGettersAndSettersOn(EntitySourceWriter pw) {
- for (Iterator<ManyToManyRelation> stream = this.genTable.nonOwnedManyToManyRelations(); stream.hasNext(); ) {
- this.printEntityNonOwnedManyToManyGetterAndSetterOn(stream.next(), pw);
- }
- }
-
- private void printEntityNonOwnedManyToManyGetterAndSetterOn(ManyToManyRelation relation, EntitySourceWriter pw) {
- String propertyName = this.genTable.fieldNameFor(relation);
- if (this.config.propertyAccessType()) {
- this.printNonOwnedManyToManyAnnotationOn(propertyName, relation, pw);
- }
-
- String elementTypeDeclaration = this.fullyQualify(relation.owningEntityName());
- pw.printCollectionGetterAndSetter(propertyName, this.config.getCollectionTypeName(), elementTypeDeclaration, this.config.methodVisibility());
- }
-
- private void printPrimaryKeyClassOn(EntitySourceWriter pw) {
- if (this.table().primaryKeyColumnsSize() <= 1) {
- return;
- }
- pw.println();
- if (this.config.generateEmbeddedIdForCompoundPK()) {
- pw.printAnnotation(JPA.EMBEDDABLE);
- pw.println();
- }
- pw.print("public static class PK implements ");
- pw.printTypeDeclaration(Serializable.class.getName());
- pw.print(" {");
- pw.println();
-
- pw.indent();
- this.printIdFieldsOn(pw);
- this.printSerialVersionUID(pw);
- pw.println();
- this.printZeroArgumentConstructorOn("PK", "public", pw);
-
- if (this.config.propertyAccessType() || this.config.generateGettersAndSetters()) {
- this.printIdGettersAndSettersOn(pw);
- }
-
- this.printEqualsMethodOn("PK", this.table().primaryKeyColumns(), pw);
- this.printHashCodeMethodOn(this.table().primaryKeyColumns(), pw);
- pw.undent();
-
- pw.print('}');
- pw.println();
- pw.println();
- }
-
- private void printIdFieldsOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.table().primaryKeyColumns(); stream.hasNext(); ) {
- this.printIdFieldOn(stream.next(), pw);
- }
- }
-
- private void printIdFieldOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.fieldNameFor(column);
- pw.printVisibility(this.config.fieldVisibility());
- pw.printTypeDeclaration(column.javaTypeDeclaration());
- pw.print(' ');
- pw.print(fieldName);
- pw.print(';');
- pw.println();
- }
-
- private void printIdGettersAndSettersOn(EntitySourceWriter pw) {
- for (Iterator<Column> stream = this.table().primaryKeyColumns(); stream.hasNext(); ) {
- this.printIdGetterAndSetterOn(stream.next(), pw);
- }
- }
-
- private void printIdGetterAndSetterOn(Column column, EntitySourceWriter pw) {
- String propertyName = this.genTable.fieldNameFor(column);
- pw.printGetterAndSetter(propertyName, column.javaTypeDeclaration(), this.config.methodVisibility());
- }
-
- private void printEqualsMethodOn(String className, Iterator<Column> columns, EntitySourceWriter pw) {
- pw.printAnnotation("java.lang.Override");
- pw.println();
-
- pw.println("public boolean equals(Object o) {");
- pw.indent();
- pw.println("if (o == this) {");
- pw.indent();
- pw.println("return true;");
- pw.undent();
- pw.print('}');
- pw.println();
-
- pw.print("if ( ! (o instanceof ");
- pw.print(className);
- pw.print(")) {");
- pw.println();
- pw.indent();
- pw.println("return false;");
- pw.undent();
- pw.print('}');
- pw.println();
-
- pw.print(className);
- pw.print(" other = (");
- pw.print(className);
- pw.print(") o;");
- pw.println();
-
- pw.print("return ");
- pw.indent();
- while (columns.hasNext()) {
- this.printEqualsClauseOn(columns.next(), pw);
- if (columns.hasNext()) {
- pw.println();
- pw.print("&& ");
- }
- }
- pw.print(';');
- pw.println();
- pw.undent();
- pw.undent();
- pw.print('}');
- pw.println();
- pw.println();
- }
-
- private void printEqualsClauseOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.fieldNameFor(column);
- JavaType javaType = column.javaType();
- if (javaType.isPrimitive()) {
- this.printPrimitiveEqualsClauseOn(fieldName, pw);
- } else {
- this.printReferenceEqualsClauseOn(fieldName, pw);
- }
- }
-
- private void printPrimitiveEqualsClauseOn(String fieldName, EntitySourceWriter pw) {
- pw.print("(this.");
- pw.print(fieldName);
- pw.print(" == other.");
- pw.print(fieldName);
- pw.print(')');
- }
-
- private void printReferenceEqualsClauseOn(String fieldName, EntitySourceWriter pw) {
- pw.print("this.");
- pw.print(fieldName);
- pw.print(".equals(other.");
- pw.print(fieldName);
- pw.print(')');
- }
-
- private void printHashCodeMethodOn(Iterator<Column> columns, EntitySourceWriter pw) {
- pw.printAnnotation("java.lang.Override");
- pw.println();
-
- pw.println("public int hashCode() {");
- pw.indent();
- pw.print("return ");
- pw.indent();
- while (columns.hasNext()) {
- this.printHashCodeClauseOn(columns.next(), pw);
- if (columns.hasNext()) {
- pw.println();
- pw.print("^ ");
- }
- }
- pw.print(';');
- pw.println();
- pw.undent();
- pw.undent();
- pw.print('}');
- pw.println();
- pw.println();
- }
-
- private void printHashCodeClauseOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.fieldNameFor(column);
- JavaType javaType = column.javaType();
- if (javaType.isPrimitive()) {
- this.printPrimitiveHashCodeClauseOn(javaType.getElementTypeName(), fieldName, pw);
- } else {
- this.printReferenceHashCodeClauseOn(fieldName, pw);
- }
- }
-
- private void printPrimitiveHashCodeClauseOn(String primitiveName, String fieldName, EntitySourceWriter pw) {
- if (primitiveName.equals("int") || primitiveName.equals("short") || primitiveName.equals("byte") || primitiveName.equals("char")) {
- pw.print("this.");
- pw.print(fieldName);
- } else if (primitiveName.equals("long")) { // cribbed from Long#hashCode()
- // ((int) (this.value ^ (this.value >>> 32)))
- pw.print("((int) (this.");
- pw.print(fieldName);
- pw.print(" ^ (this.");
- pw.print(fieldName);
- pw.print(" >>> 32)))");
- } else if (primitiveName.equals("double")) { // cribbed from Double#hashCode()
- // ((int) (java.lang.Double.doubleToLongBits(this.value) ^ (java.lang.Double.doubleToLongBits(this.value) >>> 32)))
- pw.print("((int) (");
- pw.printTypeDeclaration("java.lang.Double");
- pw.print(".doubleToLongBits(this.");
- pw.print(fieldName);
- pw.print(") ^ (");
- pw.printTypeDeclaration("java.lang.Double");
- pw.print(".doubleToLongBits(this.");
- pw.print(fieldName);
- pw.print(") >>> 32)))");
- } else if (primitiveName.equals("float")) { // cribbed from Float#hashCode()
- // java.lang.Float.floatToIntBits(this.value)
- pw.printTypeDeclaration("java.lang.Float");
- pw.print(".floatToIntBits(this.");
- pw.print(fieldName);
- pw.print(')');
- } else if (primitiveName.equals("boolean")) { // cribbed from Boolean#hashCode()
- // (this.value ? 1231 : 1237)
- pw.print("(this.");
- pw.print(fieldName);
- pw.print(" ? 1231 : 1237)");
- } else {
- throw new IllegalArgumentException(primitiveName);
- }
- }
-
- private void printReferenceHashCodeClauseOn(String fieldName, EntitySourceWriter pw) {
- pw.print("this.");
- pw.print(fieldName);
- pw.print(".hashCode()");
- }
-
- private void printPackageAndImportsOn(PrintWriter pw, BodySource bodySource) {
- if (this.packageName().length() != 0) {
- pw.print("package ");
- pw.print(this.packageName());
- pw.print(';');
- pw.println();
- pw.println();
- }
-
- for (Iterator<Map.Entry<String, String>> stream = bodySource.importEntries(); stream.hasNext(); ) {
- Map.Entry<String, String> entry = stream.next();
- pw.print("import ");
- pw.print(entry.getValue()); // package
- pw.print('.');
- pw.print(entry.getKey()); // short class name
- pw.print(';');
- pw.println();
- }
- pw.println();
- }
-
-
- // ********** convenience methods **********
-
- private String packageName() {
- return this.packageFragment.getElementName();
- }
-
- private Table table() {
- return this.genTable.getTable();
- }
-
- private String entityName() {
- return this.genTable.getEntityName();
- }
-
-
- // ********** writer **********
-
- private interface BodySource {
-
- /**
- * return a sorted set of map entries; the key is the short class name,
- * the value is the package name
- */
- Iterator<Map.Entry<String, String>> importEntries();
-
- /**
- * return the body source code
- */
- String source();
-
- /**
- * return the length of the body source code
- */
- int length();
-
- }
-
- /**
- * Extend IndentingPrintWriter with some methods that facilitate building
- * entity source code.
- */
- private static class EntitySourceWriter extends IndentingPrintWriter implements BodySource {
- final String packageName;
- final String entityClassName;
- // key = short class name; value = package name
- private final Map<String, String> imports = new HashMap<String, String>();
-
- EntitySourceWriter(String packageName, String entityClassName) {
- super(new StringWriter(20000));
- this.packageName = packageName;
- this.entityClassName = entityClassName;
- }
-
- void printVisibility(String visibilityModifier) {
- if (visibilityModifier.length() != 0) {
- this.print(visibilityModifier);
- this.print(' ');
- }
- }
-
- void printAnnotation(String annotationName) {
- this.print('@');
- this.printTypeDeclaration(annotationName);
- }
-
- void printTypeDeclaration(String typeDeclaration) {
- this.print(this.importedTypeDeclaration(typeDeclaration));
- }
-
- /**
- * Return the specified class's "imported" name.
- * The class declaration must be of the form:
- * "int"
- * "int[]" (not "[I")
- * "java.lang.Object"
- * "java.lang.Object[]" (not "[Ljava.lang.Object;")
- * "java.util.Map.Entry" (not "java.util.Map$Entry")
- * "java.util.Map.Entry[][]" (not "[[Ljava.util.Map$Entry;")
- */
- private String importedTypeDeclaration(String typeDeclaration) {
- if (this.typeDeclarationIsMemberClass(typeDeclaration)) {
- // no need for an import, just return the partially-qualified name
- return this.memberClassTypeDeclaration(typeDeclaration);
- }
- int last = typeDeclaration.lastIndexOf('.');
- String pkg = (last == -1) ? "" : typeDeclaration.substring(0, last);
- String shortTypeDeclaration = typeDeclaration.substring(last + 1);
- String shortElementTypeName = shortTypeDeclaration;
- while (shortElementTypeName.endsWith("[]")) {
- shortElementTypeName = shortElementTypeName.substring(0, shortElementTypeName.length() - 2);
- }
- String prev = this.imports.get(shortElementTypeName);
- if (prev == null) {
- // this is the first class with this short element type name
- this.imports.put(shortElementTypeName, pkg);
- return shortTypeDeclaration;
- }
- if (prev.equals(pkg)) {
- // this element type has already been imported
- return shortTypeDeclaration;
- }
- // another class with the same short element type name has been
- // previously imported, so this one must be used fully-qualified
- return typeDeclaration;
- }
-
- /**
- * e.g. "foo.bar.Employee.PK" will return true
- */
- private boolean typeDeclarationIsMemberClass(String typeDeclaration) {
- return (typeDeclaration.length() > this.entityClassName.length())
- && typeDeclaration.startsWith(this.entityClassName)
- && (typeDeclaration.charAt(this.entityClassName.length()) == '.');
- }
-
- /**
- * e.g. "foo.bar.Employee.PK" will return "Employee.PK"
- * this prevents collisions with other imported classes (e.g. "joo.jar.PK")
- */
- private String memberClassTypeDeclaration(String typeDeclaration) {
- int index = this.packageName.length();
- if (index != 0) {
- index++; // bump past the '.'
- }
- return typeDeclaration.substring(index);
- }
-
- public Iterator<Map.Entry<String, String>> importEntries() {
- return new FilteringIterator<Map.Entry<String, String>>(this.sortedImportEntries()) {
- @Override
- @SuppressWarnings("unchecked")
- protected boolean accept(Object next) {
- String pkg = ((Map.Entry<String, String>) next).getValue();
- if (pkg.equals("")
- || pkg.equals("java.lang")
- || pkg.equals(EntitySourceWriter.this.packageName)) {
- return false;
- }
- return true;
- }
- };
- }
-
- private Iterator<Map.Entry<String, String>> sortedImportEntries() {
- TreeSet<Map.Entry<String, String>> sortedImports = new TreeSet<Map.Entry<String, String>>(this.buildImportEntriesComparator());
- sortedImports.addAll(this.imports.entrySet());
- return sortedImports.iterator();
- }
-
- private Comparator<Map.Entry<String, String>> buildImportEntriesComparator() {
- return new Comparator<Map.Entry<String, String>>() {
- public int compare(Map.Entry<String, String> e1, Map.Entry<String, String> e2) {
- Collator collator = Collator.getInstance();
- int pkg = collator.compare(e1.getValue(), e2.getValue());
- return (pkg == 0) ? collator.compare(e1.getKey(), e2.getKey()) : pkg;
- }
- };
- }
-
- void printGetterAndSetter(String propertyName, String typeDeclaration, String visibility) {
- this.printGetter(propertyName, typeDeclaration, visibility);
- this.println();
- this.println();
-
- this.printSetter(propertyName, typeDeclaration, visibility);
- this.println();
- this.println();
- }
-
- private void printGetter(String propertyName, String typeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.printTypeDeclaration(typeDeclaration);
- this.print(' ');
- this.print(typeDeclaration.equals("boolean") ? "is" : "get");
- this.print(StringTools.capitalize(propertyName));
- this.print("() {");
- this.println();
-
- this.indent();
- this.print("return this.");
- this.print(propertyName);
- this.print(';');
- this.println();
- this.undent();
-
- this.print('}');
- }
-
- private void printSetter(String propertyName, String typeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.print("void set");
- this.print(StringTools.capitalize(propertyName));
- this.print('(');
- this.printTypeDeclaration(typeDeclaration);
- this.print(' ');
- this.print(propertyName);
- this.print(") {");
- this.println();
-
- this.indent();
- this.print("this.");
- this.print(propertyName);
- this.print(" = ");
- this.print(propertyName);
- this.print(';');
- this.println();
- this.undent();
-
- this.print('}');
- }
-
- void printCollectionGetterAndSetter(String propertyName, String collectionTypeDeclaration, String elementTypeDeclaration, String visibility) {
- this.printCollectionGetter(propertyName, collectionTypeDeclaration, elementTypeDeclaration, visibility);
- this.println();
- this.println();
-
- this.printCollectionSetter(propertyName, collectionTypeDeclaration, elementTypeDeclaration, visibility);
- this.println();
- this.println();
- }
-
- private void printCollectionGetter(String propertyName, String collectionTypeDeclaration, String elementTypeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.printTypeDeclaration(collectionTypeDeclaration);
- this.print('<');
- this.printTypeDeclaration(elementTypeDeclaration);
- this.print("> get");
- this.print(StringTools.capitalize(propertyName));
- this.print("() {");
- this.println();
-
- this.indent();
- this.print("return this.");
- this.print(propertyName);
- this.print(';');
- this.println();
- this.undent();
-
- this.print('}');
- }
-
- private void printCollectionSetter(String propertyName, String collectionTypeDeclaration, String elementTypeDeclaration, String visibility) {
- this.printVisibility(visibility);
- this.print("void set");
- this.print(StringTools.capitalize(propertyName));
- this.print('(');
- this.printTypeDeclaration(collectionTypeDeclaration);
- this.print('<');
- this.printTypeDeclaration(elementTypeDeclaration);
- this.print('>');
- this.print(' ');
- this.print(propertyName);
- this.print(") {");
- this.println();
-
- this.indent();
- this.print("this.");
- this.print(propertyName);
- this.print(" = ");
- this.print(propertyName);
- this.print(';');
- this.println();
- this.undent();
-
- this.print('}');
- }
-
- public String source() {
- return this.out.toString();
- }
-
- public int length() {
- return ((StringWriter) this.out).getBuffer().length();
- }
-
- }
-
-
- // ********** config **********
-
- public static class Config {
- private boolean convertToCamelCase = true;
- private boolean propertyAccessType = false; // as opposed to "field"
- private String collectionTypeName = Set.class.getName();
- private int fieldVisibility = Modifier.PRIVATE;
- private int methodVisibility = Modifier.PUBLIC;
- private boolean generateGettersAndSetters = true;
- private boolean generateDefaultConstructor = true;
- private boolean serializable = true;
- private boolean generateSerialVersionUID = true;
- private boolean generateEmbeddedIdForCompoundPK = true; // as opposed to IdClass
- private Map<Table, String> overrideEntityNames = new HashMap<Table, String>();
-
- public static final int PRIVATE = 0;
- public static final int PACKAGE = 1;
- public static final int PROTECTED = 2;
- public static final int PUBLIC = 3;
-
-
- public boolean convertToCamelCase() {
- return this.convertToCamelCase;
- }
- public void setConvertToCamelCase(boolean convertToCamelCase) {
- this.convertToCamelCase = convertToCamelCase;
- }
-
- public boolean propertyAccessType() {
- return this.propertyAccessType;
- }
- public void setPropertyAccessType(boolean propertyAccessType) {
- this.propertyAccessType = propertyAccessType;
- }
-
- public boolean fieldAccessType() {
- return ! this.propertyAccessType;
- }
- public void setFieldAccessType(boolean fieldAccessType) {
- this.propertyAccessType = ! fieldAccessType;
- }
-
- public String getCollectionTypeName() {
- return this.collectionTypeName;
- }
- public void setCollectionTypeName(String collectionTypeName) {
- this.collectionTypeName = collectionTypeName;
- }
-
- public int getFieldVisibility() {
- return this.fieldVisibility;
- }
- /** entity fields cannot be 'public' */
- public void setFieldVisibility(int fieldVisibility) {
- switch (fieldVisibility) {
- case PRIVATE:
- case PACKAGE:
- case PROTECTED:
- this.fieldVisibility = fieldVisibility;
- break;
- default:
- throw new IllegalArgumentException("invalid field visibility: " + fieldVisibility);
- }
- }
- String fieldVisibility() {
- switch (this.fieldVisibility) {
- case PRIVATE:
- return "private";
- case PACKAGE:
- return "";
- case PROTECTED:
- return "protected";
- default:
- throw new IllegalStateException("invalid field visibility: " + this.fieldVisibility);
- }
- }
-
- public int getMethodVisibility() {
- return this.methodVisibility;
- }
- /** entity properties must be 'public' or 'protected' */
- public void setMethodVisibility(int methodVisibility) {
- switch (methodVisibility) {
- case PROTECTED:
- case PUBLIC:
- this.methodVisibility = methodVisibility;
- break;
- default:
- throw new IllegalArgumentException("invalid method visibility: " + methodVisibility);
- }
- }
- String methodVisibility() {
- switch (this.methodVisibility) {
- case PROTECTED:
- return "protected";
- case PUBLIC:
- return "public";
- default:
- throw new IllegalStateException("invalid method visibility: " + this.methodVisibility);
- }
- }
-
- public boolean generateGettersAndSetters() {
- return this.generateGettersAndSetters;
- }
- public void setGenerateGettersAndSetters(boolean generateGettersAndSetters) {
- this.generateGettersAndSetters = generateGettersAndSetters;
- }
-
- public boolean generateDefaultConstructor() {
- return this.generateDefaultConstructor;
- }
- public void setGenerateDefaultConstructor(boolean generateDefaultConstructor) {
- this.generateDefaultConstructor = generateDefaultConstructor;
- }
-
- public boolean serializable() {
- return this.serializable;
- }
- public void setSerializable(boolean serializable) {
- this.serializable = serializable;
- }
-
- public boolean generateSerialVersionUID() {
- return this.generateSerialVersionUID;
- }
- public void setGenerateSerialVersionUID(boolean generateSerialVersionUID) {
- this.generateSerialVersionUID = generateSerialVersionUID;
- }
-
- public boolean generateEmbeddedIdForCompoundPK() {
- return this.generateEmbeddedIdForCompoundPK;
- }
- public void setGenerateEmbeddedIdForCompoundPK(boolean generateEmbeddedIdForCompoundPK) {
- this.generateEmbeddedIdForCompoundPK = generateEmbeddedIdForCompoundPK;
- }
-
- public boolean generateIdClassForCompoundPK() {
- return ! this.generateEmbeddedIdForCompoundPK;
- }
- public void setGenerateIdClassForCompoundPK(boolean generateIdClassForCompoundPK) {
- this.generateEmbeddedIdForCompoundPK = ! generateIdClassForCompoundPK;
- }
-
- /**
- * key = table
- * value = user-supplied override entity name
- */
- public String getOverrideEntityName(Table table) {
- return this.overrideEntityNames.get(table);
- }
- public void setOverrideEntityName(Table table, String overrideEntityName) {
- this.overrideEntityNames.put(table, overrideEntityName);
- }
- public void clearOverrideEntityNames() {
- this.overrideEntityNames.clear();
- }
- public void setOverrideEntityNames(Map<Table, String> overrideEntityNames) {
- this.clearOverrideEntityNames();
- for (Map.Entry<Table, String> entry : overrideEntityNames.entrySet()) {
- this.setOverrideEntityName(entry.getKey(), entry.getValue());
- }
- }
-
- }
-
-
- // ********** config **********
-
- public static interface OverwriteConfirmer {
- /**
- * Return whether the entity generator should overwrite the specified
- * file.
- */
- boolean overwrite(String className);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java
deleted file mode 100644
index ee9db7fa8d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenScope.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.gen.internal;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-class GenScope {
- private final Map<Table, GenTable> genTables = new HashMap<Table, GenTable>();
-
- private IProgressMonitor progressMonitor;
-
- // ********** construction/initialization **********
-
- GenScope(Collection<Table> tables, EntityGenerator.Config entityConfig, IProgressMonitor progressMonitor) {
- super();
- this.initialize(tables, entityConfig, progressMonitor);
- }
-
- private void checkCanceled() {
- if (this.progressMonitor.isCanceled()) {
- throw new OperationCanceledException();
- }
- }
-
- private void initialize(Collection<Table> tables, EntityGenerator.Config entityConfig, IProgressMonitor monitor) {
- this.progressMonitor = monitor;
- this.buildGenTables(tables, entityConfig);
- checkCanceled();
- this.configureManyToManyRelations();
- checkCanceled();
- this.configureManyToOneRelations();
- checkCanceled();
- this.configureFieldNames();
- checkCanceled();
- }
-
- private void buildGenTables(Collection<Table> tables, EntityGenerator.Config entityConfig) {
- int size = tables.size();
- // pass around a growing list of the entity names so we can avoid duplicates
- Set<String> entityNames = new HashSet<String>(size);
- for (Table table : tables) {
- this.buildGenTable(table, entityConfig, entityNames);
- this.progressMonitor.worked(40/size);
- }
- }
-
- private void buildGenTable(Table table, EntityGenerator.Config entityConfig, Collection<String> entityNames) {
- this.genTables.put(table, new GenTable(this, table, entityConfig, entityNames));
- }
-
- /**
- * find all the "join" tables
- */
- private void configureManyToManyRelations() {
- int tablesSize = CollectionTools.size(this.tables());
-
- //first time takes the longest, should we take that into account?
- for (Iterator<GenTable> stream = this.tables(); stream.hasNext(); ) {
- checkCanceled();
- stream.next().configureManyToManyRelations();
- this.progressMonitor.worked(730/tablesSize);
- }
- // revert any "join" table that is referenced by another table back to an "entity" table
- Set<GenTable> referencedTables = this.buildReferencedTables();
- tablesSize = CollectionTools.size(this.joinTables());
- for (Iterator<GenTable> stream = this.joinTables(); stream.hasNext(); ) {
- GenTable joinGenTable = stream.next();
- if (referencedTables.contains(joinGenTable)) {
- joinGenTable.clearJoinTableRelation();
- }
- this.progressMonitor.worked(40/tablesSize);
- }
- }
-
- /**
- * find all the many-to-one and one-to-many relations
- */
- private void configureManyToOneRelations() {
- int tablesSize = CollectionTools.size(this.entityTables());
- for (Iterator<GenTable> stream = this.entityTables(); stream.hasNext(); ) {
- stream.next().configureManyToOneRelations();
- this.progressMonitor.worked(50/tablesSize);
- }
- }
-
- /**
- * determine all the Java field names up-front because we will
- * need them for things like 'mappedBy' annotation elements
- */
- private void configureFieldNames() {
- int tablesSize = CollectionTools.size(this.entityTables());
- for (Iterator<GenTable> stream = this.entityTables(); stream.hasNext(); ) {
- stream.next().configureFieldNames();
- this.progressMonitor.worked(50/tablesSize);
- }
- }
-
-
- // ********** package API **********
-
- /**
- * return only the gen tables that are suitable for generating
- * entities (i.e. exclude the "join" tables)
- */
- Iterator<GenTable> entityTables() {
- return new FilteringIterator<GenTable>(this.tables()) {
- @Override
- protected boolean accept(Object next) {
- return ! ((GenTable) next).isJoinTable();
- }
- };
- }
-
- int numEntityTables() {
- return CollectionTools.size(entityTables());
- }
-
- /**
- * return the gen table corresponding to the specified table
- */
- GenTable genTable(Table table) {
- return this.genTables.get(table);
- }
-
-
- // ********** internal API **********
-
- private Iterator<GenTable> tables() {
- return this.genTables.values().iterator();
- }
-
- /**
- * return only the "join" gen tables
- */
- private Iterator<GenTable> joinTables() {
- return new FilteringIterator<GenTable>(this.tables()) {
- @Override
- protected boolean accept(Object next) {
- return ((GenTable) next).isJoinTable();
- }
- };
- }
-
- /**
- * build a set of the tables that are referenced by other tables
- * in the scope
- */
- private Set<GenTable> buildReferencedTables() {
- int size = CollectionTools.size(this.tables());
- Set<GenTable> referencedTables = new HashSet<GenTable>(this.genTables.size());
- for (Iterator<GenTable> stream = this.tables(); stream.hasNext(); ) {
- stream.next().addReferencedTablesTo(referencedTables);
- this.progressMonitor.worked(20/size);
- }
- return referencedTables;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java
deleted file mode 100644
index ea7fd3d3c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/GenTable.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.gen.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.jpt.db.internal.Column;
-import org.eclipse.jpt.db.internal.ForeignKey;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.NameTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-/**
- * associate a table with the various relations that will be used when
- * generating the entity
- */
-class GenTable {
- private final GenScope scope;
- private final Table table;
- private final EntityGenerator.Config entityConfig;
- private final String entityName;
- private ManyToManyRelation joinTableRelation;
- private Collection<ManyToManyRelation> ownedManyToManyRelations = new ArrayList<ManyToManyRelation>();
- private Collection<ManyToManyRelation> nonOwnedManyToManyRelations = new ArrayList<ManyToManyRelation>();
- private Collection<ManyToOneRelation> manyToOneRelations = new ArrayList<ManyToOneRelation>();
- private Collection<OneToManyRelation> oneToManyRelations = new ArrayList<OneToManyRelation>();
- private Set<Column> foreignKeyColumns = new HashSet<Column>();
-
- // key=column/relation; value=name
- private final Map<Object, String> fieldNames = new HashMap<Object, String>();
-
- private static final Object EMBEDDED_ID_VIRTUAL_COLUMN = new Object();
-
-
- // ********** construction/initialization **********
-
- GenTable(GenScope scope, Table table, EntityGenerator.Config entityConfig, Collection<String> entityNames) {
- super();
- this.scope = scope;
- this.table = table;
- this.entityConfig = entityConfig;
- this.entityName = this.buildEntityName(entityNames);
- }
-
- private String buildEntityName(Collection<String> entityNames) {
- String name = this.table.shortJavaClassName();
- String overrideEntityName = this.entityConfig.getOverrideEntityName(this.table);
- if (overrideEntityName == null) {
- if (this.entityConfig.convertToCamelCase()) {
- name = StringTools.convertUnderscoresToCamelCase(name);
- }
- } else {
- name = overrideEntityName;
- }
- name = NameTools.uniqueNameForIgnoreCase(name, entityNames);
- entityNames.add(name);
- return name;
- }
-
-
- // ********** package API **********
-
- /**
- * determine whether the table is a "join" table within the table's scope
- */
- void configureManyToManyRelations() {
- if (this.table.foreignKeysSize() != 2) {
- // the table must have exactly 2 foreign keys
- return;
- }
- for (Iterator<Column> stream = this.table.columns(); stream.hasNext(); ) {
- if ( ! this.table.foreignKeyColumnsContains(stream.next())) {
- // all the table's columns must belong to one (or both) of the 2 foreign keys
- return;
- }
- }
- Iterator<ForeignKey> fKeys = this.table.foreignKeys();
- ForeignKey owningFK = fKeys.next();
- ForeignKey nonOwningFK = fKeys.next();
- GenTable owningTable = this.scope.genTable(owningFK.getReferencedTable());
- GenTable nonOwningTable = this.scope.genTable(nonOwningFK.getReferencedTable());
- if ((owningTable == null) || (nonOwningTable == null)) {
- // both tables must be in the scope
- return;
- }
- this.joinTableRelation = new ManyToManyRelation(this, owningFK, owningTable, nonOwningFK, nonOwningTable);
- }
-
- void addReferencedTablesTo(Set<GenTable> referencedTables) {
- for (Iterator<ForeignKey> stream = this.table.foreignKeys(); stream.hasNext(); ) {
- ForeignKey fk = stream.next();
- GenTable genTable = this.scope.genTable(fk.getReferencedTable());
- if (genTable != null) {
- referencedTables.add(genTable);
- }
- }
- }
-
- void clearJoinTableRelation() {
- this.joinTableRelation.clear();
- this.joinTableRelation = null;
- }
-
- /**
- * find "in-scope" foreign keys
- */
- void configureManyToOneRelations() {
- for (Iterator<ForeignKey> stream = this.table.foreignKeys(); stream.hasNext(); ) {
- ForeignKey fk = stream.next();
- GenTable referencedtable = this.scope.genTable(fk.getReferencedTable());
- if (referencedtable == null) {
- continue; // skip to next FK
- }
- this.manyToOneRelations.add(new ManyToOneRelation(this, fk, referencedtable));
- }
- }
-
- /**
- * now that all the relations are in place, we can configure the Java
- * field names
- */
- void configureFieldNames() {
- Set<Column> columns = CollectionTools.set(this.table.columns());
- if ((this.table.primaryKeyColumnsSize() > 1) && this.entityConfig.generateEmbeddedIdForCompoundPK()) {
- // if we are going to generate an EmbeddedId field, add it to
- // 'fieldNames' so we don't collide with it later, when generating
- // field names for the columns etc.
- this.configureFieldName(EMBEDDED_ID_VIRTUAL_COLUMN, "pk");
- }
- this.configureManyToOneFieldNames(columns);
- this.configureBasicFieldNames(columns);
- this.configureOneToManyFieldNames();
- this.configureOwnedManyToManyFieldNames();
- this.configureNonOwnedManyToManyFieldNames();
- }
-
- /**
- * return the columns that are part of the table's primary key
- * but are also part of an "in-scope" foreign key
- */
- public Iterator<Column> readOnlyPrimaryKeyColumns() {
- return new FilteringIterator<Column>(this.table.primaryKeyColumns()) {
- @Override
- protected boolean accept(Object column) {
- return GenTable.this.foreignKeyColumnsContains((Column) column);
- }
- };
- }
-
- /**
- * return the columns that are part of the table's primary key
- * but are NOT part of any "in-scope" foreign key
- */
- Iterator<Column> writablePrimaryKeyColumns() {
- return new FilteringIterator<Column>(this.table.primaryKeyColumns()) {
- @Override
- protected boolean accept(Object column) {
- return ! GenTable.this.foreignKeyColumnsContains((Column) column);
- }
- };
- }
-
- /**
- * return the columns that NEITHER part of the table's primary key
- * NOR part of any foreign key
- */
- public Iterator<Column> nonPrimaryKeyBasicColumns() {
- return new FilteringIterator<Column>(this.table.columns()) {
- @Override
- protected boolean accept(Object column) {
- return ! (GenTable.this.primaryKeyColumnsContains((Column) column)
- || GenTable.this.foreignKeyColumnsContains((Column) column));
- }
- };
- }
-
- Table getTable() {
- return this.table;
- }
-
- String getEntityName() {
- return this.entityName;
- }
-
- boolean isJoinTable() {
- return this.joinTableRelation != null;
- }
-
- void addOwnedManyToManyRelation(ManyToManyRelation relation) {
- this.ownedManyToManyRelations.add(relation);
- }
-
- void removeOwnedManyToManyRelation(ManyToManyRelation relation) {
- this.ownedManyToManyRelations.remove(relation);
- }
-
- void addNonOwnedManyToManyRelation(ManyToManyRelation relation) {
- this.nonOwnedManyToManyRelations.add(relation);
- }
-
- void removeNonOwnedManyToManyRelation(ManyToManyRelation relation) {
- this.nonOwnedManyToManyRelations.remove(relation);
- }
-
- void addOneToManyRelation(OneToManyRelation relation) {
- this.oneToManyRelations.add(relation);
- }
-
- String javaFieldName() {
- return this.table.javaFieldName();
- }
-
- Iterator<ManyToOneRelation> manyToOneRelations() {
- return this.manyToOneRelations.iterator();
- }
-
- Iterator<OneToManyRelation> oneToManyRelations() {
- return this.oneToManyRelations.iterator();
- }
-
- Iterator<ManyToManyRelation> ownedManyToManyRelations() {
- return this.ownedManyToManyRelations.iterator();
- }
-
- Iterator<ManyToManyRelation> nonOwnedManyToManyRelations() {
- return this.nonOwnedManyToManyRelations.iterator();
- }
-
- /**
- * the key can be a column or relation
- */
- private String fieldNameForInternal(Object o) {
- return this.fieldNames.get(o);
- }
-
- /**
- * this will return null if we don't want an embedded id field
- */
- String fieldNameForEmbeddedId() {
- return this.fieldNameForInternal(EMBEDDED_ID_VIRTUAL_COLUMN);
- }
-
- String fieldNameFor(Column column) {
- return this.fieldNameForInternal(column);
- }
-
- String fieldNameFor(ManyToOneRelation relation) {
- return this.fieldNameForInternal(relation);
- }
-
- String fieldNameFor(OneToManyRelation relation) {
- return this.fieldNameForInternal(relation);
- }
-
- String fieldNameFor(ManyToManyRelation relation) {
- return this.fieldNameForInternal(relation);
- }
-
- String name() {
- return this.table.getName();
- }
-
-
- // ********** internal API **********
-
- /**
- * while we are figuring out the names for the m:1 fields, remove from the
- * specified set of columns the columns that are only part of the foreign keys
- */
- private void configureManyToOneFieldNames(Set<Column> columns) {
- for (ManyToOneRelation relation : this.manyToOneRelations) {
- CollectionTools.removeAll(columns, relation.getForeignKey().nonPrimaryKeyBaseColumns());
- CollectionTools.addAll(this.foreignKeyColumns, relation.getForeignKey().baseColumns());
- relation.setMappedBy(this.configureFieldName(relation, relation.javaFieldName()));
- }
- }
-
- private String configureFieldName(Object o, String fieldName) {
- fieldName = this.camelCase(fieldName);
- fieldName = NameTools.uniqueNameFor(fieldName, this.fieldNames.values());
- this.fieldNames.put(o, fieldName);
- return fieldName;
- }
-
- private String camelCase(String name) {
- return this.entityConfig.convertToCamelCase() ?
- StringTools.convertUnderscoresToCamelCase(name, false) // false = don't capitalize first letter
- :
- name;
- }
-
- /**
- * build a unique field name for the specified "basic" columns,
- * checking for name collisions
- */
- private void configureBasicFieldNames(Set<Column> columns) {
- for (Column column : columns) {
- this.configureFieldName(column, column.javaFieldName());
- }
- }
-
- private void configureOneToManyFieldNames() {
- for (OneToManyRelation relation : this.oneToManyRelations) {
- this.configureFieldName(relation, relation.javaFieldName());
- }
- }
-
- private void configureOwnedManyToManyFieldNames() {
- for (ManyToManyRelation relation : this.ownedManyToManyRelations) {
- relation.setMappedBy(this.configureFieldName(relation, relation.javaFieldNameFor(this)));
- }
- }
-
- private void configureNonOwnedManyToManyFieldNames() {
- for (ManyToManyRelation relation : this.nonOwnedManyToManyRelations) {
- this.configureFieldName(relation, relation.javaFieldNameFor(this));
- }
- }
-
- boolean foreignKeyColumnsContains(Column column) {
- return this.foreignKeyColumns.contains(column);
- }
-
- boolean primaryKeyColumnsContains(Column column) {
- return this.table.primaryKeyColumnsContains(column);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java
deleted file mode 100644
index d87608715a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToManyRelation.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.gen.internal;
-
-import org.eclipse.jpt.db.internal.ForeignKey;
-
-/**
- * This object is shared by the two gen tables that make up the relation.
- * Upon construction, 'mappedBy' will be 'null'. The first gen table to be
- * used to generate an entity will fill in 'mappedBy' with the appropriate
- * field/property name.
- */
-class ManyToManyRelation {
- private final GenTable joinTable;
- private final ForeignKey owningForeignKey;
- private final GenTable owningTable;
- private final ForeignKey nonOwningForeignKey;
- private final GenTable nonOwningTable;
- private String mappedBy;
-
-
- ManyToManyRelation(GenTable joinTable, ForeignKey owningForeignKey, GenTable owningTable, ForeignKey nonOwningForeignKey, GenTable nonOwningTable) {
- super();
- this.joinTable = joinTable;
-
- this.owningForeignKey = owningForeignKey;
- this.owningTable = owningTable;
- owningTable.addOwnedManyToManyRelation(this);
-
- this.nonOwningForeignKey = nonOwningForeignKey;
- this.nonOwningTable = nonOwningTable;
- nonOwningTable.addNonOwnedManyToManyRelation(this);
- }
-
- GenTable getJoinTable() {
- return this.joinTable;
- }
-
- ForeignKey getOwningForeignKey() {
- return this.owningForeignKey;
- }
-
- GenTable getOwningTable() {
- return this.owningTable;
- }
-
- ForeignKey getNonOwningForeignKey() {
- return this.nonOwningForeignKey;
- }
-
- GenTable getNonOwningTable() {
- return this.nonOwningTable;
- }
-
- private GenTable otherTable(GenTable table) {
- return (table == this.owningTable) ? this.nonOwningTable : this.owningTable;
- }
-
- String javaFieldNameFor(GenTable table) {
- // TODO i18n?
- return this.otherTable(table).javaFieldName() + "_collection";
- }
-
- void clear() {
- this.owningTable.removeOwnedManyToManyRelation(this);
- this.nonOwningTable.removeNonOwnedManyToManyRelation(this);
- }
-
- String getMappedBy() {
- return this.mappedBy;
- }
-
- void setMappedBy(String mappedBy) {
- this.mappedBy = mappedBy;
- }
-
- String owningEntityName() {
- return this.owningTable.getEntityName();
- }
-
- String nonOwningEntityName() {
- return this.nonOwningTable.getEntityName();
- }
-
- boolean joinTableNameIsDefault() {
- return this.joinTable.name().equals(this.getOwningTable().name() + "_" + this.getNonOwningTable().name());
- }
-
- boolean joinColumnsIsDefaultFor(String javaFieldName) {
- return this.owningForeignKey.isDefaultFor(javaFieldName);
- }
-
- boolean inverseJoinColumnsIsDefaultFor(String javaFieldName) {
- return this.nonOwningForeignKey.isDefaultFor(javaFieldName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java
deleted file mode 100644
index 333018d3e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ManyToOneRelation.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.gen.internal;
-
-import org.eclipse.jpt.db.internal.ForeignKey;
-
-class ManyToOneRelation {
- private final GenTable baseTable; // the "many" side
- private final ForeignKey foreignKey;
- private final GenTable referencedTable; // the "one" side
- private String mappedBy;
-
-
- ManyToOneRelation(GenTable baseTable, ForeignKey foreignKey, GenTable referencedTable) {
- super();
- this.baseTable = baseTable;
- this.foreignKey = foreignKey;
- this.referencedTable = referencedTable;
- referencedTable.addOneToManyRelation(new OneToManyRelation(this));
- }
-
- GenTable getBaseTable() {
- return this.baseTable;
- }
-
- ForeignKey getForeignKey() {
- return this.foreignKey;
- }
-
- GenTable getReferencedTable() {
- return this.referencedTable;
- }
-
- String javaFieldName() {
- return this.foreignKey.javaFieldName();
- }
-
- String getMappedBy() {
- return this.mappedBy;
- }
-
- void setMappedBy(String mappedBy) {
- this.mappedBy = mappedBy;
- }
-
- String baseEntityName() {
- return this.baseTable.getEntityName();
- }
-
- String referencedEntityName() {
- return this.referencedTable.getEntityName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java
deleted file mode 100644
index 4656d00c12..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OneToManyRelation.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.gen.internal;
-
-class OneToManyRelation {
- private final ManyToOneRelation manyToOneRelation;
-
- OneToManyRelation(ManyToOneRelation manyToOneRelation) {
- super();
- this.manyToOneRelation = manyToOneRelation;
- }
-
- ManyToOneRelation getManyToOneRelation() {
- return this.manyToOneRelation;
- }
-
- String javaFieldName() {
- // TODO i18n?
- return this.manyToOneRelation.getBaseTable().javaFieldName() + "_collection";
- }
-
- String mappedBy() {
- return this.manyToOneRelation.getMappedBy();
- }
-
- String referencedEntityName() {
- return this.manyToOneRelation.baseEntityName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java
deleted file mode 100644
index bce0da3063..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.gen.internal;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.gen.internal.EntityGenerator.OverwriteConfirmer;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * This generator will generate a package of entities for a set of tables.
- */
-public class PackageGenerator {
- private final Config config;
- private final EntityGenerator.Config entityConfig;
- private final GenScope scope;
- private final OverwriteConfirmer overwriteConfirmer;
- private final IProgressMonitor monitor;
-
-
- // ********** public API **********
-
- public static void generateEntities(Config config, EntityGenerator.Config entityConfig, Collection<Table> tables, OverwriteConfirmer overwriteConfirmer, IProgressMonitor monitor) {
- if ((config == null) || (entityConfig == null) || (tables == null)) {
- throw new NullPointerException();
- }
- new PackageGenerator(config, entityConfig, tables, overwriteConfirmer, monitor).generateEntities();
- }
-
-
- // ********** construction/initialization **********
-
- private PackageGenerator(Config config, EntityGenerator.Config entityConfig, Collection<Table> tables, OverwriteConfirmer overwriteConfirmer, IProgressMonitor monitor) {
- super();
- this.config = config;
- this.entityConfig = entityConfig;
- this.scope = new GenScope(tables, entityConfig, monitor);
- this.overwriteConfirmer = overwriteConfirmer;
- this.monitor = monitor;
- }
-
-
- // ********** generation **********
-
- private void generateEntities() {
- int size = CollectionTools.size(this.scope.entityTables());
- for (Iterator<GenTable> stream = this.scope.entityTables(); stream.hasNext(); ) {
- checkCanceled();
- this.buildEntity(stream.next());
- this.monitor.worked(50/size);
- }
- }
-
- private void checkCanceled() {
- if (this.monitor.isCanceled()) {
- throw new OperationCanceledException();
- }
- }
-
-
- private void buildEntity(GenTable genTable) {
- EntityGenerator.generateEntity(this.entityConfig, this.config.getPackageFragment(), genTable, overwriteConfirmer, this.monitor);
- }
-
-
- // ********** config **********
-
- public static class Config {
- private IPackageFragment packageFragment;
-
- public IPackageFragment getPackageFragment() {
- return this.packageFragment;
- }
- public void setPackageFragment(IPackageFragment packageFragment) {
- this.packageFragment = packageFragment;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/.classpath b/jpa/plugins/org.eclipse.jpt.ui/.classpath
deleted file mode 100644
index 5ee7c76127..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.ui/.cvsignore b/jpa/plugins/org.eclipse.jpt.ui/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/plugins/org.eclipse.jpt.ui/.project b/jpa/plugins/org.eclipse.jpt.ui/.project
deleted file mode 100644
index 50ef9e3305..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 8f3899b660..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:11:25 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d909c105d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:55:01 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 4ed5329386..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,58 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.ui;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.jpt.ui.internal.JptUiPlugin
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.draw2d,
- org.eclipse.emf.edit.ui,
- org.eclipse.jdt.core,
- org.eclipse.jdt.ui,
- org.eclipse.jem,
- org.eclipse.jface.text,
- org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.db.ui,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.utility,
- org.eclipse.jst.j2ee.ui,
- org.eclipse.ui.ide,
- org.eclipse.ui.views.properties.tabbed,
- org.eclipse.ui.workbench.texteditor,
- org.eclipse.wst.common.frameworks,
- org.eclipse.wst.common.frameworks.ui,
- org.eclipse.wst.common.modulecore,
- org.eclipse.wst.common.project.facet.core,
- org.eclipse.wst.common.project.facet.ui,
- org.eclipse.wst.sse.ui,
- org.eclipse.wst.web.ui
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.jpt.ui.internal; x-internal:=true,
- org.eclipse.jpt.ui.internal.actions; x-internal:=true,
- org.eclipse.jpt.ui.internal.details; x-internal:=true,
- org.eclipse.jpt.ui.internal.dialogs; x-internal:=true,
- org.eclipse.jpt.ui.internal.generic; x-internal:=true,
- org.eclipse.jpt.ui.internal.java.details; x-internal:=true,
- org.eclipse.jpt.ui.internal.java.mappings.properties; x-internal:=true,
- org.eclipse.jpt.ui.internal.java.structure; x-internal:=true,
- org.eclipse.jpt.ui.internal.jface; x-internal:=true,
- org.eclipse.jpt.ui.internal.mappings; x-internal:=true,
- org.eclipse.jpt.ui.internal.mappings.details; x-internal:=true,
- org.eclipse.jpt.ui.internal.perspective; x-internal:=true,
- org.eclipse.jpt.ui.internal.prefs; x-internal:=true,
- org.eclipse.jpt.ui.internal.properties; x-internal:=true,
- org.eclipse.jpt.ui.internal.selection; x-internal:=true,
- org.eclipse.jpt.ui.internal.structure; x-internal:=true,
- org.eclipse.jpt.ui.internal.util; x-internal:=true,
- org.eclipse.jpt.ui.internal.views; x-internal:=true,
- org.eclipse.jpt.ui.internal.widgets; x-internal:=true,
- org.eclipse.jpt.ui.internal.wizards; x-internal:=true,
- org.eclipse.jpt.ui.internal.xml; x-internal:=true,
- org.eclipse.jpt.ui.internal.xml.details; x-internal:=true,
- org.eclipse.jpt.ui.internal.xml.structure; x-internal:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/jpa/plugins/org.eclipse.jpt.ui/about.html b/jpa/plugins/org.eclipse.jpt.ui/about.html
deleted file mode 100644
index 9e73bdabb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>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
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>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
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.ui/build.properties b/jpa/plugins/org.eclipse.jpt.ui/build.properties
deleted file mode 100644
index b1a1c37afa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 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
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.ui/component.xml b/jpa/plugins/org.eclipse.jpt.ui/component.xml
deleted file mode 100644
index 36827b6240..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.ui"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.ui" fragment="false"/></component> \ No newline at end of file
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
deleted file mode 100644
index 633768f35d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/dtool16/new_jpaproject_wiz.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index c0ab917511..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/jpa_facet.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 12da8074ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/etool16/new_jpaproject_wiz.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 3280138b67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_details.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index c0ab917511..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_perspective.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 682c90a589..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/eview16/jpa_structure.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index a547d743e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/basic.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 8856f78874..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embeddable.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index c1c8e210e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded-id.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index c2ae66497a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/embedded.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index c349c962e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity-mappings.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index d606f482e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/entity.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index a205ec38ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/id.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 48885b21fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-many.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 2e1e2b9387..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/many-to-one.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 8cc37645c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/mapped-superclass.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 70a9c23541..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-attribute-mapping.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 6279478c51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/null-type-mapping.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 1e90027861..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-many.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 578ec36aa3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/one-to-one.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 9cc45f6945..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence-unit.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index d1f616d64f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/persistence.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index cc5d83db20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/transient.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 202a8104f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/version.gif
+++ /dev/null
Binary files 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
deleted file mode 100644
index 8ce181f606..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/wizban/jpa_facet_wizban.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.ui/plugin.properties
deleted file mode 100644
index be47f4053a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/plugin.properties
+++ /dev/null
@@ -1,50 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 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= Java Persistence API Tools - UI
-providerName=Eclipse.org
-
-JPA_PLATFORM="JPA Platform UI"
-
-
-jpaWizardCategoryName = JPA
-newJpaProjectWizardName = JPA Project
-newJpaProjectWizardDesc = Create a JPA project
-
-jpaMenuName = JPA Tools
-generateEntities = Generate Entities...
-generateDDL = Generate DDL...
-synchronizeClasses = Synchronize Classes
-addPersistentClass = Add persistent class ...
-removePersistentClass = Remove persistent class
-addPersistentAttributeToXml = Add persistent attribute to XML
-addPersistentAttributeToXmlAndMap = Add persistent attribute to XML ...
-removePersistentAttributeFromXml = Remove persistent attribute from XML
-
-jpaPreferencePage = JPA
-
-jpaProjectPropertiesPage = JPA
-
-jpaPerspective = JPA Development
-jpaDetails = JPA Details
-jpaStructure = JPA Structure
-
-JpaProposalCategory = JPA Proposals
diff --git a/jpa/plugins/org.eclipse.jpt.ui/plugin.xml b/jpa/plugins/org.eclipse.jpt.ui/plugin.xml
deleted file mode 100644
index 12561ff32a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/plugin.xml
+++ /dev/null
@@ -1,314 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
- <extension-point
- id="jpaPlatform"
- name="%JPA_PLATFORM"
- schema="schema/jpaPlatform.exsd"/>
-
-
- <extension
- point="org.eclipse.core.runtime.adapters">
-
- <factory
- adaptableType="org.eclipse.ui.IWorkbenchPart"
- class="org.eclipse.jpt.ui.internal.selection.SelectionParticipantFactory">
- <adapter type="org.eclipse.jpt.ui.internal.selection.ISelectionParticipant"/>
- </factory>
-
- <factory
- adaptableType="org.eclipse.jpt.core.internal.IPersistentAttribute"
- class="org.eclipse.jpt.ui.internal.actions.PersistentAttributeActionFilter$Factory">
- <adapter
- type="org.eclipse.ui.IActionFilter"/>
- </factory>
-
- <factory
- adaptableType="org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute"
- class="org.eclipse.jpt.ui.internal.actions.XmlPersistentAttributeActionFilter$Factory">
- <adapter
- type="org.eclipse.ui.IActionFilter"/>
- </factory>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.ui.jpaPlatform">
-
- <jpaPlatform
- id="generic"
- class="org.eclipse.jpt.ui.internal.generic.GenericPlatformUi"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.newWizards">
-
- <category
- id="org.eclipse.jpt"
- name="%jpaWizardCategoryName"/>
-
- <wizard
- id="org.eclipse.jpt.jpaProject"
- name="%newJpaProjectWizardName"
- icon="icons/full/etool16/new_jpaproject_wiz.gif"
- category="org.eclipse.jpt"
- class="org.eclipse.jpt.ui.internal.wizards.NewJpaProjectWizard"
- project="true"
- finalPerspective="org.eclipse.jpt.ui.jpaPerspective">
- <description>%newJpaProjectWizardDesc</description>
- </wizard>
-
- </extension>
-
- <extension
- point="org.eclipse.ui.popupMenus">
-
- <objectContribution
- id="org.eclipse.jpt.ui.project.JPATools"
- objectClass="org.eclipse.core.resources.IProject"
- adaptable="true">
- <menu
- id="org.eclipse.jpt.ui.project.JPATools"
- label="%jpaMenuName"/>
-
- <enablement>
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa"/>
- </enablement>
-
- <action
- class="org.eclipse.jpt.ui.internal.actions.GenerateEntitiesAction"
- id="org.eclipse.jpt.ui.generateEntities"
- label="%generateEntities"
- menubarPath="org.eclipse.jpt.ui.project.JPATools/content"/>
-
- </objectContribution>
-
- <objectContribution
- id="org.eclipse.jpt.ui.project.JPATools"
- objectClass="org.eclipse.core.resources.IProject"
- adaptable="true">
- <menu
- id="org.eclipse.jpt.ui.project.JPATools"
- label="%jpaMenuName"/>
-
- <enablement>
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa"/>
- </enablement>
-
- <action
- class="org.eclipse.jpt.ui.internal.actions.GenerateDDLAction"
- id="org.eclipse.jpt.ui.generateDDL"
- label="%generateDDL"
- menubarPath="org.eclipse.jpt.ui.project.JPATools/content"/>
-
- </objectContribution>
-
- <objectContribution
- id="org.eclipse.jpt.ui.persistenceXmlActions"
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="persistence.xml">
- <menu
- id="persistenceXmlJPATools"
- label="%jpaMenuName"/>
- <action
- id="synchClassesAction"
- label="%synchronizeClasses"
- menubarPath="persistenceXmlJPATools/content"
- class="org.eclipse.jpt.ui.internal.actions.SynchronizeClassesAction"
- enablesFor="1"/>
- </objectContribution>
-
- <objectContribution
- id="org.eclipse.jpt.ui.entityMappingsActions"
- objectClass="org.eclipse.jpt.core.internal.content.orm.EntityMappings">
- <action
- id="org.eclipse.jpt.ui.addPersistentClass"
- class="org.eclipse.jpt.ui.internal.actions.AddPersistentClassAction"
- label="%addPersistentClass"
- menubarPath="additions"/>
- </objectContribution>
-
- <objectContribution
- id="org.eclipse.jpt.ui.xmlPersistentTypeActions"
- objectClass="org.eclipse.jpt.core.internal.content.orm.XmlPersistentType">
- <action
- id="org.eclipse.jpt.ui.removePersistentClass"
- class="org.eclipse.jpt.ui.internal.actions.RemovePersistentClassAction"
- label="%removePersistentClass"
- menubarPath="additions"/>
- </objectContribution>
- <objectContribution
- id="org.eclipse.jpt.ui.xmlPersistentAttributeActions1"
- objectClass="org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute">
-
- <action
- id="org.eclipse.jpt.ui.addPersistentAttributeToXml"
- class="org.eclipse.jpt.ui.internal.actions.AddPersistentAttributeToXmlAction"
- label="%addPersistentAttributeToXml"
- menubarPath="additions"/>
- <visibility>
- <and>
- <objectState
- name="isVirtual"
- value="true"/>
- <objectState
- name="isMapped"
- value="true"/>
- </and>
- </visibility>
-
- </objectContribution>
-
- <objectContribution
- id="org.eclipse.jpt.ui.xmlPersistentAttributeActions2"
- objectClass="org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute">
-
- <action
- id="org.eclipse.jpt.ui.addPersistentAttributeToXmlAndMap"
- class="org.eclipse.jpt.ui.internal.actions.AddPersistentAttributeToXmlAndMapAction"
- label="%addPersistentAttributeToXmlAndMap"
- enablesFor="1"
- menubarPath="additions"/>
- <visibility>
- <and>
- <objectState
- name="isVirtual"
- value="true"/>
- <objectState
- name="isMapped"
- value="false"/>
- </and>
- </visibility>
-
- </objectContribution>
-
- <objectContribution
- id="org.eclipse.jpt.ui.xmlPersistentAttributeActions3"
- objectClass="org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute">
-
- <action
- id="org.eclipse.jpt.ui.removePersistentAttributeFromXml"
- class="org.eclipse.jpt.ui.internal.actions.RemovePersistentAttributeFromXmlAction"
- label="%removePersistentAttributeFromXml"
- menubarPath="additions"/>
- <visibility>
- <objectState
- name="isVirtual"
- value="false"/>
- </visibility>
-
- </objectContribution>
-
-
-
- </extension>
-
- <extension
- point="org.eclipse.ui.preferencePages">
-
- <page
- id="org.eclipse.jpt.ui.jpaPreferencePage"
- name="%jpaPreferencePage"
- class="org.eclipse.jpt.ui.internal.prefs.JpaPreferencePage"/>
-
- </extension>
-
- <extension
- point="org.eclipse.ui.propertyPages">
-
- <page
- id="org.eclipse.jpt.ui.jpaProjectPropertiesPage"
- name="%jpaProjectPropertiesPage"
- class="org.eclipse.jpt.ui.internal.properties.JpaProjectPropertiesPage">
- <enabledWhen>
- <adapt
- type="org.eclipse.core.resources.IProject">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"/>
- </adapt>
- </enabledWhen>
- </page>
- </extension>
-
- <extension
- point="org.eclipse.ui.views">
-
- <category
- id="org.eclipse.jpt.ui"
- name="%jpaPerspective"/>
-
- <view
- category="org.eclipse.jpt.ui"
- class="org.eclipse.jpt.ui.internal.views.JpaStructureView"
- icon="icons/full/eview16/jpa_structure.gif"
- id="org.eclipse.jpt.ui.jpaStructureView"
- name="%jpaStructure"/>
-
- <view
- category="org.eclipse.jpt.ui"
- class="org.eclipse.jpt.ui.internal.views.JpaDetailsView"
- icon="icons/full/eview16/jpa_details.gif"
- id="org.eclipse.jpt.ui.jpaDetailsView"
- name="%jpaDetails"/>
-
- </extension>
-
-<!-- =================================================================================== -->
-<!-- Extension: Persistence Perspective -->
-<!-- =================================================================================== -->
-
- <extension
- point="org.eclipse.ui.perspectives">
- <perspective
- class="org.eclipse.jpt.ui.internal.perspective.JpaPerspectiveFactory"
- icon="icons/full/eview16/jpa_perspective.gif"
- id="org.eclipse.jpt.ui.jpaPerspective"
- name="%jpaPerspective"/>
- </extension>
-
- <extension
- point="org.eclipse.wst.common.project.facet.ui.images">
-
- <image facet="jpt.jpa" path="icons/full/etool16/jpa_facet.gif"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.ui.wizardPages">
-
- <wizard-pages action="jpt.jpa.install">
- <page class="org.eclipse.jpt.ui.internal.wizards.JpaFacetWizardPage"/>
- </wizard-pages>
-
- </extension>
-
-<!-- =================================================================================== -->
-<!-- Extension: Java Completion Proposal Computer -->
-<!-- =================================================================================== -->
-
- <extension
- point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
- id="JpaCompletionProposalComputer">
- <javaCompletionProposalComputer
- class="org.eclipse.jpt.ui.internal.JpaCompletionProposalComputer"
- categoryId="org.eclipse.jpt.ui.jpaProposalCategory">
- <partition type="__dftl_partition_content_type"/>
- <partition type="__java_string"/>
- </javaCompletionProposalComputer>
- </extension>
-
- <extension
- point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
- id="jpaProposalCategory"
- name="%JpaProposalCategory">
- <proposalCategory
- icon="$nl$/icons/full/eview16/jpa_perspective.gif"/>
- </extension>
-
-</plugin>
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
deleted file mode 100644
index 1ff880ba95..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties
+++ /dev/null
@@ -1,79 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 Oracle. - initial API and implementation
-###############################################################################
-
-AddPersistentAttributeDialog_title=Add Persistent Attribute
-AddPersistentAttributeDialog_attributeLabel=Attribute:
-AddPersistentAttributeDialog_mappingLabel=Map as:
-AddPersistentAttributeDialog_noMappingKeyError=You must specify a mapping type
-
-AddPersistentClassDialog_title=Add Persistent 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
-
-DatabaseReconnectWizardPage_database=Database Settings
-DatabaseReconnectWizardPage_databaseConnection=Database Connection
-DatabaseReconnectWizardPage_reconnectToDatabase=Reconnect to the database.
-DatabaseReconnectWizardPage_connection=Connection:
-DatabaseReconnectWizardPage_schema=Schema:
-DatabaseReconnectWizardPage_schemaInfo=(Note: Must have active connection to select schema)
-DatabaseReconnectWizardPage_addConnectionLink=<a>Add connections...</a>
-DatabaseReconnectWizardPage_reconnectLink=<a>Reconnect...</a>
-
-General_browse=Browse...
-General_deselectAll=Deselect All
-General_selectAll=Select All
-
-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
-
-GenericPlatformUiDialog_notSupportedMessageTitle=DDL Generation
-GenericPlatformUiDialog_notSupportedMessageText=DDL Generation is not supported by the Generic Platform.
-
-JpaPreferencePage_defaultJpaLib=Default JPA implementation library:
-JpaPreferencePage_userLibsLink=<a>Configure user libraries ...</a>
-JpaPreferencePage_invalidJpaLib=Invalid Library: Must contain javax.persistence classes.
-
-JpaStructureView_viewNotAvailable=Structure is not available for the current selection.
-JpaStructureView_linkWithEditorText=Link with Editor
-JpaStructureView_linkWithEditorDesc=Link with Active Editor
-JpaStructureView_linkWithEditorTooltip=Link with Editor
-
-JpaDetailsView_viewNotAvailable=Details are not available for the current selection.
-
-NewJpaProjectWizard_title=New JPA Project
-NewJpaProjectWizard_firstPage_title=JPA Project
-NewJpaProjectWizard_firstPage_description=Configure JPA project settings.
-
-JpaFacetWizardPage_title=JPA Facet
-JpaFacetWizardPage_description=Configure JPA settings.
-JpaFacetWizardPage_platformLabel=Platform
-JpaFacetWizardPage_connectionLabel=Connection
-JpaFacetWizardPage_connectionLink=<a>Add connection ...</a>
-JpaFacetWizardPage_jpaImplementationLabel=JPA implementation
-JpaFacetWizardPage_userServerLibLabel=Use implementation provided by server runtime
-JpaFacetWizardPage_specifyLibLabel=Use implementation library:
-JpaFacetWizardPage_jpaPrefsLink=<a>Configure default JPA implementation library ...</a>
-JpaFacetWizardPage_userLibsLink=<a>Configure user libraries ...</a>
-JpaFacetWizardPage_persistentClassManagementLabel=Persistent class management
-JpaFacetWizardPage_discoverClassesButton=Discover annotated classes automatically
-JpaFacetWizardPage_listClassesButton=Annotated classes must be listed in persistence.xml
-JpaFacetWizardPage_createOrmXmlButton=Create orm.xml
-
-PersistentAttributePage_mapAs=Map As:
-
-PersistentTypePage_mapAs=Map As:
-
-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_mappings.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_mappings.properties
deleted file mode 100644
index d8d63ae59e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_mappings.properties
+++ /dev/null
@@ -1,185 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 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
-###############################################################################
-
-PersistentTypePage_EntityLabel=Entity
-PersistentTypePage_EmbeddableLabel=Embeddable
-PersistentTypePage_MappedSuperclassLabel=Mapped Superclass
-
-PersistentAttributePage_BasicLabel=Basic
-PersistentAttributePage_IdLabel=Id
-PersistentAttributePage_OneToManyLabel=One to Many
-PersistentAttributePage_ManyToOneLabel=Many to One
-PersistentAttributePage_ManyToManyLabel=Many to Many
-PersistentAttributePage_TransientLabel=Transient
-PersistentAttributePage_VersionLabel=Version
-PersistentAttributePage_EmbeddedLabel=Embedded
-PersistentAttributePage_EmbeddedIdLabel=Embedded Id
-PersistentAttributePage_OneToOneLabel=One to One
-
-EntityComposite_tableDefault=Default ({0})
-EntityComposite_tableNoDefaultSpecified=Default ()
-EntityComposite_inheritance=Inheritance
-
-EntityGeneralSection_nameDefaultWithOneParam=Default ({0})
-EntityGeneralSection_nameDefaultEmpty=Default ()
-EntityGeneralSection_name=Name:
-
-BasicGeneralSection_name=Name:
-BasicGeneralSection_nameDefault=Default ({0})
-BasicGeneralSection_fetchLabel=Fetch:
-BasicGeneralSection_optionalLabel=Optional:
-BasicGeneralSection_lobLabel=Lob
-BasicGeneralSection_temporalLabel=Temporal:
-BasicGeneralSection_enumeratedLabel=Enumerated:
-
-TableChooser_label=Name:
-CatalogChooser_label=Catalog:
-SchemaChooser_label=Schema:
-TableComposite_tableSection=Table:
-TableComposite_defaultEmpty=Default ()
-TableComposite_defaultWithOneParam=Default ({0})
-
-ColumnChooser_label=Name:
-ColumnTableChooser_label=Table:
-
-TargetEntityChooser_label=Target Entity:
-TargetEntityChooser_defaultEmpty=Default ()
-TargetEntityChooser_defaultWithOneParam=Default ({0})
-TargetEntityChooser_browse=Browse...
-
-NonOwningMapping_mappedByLabel=Mapped By:
-
-JoinTableComposite_add=Add...
-JoinTableComposite_defaultEmpty=Default()
-JoinTableComposite_defaultWithOneParam=Default ({0})
-JoinTableComposite_edit=Edit...
-JoinTableComposite_inverseJoinColumn=Inverse Join Columns
-
-JoinTableComposite_mappingBetweenTwoParamsDefault=Default ({0} -> {1})
-JoinTableComposite_mappingBetweenTwoParamsFirstDefault=Default ({0}) -> {1}
-JoinTableComposite_mappingBetweenTwoParamsSecDefault={0} -> Default ({1})
-JoinTableComposite_mappingBetweenTwoParamsBothDefault=Default ({0}) -> Default ({1})
-JoinTableComposite_mappingBetweenTwoParams={0} -> {1}
-JoinTableComposite_joinColumn=Join Columns
-JoinTableComposite_name=Name:
-JoinTableComposite_remove=Remove
-JoinTableComposite_overrideDefaultJoinColumns=Override Default
-JoinTableComposite_overrideDefaultInverseJoinColumns=Override Default
-
-InverseJoinColumnDialog_editInverseJoinColumn=Edit Inverse Join Column
-InverseJoinColumnDialog_defaultWithOneParam=Default ({0})
-
-JoinColumnDialog_addJoinColumn=Add Join Column
-JoinColumnDialog_editJoinColumn=Edit Join Column
-JoinColumnDialog_name=Name:
-JoinColumnDialog_referencedColumnName=Referenced Column Name:
-JoinColumnDialog_defaultWithOneParam=Default ({0})
-JoinColumnDialog_insertable=Insertable:
-JoinColumnDialog_updatable=Updatable:
-JoinColumnDialog_table=Table:
-
-MultiRelationshipMappingComposite_general=General
-MultiRelationshipMappingComposite_joinTable=Join Table
-MultiRelationshipMappingComposite_targetEntity=Target Entity:
-MultiRelationshipMappingComposite_cascadeType=Cascade Type:
-MultiRelationshipMappingComposite_fetchType=Fetch Type:
-MultiRelationshipMappingComposite_mappedBy=Mapped By:
-
-ColumnComposite_columnSection=Column:
-ColumnComposite_defaultWithOneParam=Default ({0})
-ColumnComposite_defaultEmpty=Default ()
-ColumnComposite_insertable=Insertable:
-ColumnComposite_updatable=Updatable:
-
-JoinColumnComposite_joinColumn=Join Columns
-JoinColumnComposite_defaultEmpty=Default()
-JoinColumnComposite_name=Name:
-JoinColumnComposite_defaultWithOneParam=Default ({0})
-JoinColumnComposite_add=Add...
-JoinColumnComposite_edit=Edit...
-JoinColumnComposite_mappingBetweenTwoParams={0} -> {1}
-JoinColumnComposite_mappingBetweenTwoParamsDefault=Default ({0} -> {1})
-JoinColumnComposite_mappingBetweenTwoParamsBothDefault=Default ({0}) -> Default ({1})
-JoinColumnComposite_mappingBetweenTwoParamsFirstDefault=Default ({0}) -> {1}
-JoinColumnComposite_mappingBetweenTwoParamsSecDefault={0} -> Default ({1})
-JoinColumnComposite_remove=Remove
-JoinColumnComposite_overrideDefaultJoinColumns=Override Default
-
-PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns=Override Default
-PrimaryKeyJoinColumnsComposite_add=Add...
-PrimaryKeyJoinColumnsComposite_edit=Edit...
-PrimaryKeyJoinColumnsComposite_remove=Remove
-PrimaryKeyJoinColumnsComposite_defaultEmpty=Default()
-PrimaryKeyJoinColumnsComposite_defaultWithOneParam=Default ({0})
-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})
-
-AttributeOverridesComposite_attributeOverrides=Attribute Overrides
-AttributeOverridesComposite_overridDefault=Override Default
-OverridesComposite_joinColumn=Join Columns
-InheritanceComposite_default=Default ({0})
-InheritanceComposite_strategy=Strategy:
-InheritanceComposite_discriminatorValue=Discriminator Value:
-InheritanceComposite_discriminatorValueDefaultWithOneParam=Default ({0})
-
-DiscriminatorColumnComposite_column=Discriminator Column:
-DiscriminatorColumnComposite_discriminatorType=Discriminator Type:
-DiscriminatorColumnComposite_defaultEmpty=Default(<provider-specific>)
-
-IdMappingComposite_pk_generation=PK Generation
-IdMappingComposite_primaryKeyGeneration=Primary Key Generation
-IdMappingComposite_tableGenerator=Table Generator
-IdMappingComposite_sequenceGenerator=Sequence Generator
-
-GeneratedValueComposite_generatedValue=Generated Value
-GeneratedValueComposite_generatorName=Generator Name:
-GeneratedValueComposite_strategy=Strategy:
-
-SequenceGeneratorComposite_sequenceGenerator=Sequence Generator
-SequenceGeneratorComposite_name=Name:
-SequenceGeneratorComposite_sequence=Sequence:
-SequenceGeneratorComposite_default=Default
-
-TableGeneratorComposite_name=Name:
-TableGeneratorComposite_table=Table:
-TableGeneratorComposite_tableGenerator=Table Generator
-TableGeneratorComposite_pkColumn=Primary Key Column:
-TableGeneratorComposite_valueColumn=Value Column:
-TableGeneratorComposite_pkColumnValue=Primary Key Column Value:
-TableGeneratorComposite_default=Default
-
-OrderByComposite_orderByGroup=Order By
-OrderByComposite_orderByLabel=Order By:
-OrderByComposite_noOrdering=No Ordering
-OrderByComposite_primaryKeyOrdering=Primary Key Ordering
-OrderByComposite_customOrdering=Custom Ordering
-
-SecondaryTablesComposite_secondaryTables=Secondary Tables
-SecondaryTablesComposite_add=Add...
-SecondaryTablesComposite_edit=Edit...
-SecondaryTablesComposite_remove=Remove
-
-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
-EnumComboViewer_default=Default ({0})
-MetaDataCompleteCombo_Default=Default ({0})
-JoinColumnDialog_defaultTrue=Default ({0})
-InheritanceComposite_defaultDiscriminatorType=Default ({0})
-GeneratedValueComposite_default=Default ({0})
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_xml.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_xml.properties
deleted file mode 100644
index f581ea4e89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_xml.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 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
-###############################################################################
-
-PersistentTypePage_javaClassLabel=Java Class:
-PersistentTypePage_MetadataCompleteLabel=Metadata Complete:
-PersistentTypePage_AccessLabel=Access:
-
-PersistenceUnitMetadataSection_SchemaDefault=Default
-PersistenceUnitMetadataSection_CatalogDefault=Default
-
-PersistentAttributePage_javaAttributeLabel=Java Attribute:
-
-XMLEntityMappingsPage_XmlMappingMetadataCompleteCheckBox=XML Mapping Metadata Complete
-XMLEntityMappingsPage_CascadePersistCheckBox=Cascade Persist
-XMLEntityMappingsPage_PersistenceUnitSection=Persistence Unit
-XMLEntityMappingsPage_SchemaDefault=Default ({0})
-XMLEntityMappingsPage_SchemaNoDefaultSpecified=Default
-XMLEntityMappingsPage_CatalogDefault=Default ({0})
-XMLEntityMappingsPage_CatalogNoDefaultSpecified=Default
-
-XmlSchemaChooser_SchemaChooser=Schema:
-XmlCatalogChooser_CatalogChooser=Catalog:
-
-XmlJavaClassChooser_XmlJavaClassDialog_title=Class Selection
-XmlJavaClassChooser_XmlJavaClassDialog_message=Choose a type:
-
-XmlPackageChooser_PackageDialog_title=Package Selection
-XmlPackageChooser_PackageDialog_message=Choose a folder:
-
diff --git a/jpa/plugins/org.eclipse.jpt.ui/schema/jpaPlatform.exsd b/jpa/plugins/org.eclipse.jpt.ui/schema/jpaPlatform.exsd
deleted file mode 100644
index 92d1085e5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/schema/jpaPlatform.exsd
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jpt.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jpt.ui" id="jpaVendor" name="JPA UI Vendor"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="jpaPlatform" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="jpaPlatform">
- <annotation>
- <documentation>
- Extend this extension point and you must also extend the org.eclipse.jpt.core.jpaPlatform
- extension point. The ids must match. One jpaPlatform will be chosen per JpaProject. The
- possible jpaPlatforms will be displayed to the user as a project property.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The id must match the corresponding org.eclipse.jpt.core.jpaVendor extension id.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jpt.ui.internal.IJpaPlatformUI"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/BaseJpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/BaseJpaPlatformUi.java
deleted file mode 100644
index c53e5d88da..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/BaseJpaPlatformUi.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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 org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.ui.internal.details.IJpaDetailsProvider;
-import org.eclipse.jpt.ui.internal.generic.EntitiesGenerator;
-import org.eclipse.jpt.ui.internal.java.details.JavaDetailsProvider;
-import org.eclipse.jpt.ui.internal.java.structure.JavaStructureProvider;
-import org.eclipse.jpt.ui.internal.structure.IJpaStructureProvider;
-import org.eclipse.jpt.ui.internal.xml.details.XmlDetailsProvider;
-import org.eclipse.jpt.ui.internal.xml.structure.XmlStructureProvider;
-
-public abstract class BaseJpaPlatformUi implements IJpaPlatformUi
-{
- private Collection<IJpaDetailsProvider> detailsProviders;
- private Collection<IJpaStructureProvider> structureProviders;
-
- protected BaseJpaPlatformUi() {
- super();
- }
-
- // ********** behavior **********
-
- public Collection<IJpaDetailsProvider> detailsProviders() {
- if (this.detailsProviders == null) {
- this.detailsProviders = this.buildJpaDetailsProvider();
- }
- return this.detailsProviders;
- }
-
- protected Collection<IJpaDetailsProvider> buildJpaDetailsProvider() {
- Collection<IJpaDetailsProvider> detailsProviders = new ArrayList<IJpaDetailsProvider>();
- detailsProviders.add(new JavaDetailsProvider());
- detailsProviders.add(new XmlDetailsProvider());
- return detailsProviders;
- }
-
- public Collection<IJpaStructureProvider> structureProviders() {
- if (this.structureProviders == null) {
- this.structureProviders = this.buildJpaStructureProvider();
- }
- return this.structureProviders;
- }
-
- protected Collection<IJpaStructureProvider> buildJpaStructureProvider() {
- Collection<IJpaStructureProvider> structureProviders = new ArrayList<IJpaStructureProvider>();
- structureProviders.add(new JavaStructureProvider());
- structureProviders.add(new XmlStructureProvider());
- return structureProviders;
- }
-
- public void generateEntities(IJpaProject project, IStructuredSelection selection) {
-
- EntitiesGenerator.generate(project, selection);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaHelpContextIds.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaHelpContextIds.java
deleted file mode 100644
index c7fe124c76..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaHelpContextIds.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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;
-
-
-/**
- * Help context ids for the Dali JPA UI.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- *
- */
-public interface IJpaHelpContextIds {
-
-
- //ContextID prefix
- public static final String PREFIX = JptUiPlugin.PLUGIN_ID + "."; //$NON-NLS-1$
-
- //Persistent Type composites
- public static final String ENTITY_ACCESS_TYPE = PREFIX + "entity_accessType"; //$NON-NLS-1$
- public static final String ENTITY_ATTRIBUTE_OVERRIDES = PREFIX + "entity_attributeOverrides"; //$NON-NLS-1$
- public static final String ENTITY_ATTRIBUTE_OVERRIDES_COLUMN = PREFIX + "entity_attributeOverridesColumn"; //$NON-NLS-1$
- public static final String ENTITY_CATALOG = PREFIX + "entity_catalog"; //$NON-NLS-1$
- public static final String ENTITY_INHERITANCE_STRATEGY = PREFIX + "entity_inheritanceStrategy"; //$NON-NLS-1$
- public static final String ENTITY_INHERITANCE_DISCRIMINATOR_TYPE = PREFIX + "entity_inheritanceDiscriminatorType"; //$NON-NLS-1$
- public static final String ENTITY_INHERITANCE_DISCRIMINATOR_COLUMN = PREFIX + "entity_inheritanceDiscriminatorColumn"; //$NON-NLS-1$
- public static final String ENTITY_INHERITANCE_DISCRIMINATOR_VALUE = PREFIX + "entity_inheritanceDiscriminatorValue"; //$NON-NLS-1$
- public static final String ENTITY_NAME = PREFIX + "entity_name"; //$NON-NLS-1$
- public static final String ENTITY_ORM_PACKAGE = PREFIX + "orm_package"; //$NON-NLS-1$
- public static final String ENTITY_ORM_SCHEMA = PREFIX + "orm_schema"; //$NON-NLS-1$
- public static final String ENTITY_ORM_CATALOG = PREFIX + "orm_catalog"; //$NON-NLS-1$
- public static final String ENTITY_ORM_ACCESS = PREFIX + "orm_access"; //$NON-NLS-1$
- public static final String ENTITY_ORM_CASCADE = PREFIX + "orm_cascade"; //$NON-NLS-1$
- public static final String ENTITY_ORM_XML = PREFIX + "orm_xml"; //$NON-NLS-1$
- public static final String ENTITY_SCHEMA = PREFIX + "entity_schema"; //$NON-NLS-1$
- public static final String ENTITY_TABLE = PREFIX + "entity_table"; //$NON-NLS-1$
-
-
- //Persistent Attribute composites
- public static final String MAPPING_CASCADE_TYPE = PREFIX + "mapping_cascadeType"; //$NON-NLS-1$
- public static final String MAPPING_COLUMN = PREFIX + "mapping_column"; //$NON-NLS-1$
- public static final String MAPPING_COLUMN_INSERTABLE = PREFIX + "mapping_columnInsertable"; //$NON-NLS-1$
- public static final String MAPPING_COLUMN_TABLE = PREFIX + "mapping_columnTable"; //$NON-NLS-1$
- public static final String MAPPING_COLUMN_UPDATABLE= PREFIX + "mapping_columnUpdatable"; //$NON-NLS-1$
- public static final String MAPPING_EMBEDDED_ATTRIBUTE_OVERRIDES = PREFIX + "mapping_embeddedAttributeOverrides";//$NON-NLS-1$
- public static final String MAPPING_EMBEDDED_ATTRIBUTE_OVERRIDES_COLUMN = PREFIX + "mapping_embeddedAttributeOverridesColumn";//$NON-NLS-1$
- public static final String MAPPING_ENUMERATED = PREFIX + "mapping_enumerated"; //$NON-NLS-1$
- public static final String MAPPING_FETCH_TYPE = PREFIX + "mapping_fetchType"; //$NON-NLS-1$
- public static final String MAPPING_GENERATED_VALUE_STRATEGY = PREFIX + "mapping_generatedValueStrategy"; //$NON-NLS-1$
- public static final String MAPPING_GENERATED_VALUE_GENERATOR_NAME = PREFIX + "mapping_generatedValueGeneratorName"; //$NON-NLS-1$
- public static final String MAPPING_JOIN_COLUMN_NAME = PREFIX + "mapping_joinColumnName"; //$NON-NLS-1$
- public static final String MAPPING_JOIN_REFERENCED_COLUMN = PREFIX + "mapping_joinReferencedColumn"; //$NON-NLS-1$
- public static final String MAPPING_JOIN_TABLE_NAME = PREFIX + "mapping_joinTableName"; //$NON-NLS-1$
- public static final String MAPPING_JOIN_TABLE_COLUMNS = PREFIX + "mapping_joinTableJoinColumns"; //$NON-NLS-1$
- public static final String MAPPING_JOIN_TABLE_INVERSE_JOIN_COLUMNS = PREFIX + "mapping_joinTableInverseJoinColumns"; //$NON-NLS-1$
- public static final String MAPPING_LOB = PREFIX + "mapping_lob"; //$NON-NLS-1$
- public static final String MAPPING_MAP_AS = PREFIX + "mapping_mapAs"; //$NON-NLS-1$
- public static final String MAPPING_MAPPED_BY = PREFIX + "mapping_mappedBy"; //$NON-NLS-1$
- public static final String MAPPING_OPTIONAL = PREFIX + "mapping_optional"; //$NON-NLS-1$
- public static final String MAPPING_ORDER_BY = PREFIX + "mapping_orderBy"; //$NON-NLS-1$
- public static final String MAPPING_ORDER_BY_NO_ORDERING = PREFIX + "mapping_orderByNoOrdering"; //$NON-NLS-1$
- public static final String MAPPING_ORDER_BY_PRIMARY_KEY_ORDERING = PREFIX + "mapping_orderByPrimaryKeyOrdering"; //$NON-NLS-1$
- public static final String MAPPING_ORDER_BY_CUSTOM_ORDERING = PREFIX + "mapping_orderByCustomOrdering"; //$NON-NLS-1$
- public static final String MAPPING_PRIMARY_KEY_GENERATION = PREFIX + "mapping_primaryKeyGeneration"; //$NON-NLS-1$
- public static final String MAPPING_SEQUENCE_GENERATOR = PREFIX + "mapping_sequenceGenerator"; //$NON-NLS-1$
- public static final String MAPPING_SEQUENCE_GENERATOR_NAME = PREFIX + "mapping_sequenceGeneratorName"; //$NON-NLS-1$
- public static final String MAPPING_SEQUENCE_GENERATOR_SEQUENCE = PREFIX + "mapping_sequenceGeneratorSequence"; //$NON-NLS-1$
- public static final String MAPPING_TABLE_GENERATOR = PREFIX + "mapping_tableGenerator"; //$NON-NLS-1$
- public static final String MAPPING_TABLE_GENERATOR_NAME = PREFIX + "mapping_tableGeneratorName"; //$NON-NLS-1$
- public static final String MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN = PREFIX + "mapping_tableGeneratorPrimaryKeyColumn"; //$NON-NLS-1$
- public static final String MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN_VALUE = PREFIX + "mapping_tableGeneratorPrimaryKeyColumnValue"; //$NON-NLS-1$
- public static final String MAPPING_TABLE_GENERATOR_TABLE= PREFIX + "mapping_tableGeneratorTable"; //$NON-NLS-1$
- public static final String MAPPING_TABLE_GENERATOR_VALUE_COLUMN = PREFIX + "mapping_tableGeneratorValueColumn"; //$NON-NLS-1$
- public static final String MAPPING_TARGET_ENTITY = PREFIX + "mapping_targetEntity"; //$NON-NLS-1$
- public static final String MAPPING_TEMPORAL = PREFIX + "mapping_temporal"; //$NON-NLS-1$
-
- //Project properties
- public static final String PROPERTIES_JAVA_PERSISTENCE = PREFIX + "properties_javaPersistence"; //$NON-NLS-1$
- public static final String PROPERTIES_JAVA_PERSISTENCE_CONNECTION = PREFIX + "properties_javaPersistenceConnection"; //$NON-NLS-1$
- public static final String PROPERTIES_JAVA_PERSISTENCE_SCHEMA = PREFIX + "properties_javaPersistenceSchema"; //$NON-NLS-1$
-
- //Dialogs, Wizards
- public static final String DIALOG_CREATE_ORM = PREFIX + "dialog_createORM"; //$NON-NLS-1$
- public static final String DIALOG_EDIT_INVERSE_JOIN_COLUNN = PREFIX + "dialog_editInverseJoinColumn"; //$NON-NLS-1$
- public static final String DIALOG_GENERATE_ENTITIES = PREFIX + "dialog_generateEntities"; //$NON-NLS-1$
- public static final String DIALOG_GENERATE_ENTITIES_SOURCE = PREFIX + "dialog_generateEntities_source"; //$NON-NLS-1$
- public static final String DIALOG_GENERATE_ENTITIES_PACKAGE = PREFIX + "dialog_generateEntities_package"; //$NON-NLS-1$
- public static final String DIALOG_GENERATE_ENTITIES_TABLES = PREFIX + "dialog_generateEntities_tables"; //$NON-NLS-1$
- public static final String DIALOG_JPA_FACET = PREFIX + "dialog_JPAFacet"; //$NON-NLS-1$
- public static final String DIALOG_JPA_PLATFORM = PREFIX + "dialog_JPAPlatform"; //$NON-NLS-1$
- public static final String NEW_JPA_PROJECT = PREFIX + "dialog_newJPAProject"; //$NON-NLS-1$
- public static final String NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH = PREFIX + "dialog_addJavaPersistence_classpath"; //$NON-NLS-1$
- public static final String NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE = PREFIX + "dialog_addJavaPersistence_database"; //$NON-NLS-1$
- public static final String NEW_JPA_PROJECT_CONTENT_PAGE_PACKAGING = PREFIX + "dialog_addJavaPersistence_packaging"; //$NON-NLS-1$
- public static final String NEW_JPA_PROJECT_CREATION_PAGE = PREFIX + "dialog_addJavaPersistence"; //$NON-NLS-1$
-
- //Other
- public static final String PERSISTENCE_OUTLINE = PREFIX + "persistenceOutline"; //$NON-NLS-1$
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaPlatformUi.java
deleted file mode 100644
index b7fcb1823e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/IJpaPlatformUi.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.Collection;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.ui.internal.details.IJpaDetailsProvider;
-import org.eclipse.jpt.ui.internal.structure.IJpaStructureProvider;
-
-public interface IJpaPlatformUi
-{
- Collection<IJpaStructureProvider> structureProviders();
-
- Collection<IJpaDetailsProvider> detailsProviders();
-
- void generateDDL(IJpaProject project, IStructuredSelection selection);
-
- void generateEntities(IJpaProject project, IStructuredSelection selection);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaCompletionProposalComputer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaCompletionProposalComputer.java
deleted file mode 100644
index 78b93731cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaCompletionProposalComputer.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.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.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.internal.IJpaFile;
-import org.eclipse.jpt.core.internal.JptCorePlugin;
-import org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit;
-import org.eclipse.jpt.utility.internal.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-public class JpaCompletionProposalComputer implements IJavaCompletionProposalComputer {
-
- public JpaCompletionProposalComputer() {
- 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();
- }
-
- private List<ICompletionProposal> computeCompletionProposals(JavaContentAssistInvocationContext context) {
- try {
- return this.computeCompletionProposals_(context);
- } catch (JavaModelException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private List<ICompletionProposal> computeCompletionProposals_(JavaContentAssistInvocationContext context) throws JavaModelException {
- ICompilationUnit cu = context.getCompilationUnit();
- if (cu == null) {
- return Collections.emptyList();
- }
-
- IJpaFile jpaFile = JptCorePlugin.getJpaFile((IFile) cu.getCorrespondingResource());
- if (jpaFile == null) {
- return Collections.emptyList();
- }
-
- JpaCompilationUnit jpaCU = (JpaCompilationUnit) jpaFile.getContent();
- 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<String> filter = ((prefix == null) ? Filter.Null.<String>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();
-
-// System.out.println("prefix: " + new String(prefix));
-// System.out.println("token start: " + tokenStart);
-// System.out.println("token end: " + tokenEnd);
-// String source = cu.getSource();
-// String token = source.substring(tokenStart, 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 + "<=");
-
- List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
- for (Iterator<String> stream = jpaCU.candidateValuesFor(context.getInvocationOffset(), filter); stream.hasNext(); ) {
- String s = stream.next();
- proposals.add(new CompletionProposal(s, tokenStart, tokenEnd - tokenStart + 1, s.length()));
- }
- return proposals;
- }
-
- @SuppressWarnings("unchecked")
- public List computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) {
- return Collections.EMPTY_LIST;
- }
-
- public String getErrorMessage() {
- return null;
- }
-
- public void sessionEnded() {
- // do nothing
- }
-
- private static class IgnoreCasePrefixFilter implements Filter<String> {
- private final char[] prefix;
- IgnoreCasePrefixFilter(char[] prefix) {
- super();
- this.prefix = prefix;
- }
- public boolean accept(String s) {
- return StringTools.stringStartsWithIgnoreCase(s.toCharArray(), prefix);
- }
- }
-
-}
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
deleted file mode 100644
index abdd525cf2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiIcons.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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;
-
-public class JptUiIcons
-{
- public static final String JPA_WIZ_BANNER = "full/wizban/jpa_facet_wizban"; //$NON-NLS-1$
-}
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
deleted file mode 100644
index cdc142e820..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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 JptUiMessages extends NLS
-{
- private static final String BUNDLE_NAME = "jpt_ui"; //$NON-NLS-1$
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, JptUiMessages.class);
- }
-
- public static String AddPersistentAttributeDialog_title;
-
- public static String AddPersistentAttributeDialog_attributeLabel;
-
- public static String AddPersistentAttributeDialog_mappingLabel;
-
- public static String AddPersistentAttributeDialog_noMappingKeyError;
-
- public static String AddPersistentClassDialog_title;
-
- public static String AddPersistentClassDialog_classLabel;
-
- public static String AddPersistentClassDialog_classDialog_title;
-
- public static String AddPersistentClassDialog_classDialog_message;
-
- public static String AddPersistentClassDialog_mappingLabel;
-
- public static String AddPersistentClassDialog_noClassError;
-
- public static String AddPersistentClassDialog_duplicateClassWarning;
-
- public static String AddPersistentClassDialog_classNotFoundWarning;
-
- public static String AddPersistentClassDialog_noMappingKeyError;
-
- public static String DatabaseReconnectWizardPage_database;
-
- public static String DatabaseReconnectWizardPage_databaseConnection;
-
- public static String DatabaseReconnectWizardPage_reconnectToDatabase;
-
- public static String DatabaseReconnectWizardPage_connection;
-
- public static String DatabaseReconnectWizardPage_schema;
-
- public static String DatabaseReconnectWizardPage_schemaInfo;
-
- public static String DatabaseReconnectWizardPage_addConnectionLink;
-
- public static String DatabaseReconnectWizardPage_reconnectLink;
-
- public static String General_browse;
-
- public static String General_deselectAll;
-
- public static String General_selectAll;
-
- public static String GenerateEntitiesWizard_generateEntities;
-
- public static String GenerateEntitiesWizardPage_chooseEntityTable;
-
- public static String GenerateEntitiesWizardPage_generateEntities;
-
- public static String GenerateEntitiesWizardPage_synchronizeClasses;
-
- public static String GenerateEntitiesWizardPage_tables;
-
- public static String GenerateEntitiesWizardPage_tableColumn;
-
- public static String GenerateEntitiesWizardPage_entityNameColumn;
-
- public static String GenericPlatformUiDialog_notSupportedMessageTitle;
-
- public static String GenericPlatformUiDialog_notSupportedMessageText;
-
- public static String JpaPreferencePage_defaultJpaLib;
-
- public static String JpaPreferencePage_userLibsLink;
-
- public static String JpaPreferencePage_invalidJpaLib;
-
- public static String JpaStructureView_viewNotAvailable;
-
- public static String JpaStructureView_linkWithEditorText;
-
- public static String JpaStructureView_linkWithEditorDesc;
-
- public static String JpaStructureView_linkWithEditorTooltip;
-
- public static String JpaDetailsView_viewNotAvailable;
-
- public static String NewJpaProjectWizard_title;
-
- public static String NewJpaProjectWizard_firstPage_title;
-
- public static String NewJpaProjectWizard_firstPage_description;
-
- public static String JpaFacetWizardPage_title;
-
- public static String JpaFacetWizardPage_description;
-
- public static String JpaFacetWizardPage_platformLabel;
-
- public static String JpaFacetWizardPage_connectionLabel;
-
- public static String JpaFacetWizardPage_connectionLink;
-
- public static String JpaFacetWizardPage_jpaImplementationLabel;
-
- public static String JpaFacetWizardPage_userServerLibLabel;
-
- public static String JpaFacetWizardPage_specifyLibLabel;
-
- public static String JpaFacetWizardPage_jpaPrefsLink;
-
- public static String JpaFacetWizardPage_userLibsLink;
-
- public static String JpaFacetWizardPage_persistentClassManagementLabel;
-
- public static String JpaFacetWizardPage_discoverClassesButton;
-
- public static String JpaFacetWizardPage_listClassesButton;
-
- public static String JpaFacetWizardPage_createOrmXmlButton;
-
- public static String PersistentAttributePage_mapAs;
-
- public static String PersistentTypePage_mapAs;
-
- public static String OverwriteConfirmerDialog_title;
-
- public static String OverwriteConfirmerDialog_text;
-
-
- private JptUiMessages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiPlugin.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiPlugin.java
deleted file mode 100644
index 77e697c5d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiPlugin.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-public class JptUiPlugin extends AbstractUIPlugin
-{
- private static JptUiPlugin INSTANCE;
-
- /**
- * The plug-in identifier of JPA UI support
- * (value <code>"org.eclipse.jpt.ui"</code>).
- */
- public final static String PLUGIN_ID = "org.eclipse.jpt.ui"; //$NON-NLS-1$
-
- /**
- * Returns the singleton Plugin
- */
- public static JptUiPlugin getPlugin() {
- return INSTANCE;
- }
-
- 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));
- }
-
-
- public JptUiPlugin() {
- super();
- INSTANCE = this;
- }
-
- /**
- * This gets a .gif from the icons folder.
- */
- public ImageDescriptor getImageDescriptor(String key) {
- if (! key.startsWith("icons/")) {
- key = "icons/" + key;
- }
- if (! key.endsWith(".gif")) {
- key = key + ".gif";
- }
- return imageDescriptorFromPlugin(PLUGIN_ID, key);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/PlatformRegistry.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/PlatformRegistry.java
deleted file mode 100644
index ad616f2f12..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/PlatformRegistry.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-public class PlatformRegistry
-{
- public static final PlatformRegistry INSTANCE = new PlatformRegistry();
-
- private static final String EXTENSION_ID =
- "jpaPlatform"; //$NON-NLS-1$
-
- private static final String EL_PLATFORM =
- "jpaPlatform"; //$NON-NLS-1$
-
- private static final String AT_ID =
- "id"; //$NON-NLS-1$
-
- private static final String AT_CLASS =
- "class"; //$NON-NLS-1$
-
- // key: String jpaPlatform id value: IConfigurationElement class descriptor
- private Map<String, IConfigurationElement> jpaPlatforms;
-
-
- /* (non Java doc)
- * restrict access
- */
- private PlatformRegistry() {
- buildJpaPlatforms();
- }
-
-
- private void buildJpaPlatforms() {
- this.jpaPlatforms = new HashMap<String, IConfigurationElement>();
-
- for (Iterator stream = allConfigElements(); stream.hasNext(); ) {
- buildJpaPlatform((IConfigurationElement) stream.next());
- }
- }
-
- private void buildJpaPlatform(IConfigurationElement configElement) {
- if (! configElement.getName().equals(EL_PLATFORM)) {
- return;
- }
-
- String platformId = configElement.getAttribute(AT_ID);
- String platformClass = configElement.getAttribute(AT_CLASS);
-
- if ((platformId == null) || (platformClass == null)) {
- if (platformId == null) {
- reportMissingAttribute(configElement, AT_ID);
- }
- if (platformClass == null) {
- reportMissingAttribute(configElement, AT_CLASS);
- }
- return;
- }
-
- if (jpaPlatforms.containsKey(platformId)) {
- IConfigurationElement otherConfigElement = jpaPlatforms.get(platformId);
- reportDuplicatePlatform(configElement, otherConfigElement);
- }
-
- jpaPlatforms.put(platformId, configElement);
- }
-
- public IJpaPlatformUi getJpaPlatform(String vendorId) {
- IConfigurationElement registeredConfigElement = this.jpaPlatforms.get(vendorId);
-
- if (registeredConfigElement == null) {
- return null;
- }
-
- try {
- return (IJpaPlatformUi) registeredConfigElement.createExecutableExtension(AT_CLASS);
- }
- catch (CoreException ce) {
- reportFailedInstantiation(registeredConfigElement);
- return null;
- }
- }
-
- private Iterator allConfigElements() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint =
- registry.getExtensionPoint(JptUiPlugin.PLUGIN_ID, EXTENSION_ID);
- IExtension[] extensions = extensionPoint.getExtensions();
-
- return new CompositeIterator(
- new TransformationIterator(CollectionTools.iterator(extensions)) {
- @Override
- protected Object transform(Object next) {
- return CollectionTools.iterator(((IExtension) next).getConfigurationElements());
- }
- }
- );
- }
-
- // TODO externalize strings
- private void reportMissingAttribute(IConfigurationElement configElement, String attributeName) {
- String message =
- "An extension element \""
- + configElement.getName()
- + "\" in plugin \""
- + configElement.getContributor().getName()
- + "\" is missing a required attribute \""
- + attributeName
- + "\".";
- JptUiPlugin.log(message);
- }
-
- // TODO externalize strings
- private void reportDuplicatePlatform(
- IConfigurationElement oneConfigElement, IConfigurationElement otherConfigElement) {
- String message =
- "The plugins \""
- + oneConfigElement.getContributor().getName()
- + "\" and \""
- + otherConfigElement.getContributor().getName()
- + "\" have registered a duplicate attribute \"id\" "
- + "for the extension element \"jpaVendor\".";
- JptUiPlugin.log(message);
- }
-
- // TODO externalize strings
- private void reportFailedInstantiation(IConfigurationElement configElement) {
- String message =
- "Could not instantiate the class \""
- + configElement.getAttribute(AT_CLASS)
- + "\" for the extension element \""
- + configElement.getName()
- + "\" in the plugin \""
- + configElement.getContributor().getName()
- + "\".";
- JptUiPlugin.log(message);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAction.java
deleted file mode 100644
index f38efd98b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAction.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute;
-import org.eclipse.ui.actions.ActionDelegate;
-
-public class AddPersistentAttributeToXmlAction extends ActionDelegate
-{
-
- private ISelection selection;
-
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- super.selectionChanged(action, selection);
- this.selection = selection;
- }
-
- @Override
- public void run(IAction action) {
- if (this.selection instanceof StructuredSelection) {
- for (Iterator<XmlPersistentAttribute> i = ((StructuredSelection) selection).iterator(); i.hasNext(); ) {
- XmlPersistentAttribute xmlPersistentAttribute = i.next();
- xmlPersistentAttribute.setVirtual(false);
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAndMapAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAndMapAction.java
deleted file mode 100644
index d75a96dfe5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAndMapAction.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.eclipse.jpt.ui.internal.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute;
-import org.eclipse.jpt.ui.internal.dialogs.AddPersistentAttributeToXmlAndMapDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-public class AddPersistentAttributeToXmlAndMapAction
- implements IObjectActionDelegate
-{
- private Shell shell;
-
- private XmlPersistentAttribute unmappedXmlAttribute;
-
-
- public AddPersistentAttributeToXmlAndMapAction() {
- super();
- }
-
- public void run(IAction action) {
- AddPersistentAttributeToXmlAndMapDialog dialog = new AddPersistentAttributeToXmlAndMapDialog(shell, unmappedXmlAttribute);
-
- dialog.create();
- dialog.setBlockOnOpen(true);
- dialog.open();
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- unmappedXmlAttribute = (XmlPersistentAttribute) ((StructuredSelection) selection).getFirstElement();
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- shell = targetPart.getSite().getShell();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentClassAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentClassAction.java
deleted file mode 100644
index 23b4deba52..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentClassAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal;
-import org.eclipse.jpt.ui.internal.dialogs.AddPersistentClassDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-public class AddPersistentClassAction
- implements IObjectActionDelegate
-{
- private Shell shell;
-
- private EntityMappingsInternal entityMappings;
-
-
- public AddPersistentClassAction() {
- super();
- }
-
- public void run(IAction action) {
- AddPersistentClassDialog dialog = new AddPersistentClassDialog(shell, entityMappings);
-
- dialog.create();
- dialog.setBlockOnOpen(true);
- dialog.open();
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- entityMappings = (EntityMappingsInternal) ((StructuredSelection) selection).getFirstElement();
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- shell = targetPart.getSite().getShell();
- }
-}
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
deleted file mode 100644
index ab7a410188..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateDDLAction.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.internal.IJpaProject;
-import org.eclipse.jpt.ui.internal.IJpaPlatformUi;
-import org.eclipse.jpt.ui.internal.PlatformRegistry;
-
-/**
- * GenerateDDLAction
- */
-public class GenerateDDLAction extends ProjectAction {
-
- public GenerateDDLAction() {
- super();
- }
-
- protected void execute(IJpaProject project) {
- String vendorId = project.getPlatform().getId();
-
- this.jpaPlatformUI(vendorId).generateDDL(project, this.getCurrentSelection());
- }
-
- private IJpaPlatformUi jpaPlatformUI(String vendorId) {
- return PlatformRegistry.INSTANCE.getJpaPlatform(vendorId);
- }
-
-}
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
deleted file mode 100644
index b12579130a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateEntitiesAction.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007 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.internal.IJpaProject;
-import org.eclipse.jpt.ui.internal.IJpaPlatformUi;
-import org.eclipse.jpt.ui.internal.PlatformRegistry;
-
-/**
- * GenerateEntitiesAction
- */
-public class GenerateEntitiesAction extends ProjectAction {
- public GenerateEntitiesAction() {
- super();
- }
-
- protected void execute(IJpaProject project) {
- String vendorId = project.getPlatform().getId();
-
- this.jpaPlatformUI(vendorId).generateEntities(project, this.getCurrentSelection());
- }
-
- private IJpaPlatformUi jpaPlatformUI(String vendorId) {
- return PlatformRegistry.INSTANCE.getJpaPlatform(vendorId);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/PersistentAttributeActionFilter.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/PersistentAttributeActionFilter.java
deleted file mode 100644
index 2e6396f4c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/PersistentAttributeActionFilter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.jpt.ui.internal.actions;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.core.internal.IPersistentAttribute;
-import org.eclipse.ui.IActionFilter;
-
-public class PersistentAttributeActionFilter
- implements IActionFilter
-{
- public static final String IS_MAPPED = "isMapped";
-
-
- public boolean testAttribute(Object target, String name, String value) {
- if (! IS_MAPPED.equals(name)) {
- return false;
- }
-
- Boolean booleanValue;
- if ("true".equals(value)) {
- booleanValue = true;
- }
- else if ("false".equals(value)) {
- booleanValue = false;
- }
- else {
- return false;
- }
-
- boolean mapped = ((IPersistentAttribute) target).mappingKey() != IMappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- return mapped == booleanValue;
- }
-
-
- public static final class Factory
- implements IAdapterFactory
- {
- private static final Class[] ADAPTER_TYPES = { IActionFilter.class };
-
- public Object getAdapter(final Object adaptable, final Class adapterType ) {
- if( adapterType == IActionFilter.class ) {
- return new PersistentAttributeActionFilter();
- } else {
- return null;
- }
- }
-
- public Class[] getAdapterList() {
- return ADAPTER_TYPES;
- }
- }
-}
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
deleted file mode 100644
index 04e657e6e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/ProjectAction.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 2007 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.internal.IJpaProject;
-import org.eclipse.jpt.core.internal.JptCorePlugin;
-import org.eclipse.ui.IActionDelegate;
-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();
- }
-
- /**
- * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // do nothing
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- this.currentSelection = selection;
- }
-
- protected IStructuredSelection getCurrentSelection() {
- if (this.currentSelection instanceof IStructuredSelection) {
- return (IStructuredSelection) this.currentSelection;
- }
- return null;
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- 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 void execute(IProject project) {
- IJpaProject jpaProject = JptCorePlugin.getJpaProject(project);
- if (jpaProject == null) {
- return;
- }
- this.execute(jpaProject);
- }
-
- protected void execute(IJpaProject project) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentAttributeFromXmlAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentAttributeFromXmlAction.java
deleted file mode 100644
index 326949e20c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentAttributeFromXmlAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType;
-import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping;
-import org.eclipse.ui.actions.ActionDelegate;
-
-public class RemovePersistentAttributeFromXmlAction extends ActionDelegate
-{
- private ISelection selection;
-
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- super.selectionChanged(action, selection);
- this.selection = selection;
- }
-
- @Override
- public void run(IAction action) {
- if (this.selection instanceof StructuredSelection) {
- for (Iterator<XmlPersistentAttribute> i = ((StructuredSelection) selection).iterator(); i.hasNext(); ) {
- XmlPersistentAttribute xmlPersistentAttribute = i.next();
- XmlPersistentType xmlPersistentType = ((XmlTypeMapping) xmlPersistentAttribute.typeMapping()).getPersistentType();
- xmlPersistentType.getSpecifiedAttributeMappings().remove(xmlPersistentAttribute.getMapping());
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentClassAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentClassAction.java
deleted file mode 100644
index 3d8a55a236..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentClassAction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType;
-import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-public class RemovePersistentClassAction
- implements IObjectActionDelegate
-{
- private XmlPersistentType persistentClass;
-
-
- public RemovePersistentClassAction() {
- super();
- }
-
- public void run(IAction action) {
- XmlTypeMapping mapping = persistentClass.getMapping();
- ((EntityMappingsInternal) mapping.getEntityMappings()).getTypeMappings().remove(mapping);
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- persistentClass = (XmlPersistentType) ((StructuredSelection) selection).getFirstElement();
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // do nothing
- }
-}
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
deleted file mode 100644
index 3b4db8ed75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/SynchronizeClassesAction.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.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) {
- // only one element in actual selection
- file = (IFile) ((StructuredSelection) selection).getFirstElement();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/XmlPersistentAttributeActionFilter.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/XmlPersistentAttributeActionFilter.java
deleted file mode 100644
index e5f57a924a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/XmlPersistentAttributeActionFilter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.eclipse.jpt.ui.internal.actions;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute;
-import org.eclipse.ui.IActionFilter;
-
-public class XmlPersistentAttributeActionFilter
- extends PersistentAttributeActionFilter
-{
- public static final String IS_VIRTUAL = "isVirtual";
-
-
- public boolean testAttribute(Object target, String name, String value) {
- if (! IS_VIRTUAL.equals(name)) {
- return super.testAttribute(target, name, value);
- }
-
- Boolean booleanValue;
- if ("true".equals(value)) {
- booleanValue = true;
- }
- else if ("false".equals(value)) {
- booleanValue = false;
- }
- else {
- return false;
- }
- return ((XmlPersistentAttribute) target).isVirtual() == booleanValue;
- }
-
-
- public static final class Factory
- implements IAdapterFactory
- {
- private static final Class[] ADAPTER_TYPES = { IActionFilter.class };
-
- public Object getAdapter(final Object adaptable, final Class adapterType ) {
- if( adapterType == IActionFilter.class ) {
- return new XmlPersistentAttributeActionFilter();
- } else {
- return null;
- }
- }
-
- public Class[] getAdapterList() {
- return ADAPTER_TYPES;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaComposite.java
deleted file mode 100644
index 6c3ff8ba80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaComposite.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.emf.common.command.CommandStack;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public abstract class BaseJpaComposite extends BaseJpaController
- implements IJpaComposite
-{
- private Composite composite;
-
- public BaseJpaComposite(Composite parent, int style, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, style, theCommandStack, widgetFactory);
- }
-
- public BaseJpaComposite(Composite parent, CommandStack theCommandStack,TabbedPropertySheetWidgetFactory widgetFactory) {
- this(parent, SWT.NULL, theCommandStack, widgetFactory);
- }
-
- @Override
- protected void buildWidget(Composite parent, int style) {
- super.buildWidget(parent);
- this.composite = createComposite(parent, style);
- initializeLayout(this.composite);
- }
-
- protected Composite createComposite(Composite parent, int style) {
- return this.widgetFactory.createComposite(parent, style);
- }
-
- protected abstract void initializeLayout(Composite composite);
-
- public Control getControl() {
- return this.composite;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaController.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaController.java
deleted file mode 100644
index e4401eba8a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaController.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public abstract class BaseJpaController
-{
- protected CommandStack commandStack;
-
- protected TabbedPropertySheetWidgetFactory widgetFactory;
-
- //put in the populating flag to stop the circular population of the entity name combo
- //populateEntityNameCombo is calling select() which causes entityNameComboModified() to be called
- //this sets the name in the model which starts the circle over again. We should probably
- //short-circuit this differently, like in the emf model, keep the property change from being fired if
- //a change did not actually occur - KFM
- private boolean populating;
-
-
- public BaseJpaController(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super();
- this.widgetFactory = widgetFactory;
- buildWidget(parent);
- this.commandStack = theCommandStack;
- }
-
- public BaseJpaController(Composite parent, int style, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super();
- this.widgetFactory = widgetFactory;
- buildWidget(parent, style);
- this.commandStack = theCommandStack;
- }
-
-
- /**
- * Override this method if using the constructor without the style bit
- */
- protected void buildWidget(Composite parent) {
- // no op
- }
-
- /**
- * Override this method if using the constructor with the style bit
- */
- protected void buildWidget(Composite parent, int style) {
- // no op
- }
-
- /**
- * This method is called from outside when setting the object of interest
- */
- public final void populate(EObject obj) {
- if (getControl().isDisposed()) {
- return;
- }
- this.populating = true;
- disengageListeners();
- doPopulate(obj);
- engageListeners();
- this.populating = false;
- }
-
- /**
- * This method is called (perhaps internally) when this needs to repopulate
- * but the object of interest has not changed
- */
- public final void populate() {
- if (getControl().isDisposed()) {
- return;
- }
- this.populating = true;
- doPopulate();
- this.populating = false;
- }
-
- protected abstract void doPopulate(EObject obj);
-
- protected abstract void doPopulate();
-
- protected abstract void engageListeners();
-
- protected abstract void disengageListeners();
-
- protected boolean isPopulating() {
- return this.populating;
- }
-
- public TabbedPropertySheetWidgetFactory getWidgetFactory() {
- return this.widgetFactory;
- }
-
- public void dispose() {
- disengageListeners();
- }
-
- public abstract Control getControl();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaDetailsPage.java
deleted file mode 100644
index d57e13f02a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/BaseJpaDetailsPage.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.IJpaContentNode;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public abstract class BaseJpaDetailsPage extends BaseJpaComposite
- implements IJpaDetailsPage
-{
- private Composite control;
-
- public BaseJpaDetailsPage(
- Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- }
-
- public BaseJpaDetailsPage(
- Composite parent, int style, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, style, theCommandStack, widgetFactory);
- }
-
- @Override
- //using this to get a Scroll bar on the JpaDetailsView
- protected Composite createComposite(Composite parent, int style) {
- ScrolledForm scrolledForm = this.widgetFactory.createScrolledForm(parent);
- //Nesting another composite because combos on the ScrolledForm didn't have a border
- scrolledForm.getBody().setLayout(new FillLayout());
- Composite composite = super.createComposite(scrolledForm.getBody(), style);
- this.control = scrolledForm;
- return composite;
- }
-
- public final void populate(IJpaContentNode contentNode) {
- super.populate(contentNode);
- }
-
- @Override
- protected final void doPopulate(EObject obj) {
- doPopulate((IJpaContentNode) obj);
- }
-
- protected abstract void doPopulate(IJpaContentNode contentNode);
-
-
- @Override
- public Control getControl() {
- return this.control;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaComposite.java
deleted file mode 100644
index bd09fed9d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaComposite.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.emf.ecore.EObject;
-import org.eclipse.swt.widgets.Control;
-
-
-public interface IJpaComposite<E extends EObject> {
-
- void populate(E model);
-
- Control getControl();
-
- void dispose();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsPage.java
deleted file mode 100644
index ae78d2fc38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsPage.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.internal.IJpaContentNode;
-import org.eclipse.swt.widgets.Control;
-
-public interface IJpaDetailsPage
-{
- Control getControl();
-
- /**
- * Set the content for the page and populate widgets
- */
- void populate(IJpaContentNode contentNode);
-
-
- /**
- * Perform any other disposal needed
- */
- void dispose();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsProvider.java
deleted file mode 100644
index aab2f6f721..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/IJpaDetailsProvider.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public interface IJpaDetailsProvider
-{
-
- String fileContentType();
-
- /**
- * Build a properties page given the parent Composite and the
- * content node id.
- * It is legal to set the layout for the given Composite.
- */
- IJpaDetailsPage buildDetailsPage(Composite parentComposite, Object contentNodeId, TabbedPropertySheetWidgetFactory widgetFactory);
-
- void dispose();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PageBookManager.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PageBookManager.java
deleted file mode 100644
index 80c583ba2c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PageBookManager.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Versant. 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: Versant. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.details;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * A wrapper for a <code>PageBook</code> with convenience methods.
- */
-public class PageBookManager extends PageBook {
-
- private Map pageRecords;
- private Object active;
- private PageBook pageBook;
- private Composite defaultComposite;
-
- /**
- * A <code>PageBookManager<code> is a wrapper for a <code>PageBook</code>. It provides
- * convenience methods to add, remove, activate and inactive pages in the internal <code>PageBook</code>.
- * If a page gets deactivated, the manager activates a default page.
- *
- * @param parent The parent composite to this manager
- * @param aDefaultLabel The label on the the default page.
- */
- public PageBookManager(Composite parent, String aDefaultLabel) {
- super(parent, SWT.NULL);
- this.setLayout(new FillLayout());
- this.pageRecords = new HashMap();
- this.pageBook = new PageBook(this, SWT.NONE);
- this.defaultComposite = new DefaultComposite(pageBook, aDefaultLabel);
- this.pageBook.showPage(this.defaultComposite);
- }
-
- /**
- * @param anObj Activates (flips to top in the <code>PageBook</code>) the associated <code>Composite</code>
- * for the given <code>Object</code>. Activates the <code>DefaultComposite</code> if there is no association
- * for the given <code>Object</code>.
- * @return Return false if there is no <code>Composite</code> association to the given <code>Object</code> or
- * the associated <code>Composite</code> is already active.
- */
- public boolean activate(Object anObj) {
- if(anObj != null && !anObj.equals(this.active) && this.pageRecords.containsKey(anObj)) {
- Composite composite = (Composite) this.pageRecords.get(anObj);
- this.pageBook.showPage(composite);
- this.active = anObj;
- return true;
- } else if((anObj == null || !anObj.equals(this.active)) && !this.pageRecords.containsKey(anObj)) {
- this.pageBook.showPage(this.defaultComposite);
- this.active = null;
- }
- return false;
- }
-
- /**
- * @param anObj
- * @return Returns true if the associated <code>Composite</code> has been deactivated.
- * Returns false if there is no <code>Composite</code> for the given <code>Object</code>
- * or the <code>Composite</code> is already inactive.
- */
- public boolean deactivate(Object anObj) {
- if(anObj.equals(this.active)) {
- this.pageBook.showPage(this.defaultComposite);
- this.active = null;
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Associates the specified <code>Object</code> with the specified <code>Composite</code>
- * in this <code>PageBookManager</code>.
- * If this manager previously contained a mapping for the <code>Object</code>, the old
- * <code>Composite</code> is replaced by the specified <code>Composite</code>.
- *
- * @param anObj <code>Object</code> with which the specified <code>Composite</code> is to be associated.
- * @param aComposite <code>Composite</code> to be associated with the specified <code>Object</code>.
- *
- * @return previous <code>Composite</code> associated with specified <code>Object</code>,
- * or <tt>null</tt> if there was no mapping for <code>Object</code>.
- */
- public Composite put(Object anObj, Composite aComposite) {
- Composite composite = (Composite) this.pageRecords.put(anObj, aComposite);
- this.activate(anObj);
- return composite;
- }
-
- /**
- * Removes the mapping for this <code>Object</code> from this pagebookmanager if it is present.
- *
- * @param anObj <code>Object</code> whose mapping is to be removed from this <code>PageBookManager</code>.
- * @return previous <code>Composite</code> associated with specified <code>Object</code>.
- */
- public Composite remove(Object anObj) {
- if(anObj.equals(this.active)) {
- this.active = null;
- this.pageBook.showPage(this.defaultComposite);
- }
- return (Composite) this.pageRecords.remove(anObj);
- }
-
- /**
- * @param anObj whose presence in this map is to be tested
- * @return true if this <code>PageBookManager</code> contains a mapping for the
- * given <code>Object</code>. False otherwise.
- */
- public boolean contains(Object anObj) {
- return this.pageRecords.containsKey(anObj);
- }
-
- public Composite get(Object key) {
- return (Composite) pageRecords.get(key);
- }
-
- /**
- * @return The currently active composite
- */
- public Composite getActive() {
- if(this.active == null) {
- return this.defaultComposite;
- } else {
- return (Composite) this.pageRecords.get(this.active);
- }
- }
-
- /**
- * @return The internal <code>PageBook</code> of this <code>PageBookManager</code>.
- * <code>Composite</code>s which should work with this manager needs to be created
- * with this <code>Composite</code> as their parent composite.
- */
- public Composite getComposite() {
- return this.pageBook;
- }
-
- // a default composite which is show if the active composite
- // gets deactivated
- private class DefaultComposite extends Composite {
- public DefaultComposite(Composite aParent, String aDefaultLabel) {
- super(aParent, SWT.NONE);
- setLayout(new FillLayout(SWT.VERTICAL));
- Label label = new Label(this, SWT.LEFT);
- label.setText(aDefaultLabel);
- }
- }
-
- public void dispose() {
- super.dispose();
- Collection composites = this.pageRecords.values();
- for (Iterator i = composites.iterator(); i.hasNext(); ) {
- ((Composite) i.next()).dispose();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java
deleted file mode 100644
index e9b3bce03a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java
+++ /dev/null
@@ -1,397 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import org.eclipse.emf.common.command.BasicCommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.core.internal.IAttributeMapping;
-import org.eclipse.jpt.core.internal.IJpaContentNode;
-import org.eclipse.jpt.core.internal.IPersistentAttribute;
-import org.eclipse.jpt.core.internal.JpaCorePackage;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.BasicMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.DefaultBasicMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.DefaultEmbeddedMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddedIdMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddedMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.IdMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.ManyToManyMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.ManyToOneMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.NullAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.OneToManyMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.OneToOneMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.TransientMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.VersionMappingUiProvider;
-import org.eclipse.jpt.ui.internal.widgets.CComboViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
-{
- private IPersistentAttribute attribute;
- private IAttributeMapping attributeMapping;
- private Adapter persistentAttributeListener;
- private Adapter attributeMappingListener;
-
- private String currentMappingKey;
-
- private CComboViewer mappingCombo;
-
- private Map<String, IJpaComposite<IAttributeMapping>> mappingComposites;
- protected PageBook mappingPageBook;
- private IJpaComposite<IAttributeMapping> currentMappingComposite;
-
- /**
- * These IAtttributeMappingUiProviders will be used as elements in the attributeMapping combo
- * The first element in the combo will be one of the defaultAttributemappingUiProviders or
- * if none of those apply the nullAttriubteMappingUiProvider will be used. The rest of the elements
- * will be the attributeMappingUiProviders. The defaultAttributeMappingUiProvider is
- * determined by matching its key with the key of the current attriubteMapping.
- */
- private Collection<IAttributeMappingUiProvider> attributeMappingUiProviders;
- private Collection<IAttributeMappingUiProvider> defaultAttributeMappingUiProviders;
- private IAttributeMappingUiProvider nullAttributeMappingUiProvider;
-
- public PersistentAttributeDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NONE, new BasicCommandStack(), widgetFactory);
- persistentAttributeListener = buildAttributeListener();
- attributeMappingListener = buildAttributeMappingListener();
- mappingComposites = new HashMap<String, IJpaComposite<IAttributeMapping>>();
- this.attributeMappingUiProviders = buildAttributeMappingUiProviders();
- this.defaultAttributeMappingUiProviders = buildDefaultAttributeMappingUiProviders();
- this.nullAttributeMappingUiProvider = buildNullAttributeMappingUiProvider();
- }
-
- protected IAttributeMappingUiProvider buildNullAttributeMappingUiProvider() {
- return NullAttributeMappingUiProvider.instance();
- }
-
- protected Collection<IAttributeMappingUiProvider> buildAttributeMappingUiProviders() {
- Collection<IAttributeMappingUiProvider> providers = new ArrayList<IAttributeMappingUiProvider>();
- providers.add(BasicMappingUiProvider.instance());
- providers.add(EmbeddedMappingUiProvider.instance());
- providers.add(EmbeddedIdMappingUiProvider.instance());
- providers.add(IdMappingUiProvider.instance());
- providers.add(ManyToManyMappingUiProvider.instance());
- providers.add(ManyToOneMappingUiProvider.instance());
- providers.add(OneToManyMappingUiProvider.instance());
- providers.add(OneToOneMappingUiProvider.instance());
- providers.add(TransientMappingUiProvider.instance());
- providers.add(VersionMappingUiProvider.instance());
- return providers;
- }
-
- protected Collection<IAttributeMappingUiProvider> attributeMappingUiProviders() {
- return this.attributeMappingUiProviders;
- }
-
- protected Collection<IAttributeMappingUiProvider> buildDefaultAttributeMappingUiProviders() {
- Collection<IAttributeMappingUiProvider> providers = new ArrayList<IAttributeMappingUiProvider>();
- providers.add(DefaultBasicMappingUiProvider.instance());
- providers.add(DefaultEmbeddedMappingUiProvider.instance());
- return providers;
- }
-
- protected Collection<IAttributeMappingUiProvider> defaultAttributeMappingUiProviders() {
- return this.defaultAttributeMappingUiProviders;
- }
-
- private IAttributeMappingUiProvider attributeMappingUiProvider(String key) {
- for (IAttributeMappingUiProvider provider : attributeMappingUiProviders()) {
- if (provider.key() == key) {
- return provider;
- }
- }
- return this.nullAttributeMappingUiProvider;
- }
- private IAttributeMappingUiProvider defaultAttributeMappingUiProvider(String key) {
- for (IAttributeMappingUiProvider provider : defaultAttributeMappingUiProviders()) {
- if (provider.key() == key) {
- return provider;
- }
- }
- return this.nullAttributeMappingUiProvider;
- }
-
- private Adapter buildAttributeListener() {
- return new AdapterImpl() {
- @Override
- public void notifyChanged(Notification notification) {
- persistentAttributeChanged(notification);
- }
- };
- }
-
- void persistentAttributeChanged(Notification notification) {
- switch (notification.getFeatureID(IPersistentAttribute.class)) {
- case JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING:
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- break;
- }
- }
-
- private Adapter buildAttributeMappingListener() {
- return new AdapterImpl() {
- @Override
- public void notifyChanged(Notification notification) {
- attributeMappingChanged(notification);
- }
- };
- }
-
- void attributeMappingChanged(Notification notification) {
-// switch (notification.getFeatureID(IAttributeMapping.class)) {
-// case JpaCorePackage.IATTRIBUTE_MAPPING__DEFAULT:
-// Display.getDefault().asyncExec(
-// new Runnable() {
-// public void run() {
-// populate();
-// }
-// });
-// break;
-// }
- }
-
- protected Label buildMappingLabel(Composite parent) {
- return getWidgetFactory().createLabel(parent, JptUiMessages.PersistentAttributePage_mapAs);
- }
-
- protected CComboViewer buildMappingCombo(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent);
- mappingCombo = new CComboViewer(combo);
- mappingCombo.setContentProvider(buildContentProvider());
- mappingCombo.setLabelProvider(buildLabelProvider());
- mappingCombo.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- mappingChanged(event);
- }
- });
- return mappingCombo;
- }
-
- private IContentProvider buildContentProvider() {
- return new IStructuredContentProvider() {
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object inputElement) {
- if (inputElement == null) {
- return new Object[]{};
- }
- return uiProvidersFor((IPersistentAttribute) inputElement);
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
- };
- }
-
- IAttributeMappingUiProvider[] uiProvidersFor(IPersistentAttribute persistentAttribute) {
- IAttributeMappingUiProvider[] providers = new IAttributeMappingUiProvider[attributeMappingUiProviders().size() +1];
- providers[0] = this.nullAttributeMappingUiProvider;
- for (IAttributeMappingUiProvider uiProvider : defaultAttributeMappingUiProviders()) {
- if (uiProvider.key() == persistentAttribute.defaultMappingKey()) {
- providers[0] = uiProvider;
- break;
- }
- }
- int i = 1;
- for (IAttributeMappingUiProvider uiProvider : attributeMappingUiProviders()) {
- providers[i++] = uiProvider;
- }
- return providers;
- }
-
- private IBaseLabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return ((IAttributeMappingUiProvider) element).label();
- }
- };
- }
-
- protected PageBook buildMappingPageBook(Composite parent) {
- mappingPageBook = new PageBook(parent, SWT.NONE);
- return mappingPageBook;
- }
-
- protected IJpaComposite<IAttributeMapping> buildMappingComposite(PageBook pageBook, String key) {
- if (this.attributeMapping == null || this.attributeMapping.isDefault()) {
- return defaultAttributeMappingUiProvider(key).buildAttributeMappingComposite(pageBook, this.commandStack, getWidgetFactory());
- }
-
- return attributeMappingUiProvider(key).buildAttributeMappingComposite(pageBook, this.commandStack, getWidgetFactory());
- }
-
- void mappingChanged(SelectionChangedEvent event) {
- if (isPopulating()) {
- return;
- }
- if (event.getSelection() instanceof StructuredSelection) {
- IAttributeMappingUiProvider provider = (IAttributeMappingUiProvider) ((StructuredSelection) event.getSelection()).getFirstElement();
- String key = (this.defaultAttributeMappingUiProviders().contains(provider) ? null : provider.key());
- attribute.setSpecifiedMappingKey(key);
- }
- }
-
- @Override
- protected void doPopulate(IJpaContentNode persistentAttributeNode) {
- attribute = (IPersistentAttribute) persistentAttributeNode;
- populateMappingComboAndPage();
- }
-
- @Override
- protected void doPopulate() {
- populateMappingComboAndPage();
- }
-
- @Override
- protected void engageListeners() {
- if (attribute != null) {
- attribute.eAdapters().add(persistentAttributeListener);
- if (attributeMapping != null) {
- attributeMapping.eAdapters().add(attributeMappingListener);
- }
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (attribute != null) {
- attribute.eAdapters().remove(persistentAttributeListener);
- if (attributeMapping != null) {
- attributeMapping.eAdapters().remove(attributeMappingListener);
- }
- }
- }
-
- private void populateMappingComboAndPage() {
- if (attribute == null) {
- attributeMapping = null;
- currentMappingKey = null;
- mappingCombo.setInput(null);
- mappingCombo.setSelection(StructuredSelection.EMPTY);
-
- if (currentMappingComposite != null) {
- currentMappingComposite.populate(null);
- currentMappingComposite = null;
- }
-
- return;
- }
- attributeMapping = attribute.getMapping();
- setComboData(attribute.candidateMappingKeys());
-
- populateMappingPage(attributeMapping == null ? null : attributeMapping.getKey());
- }
-
- private void populateMappingPage(String mappingKey) {
- if (currentMappingComposite != null) {
- if (mappingKey == currentMappingKey) {
- if (currentMappingComposite != null) {
- currentMappingComposite.populate(attributeMapping);
- return;
- }
- }
- else {
- currentMappingComposite.populate(null);
- // don't return
- }
- }
-
- currentMappingKey = mappingKey;
-
- IJpaComposite<IAttributeMapping> composite = mappingCompositeFor(mappingKey);
- mappingPageBook.showPage(composite.getControl());
-
- currentMappingComposite = composite;
- currentMappingComposite.populate(attributeMapping);
- }
-
- private void setComboData(Iterator<String> availableMappingKeys) {
- if (attribute != mappingCombo.getInput()) {
- mappingCombo.setInput(attribute);
- }
- if (attributeMapping == null || attributeMapping.isDefault()) {
- mappingCombo.setSelection(new StructuredSelection(mappingCombo.getElementAt(0)));
- }
- else {
- IAttributeMappingUiProvider provider = attributeMappingUiProvider(attribute.mappingKey());
- if (provider != null && ! provider.equals(((StructuredSelection) mappingCombo.getSelection()).getFirstElement())) {
- mappingCombo.setSelection(new StructuredSelection(provider));
- }
- }
- }
-
- private IJpaComposite<IAttributeMapping> mappingCompositeFor(String key) {
- IJpaComposite<IAttributeMapping> composite = mappingComposites.get(key);
- if (composite != null) {
- return composite;
- }
-
- composite = buildMappingComposite(mappingPageBook, key);
-
- if (composite != null) {
- mappingComposites.put(key, composite);
- }
-
- return composite;
- }
-
-//TODO focus??
-// public boolean setFocus() {
-// super.setFocus();
-// return mappingCombo.getCombo().setFocus();
-// }
-
- @Override
- public void dispose() {
- disengageListeners();
- for (Iterator<IJpaComposite<IAttributeMapping>> stream = mappingComposites.values().iterator(); stream.hasNext(); ) {
- stream.next().dispose();
- }
- super.dispose();
- }
-
- public IPersistentAttribute getAttribute() {
- return attribute;
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentTypeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentTypeDetailsPage.java
deleted file mode 100644
index bd8353b923..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentTypeDetailsPage.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import org.eclipse.emf.common.command.BasicCommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.core.internal.IJpaContentNode;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.core.internal.IPersistentType;
-import org.eclipse.jpt.core.internal.JpaCorePackage;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddableUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.EntityUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.MappedSuperclassUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.NullTypeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.widgets.CComboViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public abstract class PersistentTypeDetailsPage extends BaseJpaDetailsPage
-{
- private IPersistentType persistentType;
- private Adapter persistentTypeListener;
-
- private String currentMappingKey;
-
- private CComboViewer typeMappingCombo;
-
- /**
- * A Map of mapping Composites of type IPersistenceComposite that is keyed on IConfigurationElement
- */
- private Map composites;
-
- protected PageBook typeMappingPageBook;
-
- private IJpaComposite visibleMappingComposite;
-
- private Collection<ITypeMappingUiProvider> typeMappingUiProviders;
-
- public PersistentTypeDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NONE, new BasicCommandStack(), widgetFactory);
- this.persistentTypeListener = buildPersistentTypeListener();
- this.composites = new HashMap();
- this.typeMappingUiProviders = buildTypeMappingUiProviders();
- }
-
- protected Collection<ITypeMappingUiProvider> buildTypeMappingUiProviders() {
- Collection<ITypeMappingUiProvider> typeMappingUiProviders = new ArrayList<ITypeMappingUiProvider>();
- typeMappingUiProviders.add(new NullTypeMappingUiProvider());
- typeMappingUiProviders.add(new EntityUiProvider());
- typeMappingUiProviders.add(new MappedSuperclassUiProvider());
- typeMappingUiProviders.add(new EmbeddableUiProvider());
- return typeMappingUiProviders;
- }
-
- private Adapter buildPersistentTypeListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- persistentTypeChanged(notification);
- }
- };
- }
-
- private void persistentTypeChanged(Notification notification) {
- switch (notification.getFeatureID(IPersistentType.class)) {
- case JpaCorePackage.IPERSISTENT_TYPE__MAPPING_KEY:
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- break;
- }
- }
-
- protected Label buildTypeMappingLabel(Composite parent) {
- return getWidgetFactory().createLabel(parent, JptUiMessages.PersistentTypePage_mapAs);
- }
-
- protected CComboViewer buildTypeMappingCombo(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent);
- typeMappingCombo = new CComboViewer(combo);
- typeMappingCombo.setContentProvider(buildContentProvider());
- typeMappingCombo.setLabelProvider(buildLabelProvider());
- typeMappingCombo.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- typeMappingChanged(event);
- }
- });
- return typeMappingCombo;
- }
-
- private IContentProvider buildContentProvider() {
- return new IStructuredContentProvider() {
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object inputElement) {
- return (persistentType == null) ?
- new String[] {}:
- PersistentTypeDetailsPage.this.typeMappingUiProviders.toArray();
- }
-
- public void inputChanged(
- Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
- };
- }
- private IBaseLabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return ((ITypeMappingUiProvider) element).label();
- }
- };
- }
-
- protected PageBook buildTypeMappingPageBook(Composite parent) {
- typeMappingPageBook = new PageBook(parent, SWT.NONE);
- return typeMappingPageBook;
- }
-
- private IJpaProject getJpaProject() {
- return getPersistentType().getJpaProject();
- }
-
- private ITypeMappingUiProvider typeMappingUiProvider(String key) {
- for (ITypeMappingUiProvider provider : this.typeMappingUiProviders) {
- if (provider.key() == key) {
- return provider;
- }
- }
- throw new IllegalArgumentException("unsupported type mapping UI provider key: " + key);
- }
-
- private void typeMappingChanged(SelectionChangedEvent event) {
- if (isPopulating()) {
- return;
- }
- if (event.getSelection() instanceof StructuredSelection) {
- ITypeMappingUiProvider provider = (ITypeMappingUiProvider) ((StructuredSelection) event.getSelection()).getFirstElement();
- persistentType.setMappingKey(provider.key());
- }
- }
-
- @Override
- protected void doPopulate(IJpaContentNode persistentTypeNode) {
- persistentType = (IPersistentType) persistentTypeNode;
- populateMappingComboAndPage();
- }
-
- @Override
- protected void doPopulate() {
- populateMappingComboAndPage();
- }
-
- protected void engageListeners() {
- if (persistentType != null) {
- persistentType.eAdapters().add(persistentTypeListener);
- }
- }
-
- protected void disengageListeners() {
- if (persistentType != null) {
- persistentType.eAdapters().remove(persistentTypeListener);
- }
- }
-
- private void populateMappingComboAndPage() {
- if (persistentType == null) {
- currentMappingKey = null;
- typeMappingCombo.setInput(null);
- typeMappingCombo.setSelection(StructuredSelection.EMPTY);
-
- if (visibleMappingComposite != null) {
- visibleMappingComposite.populate(null);
- visibleMappingComposite = null;
- }
-
- return;
- }
-
- String mappingKey = persistentType.getMapping().getKey();
- setComboData(mappingKey, persistentType.candidateMappingKeys());
-
- populateMappingPage(mappingKey);
- }
-
- private void populateMappingPage(String mappingKey) {
- if (visibleMappingComposite != null) {
- if (mappingKey == currentMappingKey) {
- if (visibleMappingComposite != null) {
- visibleMappingComposite.populate(persistentType.getMapping());
- return;
- }
- }
- else {
- visibleMappingComposite.populate(null);
- // don't return
- }
- }
-
- currentMappingKey = mappingKey;
-
- IJpaComposite mappingComposite = mappingCompositeFor(mappingKey);
- typeMappingPageBook.showPage(mappingComposite.getControl());
-
- visibleMappingComposite = mappingComposite;
- visibleMappingComposite.populate(persistentType.getMapping());
- }
-
- private void setComboData(String mappingKey, Iterator availableMappingKeys) {
- if (persistentType != typeMappingCombo.getInput()) {
- typeMappingCombo.setInput(persistentType);
- }
-
- ITypeMappingUiProvider provider = typeMappingUiProvider(mappingKey);
- if (! provider.equals(((StructuredSelection) typeMappingCombo.getSelection()).getFirstElement())) {
- typeMappingCombo.setSelection(new StructuredSelection(provider));
- }
- }
-
- private IJpaComposite mappingCompositeFor(String key) {
- IJpaComposite mappingComposite = (IJpaComposite) composites.get(key);
- if (mappingComposite != null) {
- return mappingComposite;
- }
-
- mappingComposite = buildMappingComposite(typeMappingPageBook, key);
-
- if (mappingComposite != null) {
- composites.put(key, mappingComposite);
- }
-
- return mappingComposite;
- }
-
- protected IJpaComposite buildMappingComposite(PageBook pageBook, String key) {
- //TODO what about null composite?
- return typeMappingUiProvider(key).buildPersistentTypeMappingComposite(pageBook, this.commandStack, getWidgetFactory());
-// return new NullComposite(pageBook, commandStack);
- }
-
-//TODO focus??
-// public boolean setFocus() {
-// super.setFocus();
-// return typeMappingCombo.getCombo().setFocus();
-// }
-
- public void dispose() {
- disengageListeners();
- for (Iterator i = composites.values().iterator(); i.hasNext(); ) {
- ((IJpaComposite) i.next()).dispose();
- }
- super.dispose();
- }
-
- public IPersistentType getPersistentType() {
- return persistentType;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java
deleted file mode 100644
index 21c7550bda..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java
+++ /dev/null
@@ -1,193 +0,0 @@
-package org.eclipse.jpt.ui.internal.dialogs;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.StatusDialog;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.BasicMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddedIdMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddedMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.IdMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.ManyToManyMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.ManyToOneMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.OneToManyMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.OneToOneMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.TransientMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.VersionMappingUiProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class AddPersistentAttributeToXmlAndMapDialog extends StatusDialog
-{
- private XmlPersistentAttribute unmappedPersistentAttribute;
-
- private Label attributeLabel;
-
- private Text attributeText;
-
- private Label mappingLabel;
-
- private ComboViewer mappingCombo;
-
-
- public AddPersistentAttributeToXmlAndMapDialog(Shell parentShell, XmlPersistentAttribute unmappedPersistentAttribute) {
- super(parentShell);
- this.unmappedPersistentAttribute = unmappedPersistentAttribute;
- setTitle(JptUiMessages.AddPersistentAttributeDialog_title);
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
-
- Composite composite = new Composite(dialogArea, SWT.NULL);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setLayout(new GridLayout());
-
- attributeLabel = createLabel(composite, 1, JptUiMessages.AddPersistentAttributeDialog_attributeLabel);
-
- attributeText = createText(composite, 1);
-// attributeText.addModifyListener(
-// new ModifyListener() {
-// public void modifyText(ModifyEvent e) {
-// validate();
-// }
-// }
-// );
- attributeText.setText(unmappedPersistentAttribute.getName());
- attributeText.setEditable(false);
-
- mappingLabel = createLabel(composite, 1, JptUiMessages.AddPersistentClassDialog_mappingLabel);
-
- mappingCombo = new ComboViewer(createCombo(composite, 1));
- mappingCombo.setContentProvider(
- new IStructuredContentProvider() {
- public void dispose() {}
-
- public Object[] getElements(Object inputElement) {
- return new Object[] {
- BasicMappingUiProvider.instance(),
- IdMappingUiProvider.instance(),
- VersionMappingUiProvider.instance(),
- OneToOneMappingUiProvider.instance(),
- OneToManyMappingUiProvider.instance(),
- ManyToOneMappingUiProvider.instance(),
- ManyToManyMappingUiProvider.instance(),
- EmbeddedMappingUiProvider.instance(),
- EmbeddedIdMappingUiProvider.instance(),
- TransientMappingUiProvider.instance()
- };
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- });
- mappingCombo.setLabelProvider(
- new LabelProvider() {
- @Override
- public String getText(Object element) {
- return ((IAttributeMappingUiProvider) element).label();
- }
- });
- mappingCombo.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- validate();
- }
- });
- mappingCombo.setInput("FOO");
- mappingCombo.getCombo().select(0); // select Basic to begin
-
- // TODO - F1 Help
- // PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IDaliHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE);
-
- //getButton(IDialogConstants.OK_ID).setEnabled(false); // disabled to start
- applyDialogFont(dialogArea);
-
- validate();
-
- return dialogArea;
- }
-
- private Label createLabel(Composite container, int span, String text) {
- Label label = new Label(container, SWT.NONE);
- label.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- label.setLayoutData(gd);
- return label;
- }
-
- private Text createText(Composite container, int span) {
- Text text = new Text(container, SWT.BORDER | SWT.SINGLE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = span;
- gd.widthHint = 250;
- text.setLayoutData(gd);
- return text;
- }
-
- private Combo createCombo(Composite container, int span) {
- Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = span;
- combo.setLayoutData(gd);
- return combo;
- }
-
- private IJpaProject getJpaProject() {
- return unmappedPersistentAttribute.getJpaProject();
- }
-
- public String getAttributeName() {
- return attributeText.getText();
- }
-
- public String getMappingKey() {
- StructuredSelection selection = (StructuredSelection) mappingCombo.getSelection();
- return (selection.isEmpty()) ? null : ((IAttributeMappingUiProvider) selection.getFirstElement()).key();
- }
-
- private void validate() {
-// if (entityMappings.containsPersistentType(type)) {
-// updateStatus(
-// new Status(
-// IStatus.WARNING, JptUiPlugin.PLUGIN_ID,
-// JptUiMessages.AddPersistentClassDialog_duplicateClassWarning));
-// return;
-// }
-//
- String mappingKey = getMappingKey();
- if (mappingKey == null) {
- updateStatus(
- new Status(
- IStatus.ERROR, JptUiPlugin.PLUGIN_ID,
- JptUiMessages.AddPersistentAttributeDialog_noMappingKeyError));
- return;
- }
-
- updateStatus(Status.OK_STATUS);
- }
-
- @Override
- protected void okPressed() {
- unmappedPersistentAttribute.setSpecifiedMappingKey(getMappingKey());
- unmappedPersistentAttribute.setVirtual(false);
- super.okPressed();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentClassDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentClassDialog.java
deleted file mode 100644
index 1bd955bb30..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentClassDialog.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.dialogs;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.dialogs.StatusDialog;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddableUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.EntityUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.MappedSuperclassUiProvider;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.IProgressService;
-
-public class AddPersistentClassDialog extends StatusDialog
-{
- private EntityMappingsInternal entityMappings;
-
- private Label classLabel;
-
- private Text classText;
-
- private Button classBrowseButton;
-
- private Label mappingLabel;
-
- private ComboViewer mappingCombo;
-
-
- public AddPersistentClassDialog(Shell parentShell, EntityMappingsInternal entityMappings) {
- super(parentShell);
- this.entityMappings = entityMappings;
- setTitle(JptUiMessages.AddPersistentClassDialog_title);
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
-
- Composite composite = new Composite(dialogArea, SWT.NULL);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setLayout(new GridLayout(2, false));
-
- classLabel = createLabel(composite, 2, JptUiMessages.AddPersistentClassDialog_classLabel);
-
- classText = createText(composite, 1);
- classText.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validate();
- }
- }
- );
-
- classBrowseButton = createButton(composite, 1, JptUiMessages.General_browse);
- classBrowseButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- IType type = chooseType();
- if (type != null) {
- classText.setText(type.getFullyQualifiedName());
- }
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- mappingLabel = createLabel(composite, 2, JptUiMessages.AddPersistentClassDialog_mappingLabel);
-
- mappingCombo = new ComboViewer(createCombo(composite, 2));
- mappingCombo.setContentProvider(
- new IStructuredContentProvider() {
- public void dispose() {}
-
- public Object[] getElements(Object inputElement) {
- return new Object[] {
- new MappedSuperclassUiProvider(),
- new EntityUiProvider(),
- new EmbeddableUiProvider()
- };
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- });
- mappingCombo.setLabelProvider(
- new LabelProvider() {
- @Override
- public String getText(Object element) {
- return ((ITypeMappingUiProvider) element).label();
- }
- });
- mappingCombo.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- validate();
- }
- });
- mappingCombo.setInput("FOO");
- mappingCombo.getCombo().select(1); // select Entity to begin
-
- // TODO - F1 Help
- // PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IDaliHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE);
-
- //getButton(IDialogConstants.OK_ID).setEnabled(false); // disabled to start
- applyDialogFont(dialogArea);
-
- validate();
-
- return dialogArea;
- }
-
- private Label createLabel(Composite container, int span, String text) {
- Label label = new Label(container, SWT.NONE);
- label.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- label.setLayoutData(gd);
- return label;
- }
-
- private Text createText(Composite container, int span) {
- Text text = new Text(container, SWT.BORDER | SWT.SINGLE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = span;
- gd.widthHint = 250;
- text.setLayoutData(gd);
- return text;
- }
-
- private Button createButton(Composite container, int span, String text) {
- Button button = new Button(container, SWT.NONE);
- button.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- button.setLayoutData(gd);
- return button;
- }
-
- private Combo createCombo(Composite container, int span) {
- Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = span;
- combo.setLayoutData(gd);
- return combo;
- }
-
- private IJpaProject getJpaProject() {
- return entityMappings.getJpaProject();
- }
-
- public String getClassName() {
- return classText.getText();
- }
-
- public String getMappingKey() {
- StructuredSelection selection = (StructuredSelection) mappingCombo.getSelection();
- return (selection.isEmpty()) ? null : ((ITypeMappingUiProvider) selection.getFirstElement()).key();
- }
-
- protected IType chooseType() {
- IJavaElement[] elements= new IJavaElement[] { getJpaProject().getJavaProject() };
- IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements);
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
-
- SelectionDialog typeSelectionDialog;
- try {
- typeSelectionDialog =
- JavaUI.createTypeDialog(
- getShell(), service, scope,
- IJavaElementSearchConstants.CONSIDER_CLASSES,
- false, getClassName());
- }
- catch (JavaModelException e) {
- JptUiPlugin.log(e);
- throw new RuntimeException(e);
- }
- typeSelectionDialog.setTitle(JptUiMessages.AddPersistentClassDialog_classDialog_title);
- typeSelectionDialog.setMessage(JptUiMessages.AddPersistentClassDialog_classDialog_message);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
- return null;
- }
-
- private void validate() {
- String className = getClassName();
-
- if (StringTools.stringIsEmpty(className)) {
- updateStatus(
- new Status(
- IStatus.ERROR, JptUiPlugin.PLUGIN_ID,
- JptUiMessages.AddPersistentClassDialog_noClassError));
- return;
- }
-
- IType type;
- try {
- type = getJpaProject().getJavaProject().findType(className);
- }
- catch (JavaModelException jme) {
- type = null;
- }
-
- if (type == null) {
- updateStatus(
- new Status(
- IStatus.WARNING, JptUiPlugin.PLUGIN_ID,
- JptUiMessages.AddPersistentClassDialog_classNotFoundWarning));
- return;
- }
-
- if (entityMappings.containsPersistentType(type)) {
- updateStatus(
- new Status(
- IStatus.WARNING, JptUiPlugin.PLUGIN_ID,
- JptUiMessages.AddPersistentClassDialog_duplicateClassWarning));
- return;
- }
-
- String mappingKey = getMappingKey();
- if (mappingKey == null) {
- updateStatus(
- new Status(
- IStatus.ERROR, JptUiPlugin.PLUGIN_ID,
- JptUiMessages.AddPersistentClassDialog_noMappingKeyError));
- return;
- }
-
- updateStatus(Status.OK_STATUS);
- }
-
- @Override
- protected void okPressed() {
- entityMappings.addMapping(getClassName(), getMappingKey());
- super.okPressed();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/EntitiesGenerator.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/EntitiesGenerator.java
deleted file mode 100644
index 05fe71c01b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/EntitiesGenerator.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007 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.generic;
-
-import java.util.Collection;
-
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.core.internal.IJpaFile;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.core.internal.synch.SynchronizeClassesJob;
-import org.eclipse.jpt.gen.internal.EntityGenerator;
-import org.eclipse.jpt.gen.internal.PackageGenerator;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.wizards.GenerateEntitiesWizard;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * EntitiesGenerator
- */
-public class EntitiesGenerator
-{
- private IJpaProject project;
- private IStructuredSelection selection;
-
- // ********** constructors **********
-
- static public void generate( IJpaProject project, IStructuredSelection selection) {
- if(project == null) {
- throw new NullPointerException();
- }
- new EntitiesGenerator( project, selection).generate();
- }
-
- public EntitiesGenerator() {
- super();
- }
-
- private EntitiesGenerator( IJpaProject project, IStructuredSelection selection) {
- super();
- this.project = project;
- this.selection = selection;
- }
-
- // ********** behavior **********
-
- protected void generate() {
- GenerateEntitiesWizard wizard = new GenerateEntitiesWizard(this.project, this.selection);
-
- WizardDialog dialog = new WizardDialog(this.getCurrentShell(), wizard);
- dialog.create();
- int returnCode = dialog.open();
- if (returnCode == Window.OK) {
- IWorkspaceRunnable runnable = new GenerateEntitiesRunnable(
- wizard.getPackageGeneratorConfig(),
- wizard.getEntityGeneratorConfig(),
- wizard.getSelectedTables(),
- wizard.synchronizePersistenceXml(),
- project,
- new OverwriteConfirmer(this.getCurrentShell())
- );
- try {
- // TODO pass in real ProgressMonitor
- ResourcesPlugin.getWorkspace().run(runnable, new NullProgressMonitor());
- } catch (CoreException ex) {
- throw new RuntimeException(ex);
- }
- }
- }
-
- private Shell getCurrentShell() {
- return Display.getCurrent().getActiveShell();
- }
-
- // ********** runnable **********
-
- static class GenerateEntitiesRunnable implements IWorkspaceRunnable {
- private final PackageGenerator.Config packageConfig;
- private final EntityGenerator.Config entityConfig;
- private final Collection selectedTables;
- private final boolean synchronizePersistenceXml;
- private final EntityGenerator.OverwriteConfirmer overwriteConfirmer;
- private final IJpaProject project;
-
- GenerateEntitiesRunnable(
- PackageGenerator.Config packageConfig,
- EntityGenerator.Config entityConfig,
- Collection selectedTables,
- boolean synchronizePersistenceXml,
- IJpaProject project,
- EntityGenerator.OverwriteConfirmer overwriteConfirmer
- ) {
- super();
- this.packageConfig = packageConfig;
- this.entityConfig = entityConfig;
- this.selectedTables = selectedTables;
- this.synchronizePersistenceXml = synchronizePersistenceXml;
- this.overwriteConfirmer = overwriteConfirmer;
- this.project = project;
- }
-
- public void run(IProgressMonitor monitor) throws CoreException {
- monitor.beginTask("", 1000);
- try {
- PackageGenerator.generateEntities(this.packageConfig, this.entityConfig, this.selectedTables, this.overwriteConfirmer, monitor);
- if (synchronizePersistenceXml) {
- // we currently only support *one* persistence.xml file per project
- IJpaFile resource = project.getPlatform().validPersistenceXmlFiles().next();
- if (resource != null) {
- SynchronizeClassesJob job = new SynchronizeClassesJob(resource.getFile());
- job.schedule();
- }
- }
- } catch (OperationCanceledException ex) {
- // fall through and tell monitor we are done
- }
- monitor.done();
- }
-
- }
-
- // ********** overwrite confirmer **********
-
- static class OverwriteConfirmer implements EntityGenerator.OverwriteConfirmer {
- private Shell shell;
- private boolean overwriteAll = false;
- private boolean skipAll = false;
-
- OverwriteConfirmer(Shell shell) {
- super();
- this.shell = shell;
- }
-
- public boolean overwrite(String className) {
- if (this.overwriteAll) {
- return true;
- }
- if (this.skipAll) {
- return false;
- }
- return this.promptUser(className);
- }
-
- private boolean promptUser(String className) {
- OverwriteConfirmerDialog dialog = new OverwriteConfirmerDialog(this.shell, className);
- if (dialog.open() == Window.CANCEL) {
- throw new OperationCanceledException();
- }
- if (dialog.yes()) {
- return true;
- } else if (dialog.yesToAll()) {
- this.overwriteAll = true;
- return true;
- } else if (dialog.no()) {
- return false;
- } else if (dialog.noToAll()) {
- this.skipAll = true;
- return false;
- }
- throw new IllegalStateException();
- }
-
- }
-
- // ********** dialog **********
-
- static class OverwriteConfirmerDialog extends Dialog {
- private final String className;
- private boolean yes = false;
- private boolean yesToAll = false;
- private boolean no = false;
- private boolean noToAll = false;
-
- OverwriteConfirmerDialog(Shell parent, String className) {
- super(parent);
- this.className = className;
- }
-
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(JptUiMessages.OverwriteConfirmerDialog_title);
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout gridLayout = (GridLayout) composite.getLayout();
- gridLayout.numColumns = 2;
-
- Label text = new Label(composite, SWT.LEFT);
- text.setText(NLS.bind(JptUiMessages.OverwriteConfirmerDialog_text, this.className));
- text.setLayoutData(new GridData());
-
- return composite;
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- this.createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, false);
- this.createButton(parent, IDialogConstants.YES_TO_ALL_ID, IDialogConstants.YES_TO_ALL_LABEL, false);
- this.createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, true);
- this.createButton(parent, IDialogConstants.NO_TO_ALL_ID, IDialogConstants.NO_TO_ALL_LABEL, false);
- this.createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected void buttonPressed(int buttonId) {
- switch (buttonId) {
- case IDialogConstants.YES_ID :
- this.yesPressed();
- break;
- case IDialogConstants.YES_TO_ALL_ID :
- this.yesToAllPressed();
- break;
- case IDialogConstants.NO_ID :
- this.noPressed();
- break;
- case IDialogConstants.NO_TO_ALL_ID :
- this.noToAllPressed();
- break;
- case IDialogConstants.CANCEL_ID :
- this.cancelPressed();
- break;
- default :
- break;
- }
- }
-
- private void yesPressed() {
- this.yes = true;
- this.setReturnCode(OK);
- this.close();
- }
-
- private void yesToAllPressed() {
- this.yesToAll = true;
- this.setReturnCode(OK);
- this.close();
- }
-
- private void noPressed() {
- this.no = true;
- this.setReturnCode(OK);
- this.close();
- }
-
- private void noToAllPressed() {
- this.noToAll = true;
- this.setReturnCode(OK);
- this.close();
- }
-
- boolean yes() {
- return this.yes;
- }
-
- boolean yesToAll() {
- return this.yesToAll;
- }
-
- boolean no() {
- return this.no;
- }
-
- boolean noToAll() {
- return this.noToAll;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/GenericPlatformUi.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/GenericPlatformUi.java
deleted file mode 100644
index 0189ea62ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/generic/GenericPlatformUi.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.generic;
-
-import java.text.MessageFormat;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.ui.internal.BaseJpaPlatformUi;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class GenericPlatformUi extends BaseJpaPlatformUi
-{
- public GenericPlatformUi() {
- super();
- }
-
- public void generateDDL(IJpaProject project, IStructuredSelection selection) {
- this.displayNotSupportedMessage(JptUiMessages.GenericPlatformUiDialog_notSupportedMessageTitle, JptUiMessages.GenericPlatformUiDialog_notSupportedMessageText);
- }
-
- protected void displayNotSupportedMessage(String title, String message) {
- String formattedMessage = MessageFormat.format( message, (Object [])(new String [] { message}));
- Shell currentShell = Display.getCurrent().getActiveShell();
- MessageDialog.openInformation(currentShell, title, formattedMessage);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/IAttributeMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/IAttributeMappingUiProvider.java
deleted file mode 100644
index 4276feb345..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/IAttributeMappingUiProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IAttributeMapping;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-
-public interface IAttributeMappingUiProvider
-{
- /**
- * A unique string that corresponds to the key of a MappingProvider in the core
- * (IJavaAttributeMappingProvider and/or IXmlAttributeMappingProvider)
- */
- String key();
-
- /**
- * A label to be displayed to the label as an option in the mapping type combo box
- * @return
- */
- String label();
-
- /**
- * The IJpaComposite that correponds 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 parent
- * @param commandStack
- * @param widgetFactory
- * @return
- */
- IJpaComposite<IAttributeMapping> buildAttributeMappingComposite(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ITypeMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ITypeMappingUiProvider.java
deleted file mode 100644
index d614a57bf6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ITypeMappingUiProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public interface ITypeMappingUiProvider
-{
- /**
- * A unique string that corresponds to the key of a MappingProvider in the core
- */
- String key();
-
- /**
- * A label to be displayed to the label as an option in the mapping type combo box
- * @return
- */
- String label();
-
- /**
- * The IJpaComposite 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 parent
- * @param commandStack
- * @param widgetFactory
- * @return
- */
- IJpaComposite buildPersistentTypeMappingComposite(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaDetailsProvider.java
deleted file mode 100644
index 314f1c505c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaDetailsProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.details;
-
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.core.internal.content.java.IJavaContentNodes;
-import org.eclipse.jpt.ui.internal.details.IJpaDetailsPage;
-import org.eclipse.jpt.ui.internal.details.IJpaDetailsProvider;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class JavaDetailsProvider
- implements IJpaDetailsProvider
-{
- public JavaDetailsProvider() {
- super();
- }
-
- public String fileContentType() {
- return JavaCore.JAVA_SOURCE_CONTENT_TYPE;
- }
-
- public IJpaDetailsPage buildDetailsPage(
- Composite parentComposite, Object contentNodeId, TabbedPropertySheetWidgetFactory widgetFactory) {
- if (contentNodeId.equals(IJavaContentNodes.PERSISTENT_TYPE_ID)) {
- return new JavaPersistentTypeDetailsPage(parentComposite, widgetFactory);
- }
- else if (contentNodeId.equals(IJavaContentNodes.PERSISTENT_ATTRIBUTE_ID)) {
- return new JavaPersistentAttributeDetailsPage(parentComposite, widgetFactory);
- }
-
- return null;
- }
-
- public void dispose() {
- // no op ... for now
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentAttributeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentAttributeDetailsPage.java
deleted file mode 100644
index b249b9b1f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentAttributeDetailsPage.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.details;
-
-import org.eclipse.jpt.ui.internal.details.PersistentAttributeDetailsPage;
-import org.eclipse.jpt.ui.internal.widgets.CComboViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class JavaPersistentAttributeDetailsPage
- extends PersistentAttributeDetailsPage
-{
- public JavaPersistentAttributeDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- composite.setLayout(new GridLayout(2, false));
-
- GridData gridData;
-
- buildMappingLabel(composite);
-
- CComboViewer mappingCombo = buildMappingCombo(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- mappingCombo.getCombo().setLayoutData(gridData);
-
- PageBook book = buildMappingPageBook(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalSpan = 2;
- book.setLayoutData(gridData);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentTypeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentTypeDetailsPage.java
deleted file mode 100644
index 9b2d2735d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentTypeDetailsPage.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.details;
-
-import org.eclipse.jpt.ui.internal.details.PersistentTypeDetailsPage;
-import org.eclipse.jpt.ui.internal.widgets.CComboViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class JavaPersistentTypeDetailsPage extends
- PersistentTypeDetailsPage
-{
-
- public JavaPersistentTypeDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- composite.setLayout(gridLayout);
-
- buildTypeMappingLabel(composite);
-
- CComboViewer typeMappingCombo = buildTypeMappingCombo(composite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- typeMappingCombo.getCombo().setLayoutData(gridData);
-
- PageBook typeMappingPageBook = buildTypeMappingPageBook(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalSpan = 2;
- typeMappingPageBook.setLayoutData(gridData);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/BasicMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/BasicMappingUiProvider.java
deleted file mode 100644
index 72af6c56ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/BasicMappingUiProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.BasicComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class BasicMappingUiProvider
- implements IAttributeMappingUiProvider
-{
-
- // singleton
- private static final BasicMappingUiProvider INSTANCE = new BasicMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static IAttributeMappingUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private BasicMappingUiProvider() {
- super();
- }
-
- public String key() {
- return IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_BasicLabel;
- }
-
- public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new BasicComposite(parent, commandStack, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultBasicMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultBasicMappingUiProvider.java
deleted file mode 100644
index c01c35db5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultBasicMappingUiProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.BasicComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class DefaultBasicMappingUiProvider
- implements IAttributeMappingUiProvider
-{
- // singleton
- private static final DefaultBasicMappingUiProvider INSTANCE = new DefaultBasicMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static IAttributeMappingUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private DefaultBasicMappingUiProvider() {
- super();
- }
-
- public String key() {
- return IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return "Default (" + JptUiMappingsMessages.PersistentAttributePage_BasicLabel + ")";
- }
-
- public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new BasicComposite(parent, commandStack, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultEmbeddedMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultEmbeddedMappingUiProvider.java
deleted file mode 100644
index 57c4932b9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/DefaultEmbeddedMappingUiProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.EmbeddedComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class DefaultEmbeddedMappingUiProvider
- implements IAttributeMappingUiProvider
-{
- // singleton
- private static final DefaultEmbeddedMappingUiProvider INSTANCE = new DefaultEmbeddedMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static IAttributeMappingUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private DefaultEmbeddedMappingUiProvider() {
- super();
- }
-
- public String key() {
- return IMappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return "Default (" + JptUiMappingsMessages.PersistentAttributePage_EmbeddedLabel + ")";
- }
-
- public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new EmbeddedComposite(parent, commandStack, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddableUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddableUiProvider.java
deleted file mode 100644
index ca4a97ead2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddableUiProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.EmbeddableComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EmbeddableUiProvider implements ITypeMappingUiProvider
-{
- public String key() {
- return IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentTypePage_EmbeddableLabel;
- }
-
- public IJpaComposite buildPersistentTypeMappingComposite(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new EmbeddableComposite(parent, commandStack, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedIdMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedIdMappingUiProvider.java
deleted file mode 100644
index fb49af2125..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedIdMappingUiProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.EmbeddedIdComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EmbeddedIdMappingUiProvider
- implements IAttributeMappingUiProvider
-{
-
- // singleton
- private static final EmbeddedIdMappingUiProvider INSTANCE = new EmbeddedIdMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static IAttributeMappingUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private EmbeddedIdMappingUiProvider() {
- super();
- }
-
- public String key() {
- return IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_EmbeddedIdLabel;
- }
-
- public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new EmbeddedIdComposite(parent, commandStack, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedMappingUiProvider.java
deleted file mode 100644
index 4da937b273..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EmbeddedMappingUiProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.EmbeddedComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EmbeddedMappingUiProvider
- implements IAttributeMappingUiProvider
-{
-
- // singleton
- private static final EmbeddedMappingUiProvider INSTANCE = new EmbeddedMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static IAttributeMappingUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private EmbeddedMappingUiProvider() {
- super();
- }
-
- public String key() {
- return IMappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_EmbeddedLabel;
- }
-
- public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new EmbeddedComposite(parent, commandStack, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EntityUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EntityUiProvider.java
deleted file mode 100644
index 80d489a6ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/EntityUiProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.EntityComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EntityUiProvider implements ITypeMappingUiProvider
-{
- public String key() {
- return IMappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentTypePage_EntityLabel;
- }
-
- public IJpaComposite buildPersistentTypeMappingComposite(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new EntityComposite(parent, commandStack, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/IdMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/IdMappingUiProvider.java
deleted file mode 100644
index 199b0fbb64..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/IdMappingUiProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.IdComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class IdMappingUiProvider
- implements IAttributeMappingUiProvider
-{
- // singleton
- private static final IdMappingUiProvider INSTANCE = new IdMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static IAttributeMappingUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private IdMappingUiProvider() {
- super();
- }
-
- public String key() {
- return IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_IdLabel;
- }
-
- public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new IdComposite(parent, commandStack, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToManyMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToManyMappingUiProvider.java
deleted file mode 100644
index 8515d35dd0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToManyMappingUiProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.ManyToManyComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class ManyToManyMappingUiProvider
- implements IAttributeMappingUiProvider
-{
- // singleton
- private static final ManyToManyMappingUiProvider INSTANCE = new ManyToManyMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static IAttributeMappingUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private ManyToManyMappingUiProvider() {
- super();
- }
-
- public String key() {
- return IMappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_ManyToManyLabel;
- }
-
- public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new ManyToManyComposite(parent, commandStack, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToOneMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToOneMappingUiProvider.java
deleted file mode 100644
index c81832c397..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/ManyToOneMappingUiProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.ManyToOneComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class ManyToOneMappingUiProvider
- implements IAttributeMappingUiProvider
-{
- // singleton
- private static final ManyToOneMappingUiProvider INSTANCE = new ManyToOneMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static IAttributeMappingUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private ManyToOneMappingUiProvider() {
- super();
- }
-
- public String key() {
- return IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_ManyToOneLabel;
- }
-
- public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new ManyToOneComposite(parent, commandStack, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/MappedSuperclassUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/MappedSuperclassUiProvider.java
deleted file mode 100644
index aa7147685f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/MappedSuperclassUiProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.MappedSuperclassComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class MappedSuperclassUiProvider implements ITypeMappingUiProvider
-{
- public String key() {
- return IMappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentTypePage_MappedSuperclassLabel;
- }
-
- public IJpaComposite buildPersistentTypeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new MappedSuperclassComposite(parent, commandStack, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullAttributeMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullAttributeMappingUiProvider.java
deleted file mode 100644
index 1c160473b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullAttributeMappingUiProvider.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class NullAttributeMappingUiProvider
- implements IAttributeMappingUiProvider
-{
-
- // singleton
- private static final NullAttributeMappingUiProvider INSTANCE = new NullAttributeMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static IAttributeMappingUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private NullAttributeMappingUiProvider() {
- super();
- }
-
-
- public String key() {
- return null;
- }
-
- public String label() {
- return "";
- }
-
- public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new NullComposite(parent);
- }
-
-
- public static class NullComposite extends Composite
- implements IJpaComposite
- {
- NullComposite(Composite parent) {
- super(parent, SWT.NONE);
- }
-
- public void populate(EObject model) {
- // no op
- }
-
- @Override
- public void dispose() {
- super.dispose();
- }
- public Control getControl() {
- return this;
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullTypeMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullTypeMappingUiProvider.java
deleted file mode 100644
index b435bd597f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/NullTypeMappingUiProvider.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class NullTypeMappingUiProvider implements ITypeMappingUiProvider
-{
- public String key() {
- return null;
- }
-
- public String label() {
- return "";
- }
-
- public IJpaComposite buildPersistentTypeMappingComposite(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new NullComposite(parent);
- }
-
-
- public static class NullComposite extends Composite
- implements IJpaComposite
- {
- private Composite composite;
- NullComposite(Composite parent) {
- super(parent, SWT.NONE);
- this.composite = new Composite(parent, SWT.NONE);
- }
-
- public void populate(EObject model) {
- // no op
- }
-
- @Override
- public void dispose() {
- super.dispose();
- }
-
- public Control getControl() {
- return this.composite;
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToManyMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToManyMappingUiProvider.java
deleted file mode 100644
index bb130bc567..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToManyMappingUiProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.OneToManyComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class OneToManyMappingUiProvider
- implements IAttributeMappingUiProvider
-{
- // singleton
- private static final OneToManyMappingUiProvider INSTANCE = new OneToManyMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static IAttributeMappingUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OneToManyMappingUiProvider() {
- super();
- }
-
- public String key() {
- return IMappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_OneToManyLabel;
- }
-
- public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new OneToManyComposite(parent, commandStack, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToOneMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToOneMappingUiProvider.java
deleted file mode 100644
index 27fa225229..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/OneToOneMappingUiProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.OneToOneComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class OneToOneMappingUiProvider
- implements IAttributeMappingUiProvider
-{
-
- // singleton
- private static final OneToOneMappingUiProvider INSTANCE = new OneToOneMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static IAttributeMappingUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OneToOneMappingUiProvider() {
- super();
- }
-
- public String key() {
- return IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_OneToOneLabel;
- }
-
- public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new OneToOneComposite(parent, commandStack, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/TransientMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/TransientMappingUiProvider.java
deleted file mode 100644
index c8b48119d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/TransientMappingUiProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.TransientComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class TransientMappingUiProvider
- implements IAttributeMappingUiProvider
-{
-
- // singleton
- private static final TransientMappingUiProvider INSTANCE = new TransientMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static IAttributeMappingUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private TransientMappingUiProvider() {
- super();
- }
-
- public String key() {
- return IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_TransientLabel;
- }
-
- public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new TransientComposite(parent, commandStack, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/VersionMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/VersionMappingUiProvider.java
deleted file mode 100644
index 75f14dfaf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/mappings/properties/VersionMappingUiProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.java.mappings.properties;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.core.internal.IMappingKeys;
-import org.eclipse.jpt.ui.internal.details.IJpaComposite;
-import org.eclipse.jpt.ui.internal.java.details.IAttributeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.VersionComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class VersionMappingUiProvider
- implements IAttributeMappingUiProvider
-{
-
- // singleton
- private static final VersionMappingUiProvider INSTANCE = new VersionMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static IAttributeMappingUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private VersionMappingUiProvider() {
- super();
- }
-
- public String key() {
- return IMappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_VersionLabel;
- }
-
- public IJpaComposite buildAttributeMappingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new VersionComposite(parent, commandStack, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaCompilationUnitItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaCompilationUnitItemProvider.java
deleted file mode 100644
index e643328908..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaCompilationUnitItemProvider.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.java.structure;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.emf.edit.provider.ItemProviderAdapter;
-import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage;
-
-public class JavaCompilationUnitItemProvider extends ItemProviderAdapter
- implements IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider
-{
- public JavaCompilationUnitItemProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- @Override
- public Collection getChildrenFeatures(Object object) {
- if (childrenFeatures == null) {
- super.getChildrenFeatures(object);
- childrenFeatures.add(JpaJavaPackage.Literals.JPA_COMPILATION_UNIT__TYPES);
- }
- return childrenFeatures;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentAttributeItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentAttributeItemProvider.java
deleted file mode 100644
index 902c83233e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentAttributeItemProvider.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.java.structure;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.emf.edit.provider.ItemProviderAdapter;
-import org.eclipse.emf.edit.provider.ViewerNotification;
-import org.eclipse.jpt.core.internal.IAttributeMapping;
-import org.eclipse.jpt.core.internal.IPersistentAttribute;
-import org.eclipse.jpt.core.internal.JpaCorePackage;
-import org.eclipse.jpt.core.internal.mappings.IBasic;
-import org.eclipse.jpt.core.internal.mappings.IEmbedded;
-import org.eclipse.jpt.core.internal.mappings.IEmbeddedId;
-import org.eclipse.jpt.core.internal.mappings.IId;
-import org.eclipse.jpt.core.internal.mappings.IManyToMany;
-import org.eclipse.jpt.core.internal.mappings.IManyToOne;
-import org.eclipse.jpt.core.internal.mappings.IOneToMany;
-import org.eclipse.jpt.core.internal.mappings.IOneToOne;
-import org.eclipse.jpt.core.internal.mappings.ITransient;
-import org.eclipse.jpt.core.internal.mappings.IVersion;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsImages;
-
-public class JavaPersistentAttributeItemProvider extends ItemProviderAdapter
- implements IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider
-{
- public JavaPersistentAttributeItemProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- @Override
- public Object getImage(Object object) {
- IAttributeMapping mapping = ((IPersistentAttribute) object).getMapping();
-
- if (mapping instanceof IBasic) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.BASIC);
- }
- else if (mapping instanceof IId) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.ID);
- }
- else if (mapping instanceof IVersion) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.VERSION);
- }
- else if (mapping instanceof IEmbedded) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDED);
- }
- else if (mapping instanceof IEmbeddedId) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDED_ID);
- }
- else if (mapping instanceof IOneToOne) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.ONE_TO_ONE);
- }
- else if (mapping instanceof IOneToMany) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.ONE_TO_MANY);
- }
- else if (mapping instanceof IManyToOne) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.MANY_TO_ONE);
- }
- else if (mapping instanceof IManyToMany) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.MANY_TO_MANY);
- }
- else if (mapping instanceof ITransient) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.TRANSIENT);
- }
- else {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.NULL_ATTRIBUTE_MAPPING);
- }
- }
-
- @Override
- public String getText(Object object) {
- return ((IPersistentAttribute) object).getName();
- }
-
- @Override
- public void notifyChanged(Notification notification) {
- updateChildren(notification);
-
- switch (notification.getFeatureID(IPersistentAttribute.class)) {
- case JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING:
- fireNotifyChanged(new ViewerNotification(notification, notification
- .getNotifier(), false, true));
- return;
- }
- super.notifyChanged(notification);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentTypeItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentTypeItemProvider.java
deleted file mode 100644
index c1cd5bb875..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentTypeItemProvider.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.java.structure;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.emf.edit.provider.ItemProviderAdapter;
-import org.eclipse.emf.edit.provider.ViewerNotification;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.core.internal.IPersistentType;
-import org.eclipse.jpt.core.internal.ITypeMapping;
-import org.eclipse.jpt.core.internal.JpaCorePackage;
-import org.eclipse.jpt.core.internal.content.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage;
-import org.eclipse.jpt.core.internal.mappings.IEmbeddable;
-import org.eclipse.jpt.core.internal.mappings.IEntity;
-import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsImages;
-
-public class JavaPersistentTypeItemProvider extends ItemProviderAdapter
- implements IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider
-{
- public JavaPersistentTypeItemProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
-
- @Override
- protected Collection getChildrenFeatures(Object object) {
- if (childrenFeatures == null) {
- super.getChildrenFeatures(object);
- childrenFeatures.add(JpaJavaPackage.Literals.JAVA_PERSISTENT_TYPE__ATTRIBUTES);
- }
- return childrenFeatures;
- }
-
- @Override
- public Object getImage(Object object) {
- ITypeMapping mapping = ((IPersistentType) object).getMapping();
-
-
- if (mapping instanceof IEntity) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.ENTITY);
- }
- else if (mapping instanceof IEmbeddable) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDABLE);
- }
- else if (mapping instanceof IMappedSuperclass) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.MAPPED_SUPERCLASS);
- }
- else {
- return null;
- }
- }
-
- @Override
- public String getText(Object object) {
- IType type = ((IPersistentType) object).findJdtType();
- return (type == null) ? "" : type.getElementName();
- }
-
- @Override
- public void notifyChanged(Notification notification) {
- updateChildren(notification);
-
- switch (notification.getFeatureID(JavaPersistentType.class)) {
- case JpaCorePackage.IPERSISTENT_TYPE__MAPPING_KEY:
- fireNotifyChanged(
- new ViewerNotification(
- notification, notification.getNotifier(), false, true));
- return;
-
- case JpaJavaPackage.JAVA_PERSISTENT_TYPE__ATTRIBUTES:
- fireNotifyChanged(
- new ViewerNotification(
- notification, notification.getNotifier(), true, false));
- return;
- }
-
- super.notifyChanged(notification);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaStructureProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaStructureProvider.java
deleted file mode 100644
index a1af28c175..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaStructureProvider.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.java.structure;
-
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jpt.ui.internal.structure.IJpaStructureProvider;
-
-public class JavaStructureProvider implements IJpaStructureProvider
-{
- public String fileContentType() {
- return JavaCore.JAVA_SOURCE_CONTENT_TYPE;
- }
-
- public ITreeContentProvider buildContentProvider() {
- return new AdapterFactoryContentProvider(new JpaCoreJavaItemProviderAdapterFactory());
- }
-
- public ILabelProvider buildLabelProvider() {
- return new AdapterFactoryLabelProvider(new JpaCoreJavaItemProviderAdapterFactory());
- }
-
- public void dispose() {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JpaCoreJavaItemProviderAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JpaCoreJavaItemProviderAdapterFactory.java
deleted file mode 100644
index 730853482c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JpaCoreJavaItemProviderAdapterFactory.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.java.structure;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.edit.provider.ChangeNotifier;
-import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.IChangeNotifier;
-import org.eclipse.emf.edit.provider.IDisposable;
-import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.INotifyChangedListener;
-import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.jpt.core.internal.content.java.util.JpaJavaAdapterFactory;
-
-/**
- * This is the factory that is used to provide the interfaces needed to support Viewers.
- * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
- * The adapters also support Eclipse property sheets.
- * Note that most of the adapters are shared among multiple instances.
- */
-public class JpaCoreJavaItemProviderAdapterFactory
- extends JpaJavaAdapterFactory
- implements ComposeableAdapterFactory,
- IChangeNotifier,
- IDisposable
-{
- /**
- * This keeps track of the root adapter factory that delegates to this adapter factory.
- */
- protected ComposedAdapterFactory parentAdapterFactory;
-
- /**
- * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
- */
- protected IChangeNotifier changeNotifier = new ChangeNotifier();
-
- /**
- * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
- */
- protected Collection supportedTypes = new ArrayList();
-
-
- public JpaCoreJavaItemProviderAdapterFactory() {
- supportedTypes.add(IEditingDomainItemProvider.class);
- supportedTypes.add(IStructuredItemContentProvider.class);
- supportedTypes.add(ITreeItemContentProvider.class);
- supportedTypes.add(IItemLabelProvider.class);
- }
-
-
- protected JavaCompilationUnitItemProvider javaCompilationUnitItemProvider;
-
- public Adapter createJpaCompilationUnitAdapter() {
- if (javaCompilationUnitItemProvider == null) {
- javaCompilationUnitItemProvider = new JavaCompilationUnitItemProvider(this);
- }
-
- return javaCompilationUnitItemProvider;
- }
-
- protected JavaPersistentTypeItemProvider javaPersistentTypeItemProvider;
-
- public Adapter createJavaPersistentTypeAdapter() {
- if (javaPersistentTypeItemProvider == null) {
- javaPersistentTypeItemProvider = new JavaPersistentTypeItemProvider(this);
- }
-
- return javaPersistentTypeItemProvider;
- }
-
- protected JavaPersistentAttributeItemProvider javaPersistentAttributeItemProvider;
-
- public Adapter createJavaPersistentAttributeAdapter() {
- if (javaPersistentAttributeItemProvider == null) {
- javaPersistentAttributeItemProvider = new JavaPersistentAttributeItemProvider(
- this);
- }
-
- return javaPersistentAttributeItemProvider;
- }
-
- /**
- * This returns the root adapter factory that contains this factory.
- */
- public ComposeableAdapterFactory getRootAdapterFactory() {
- return parentAdapterFactory == null ?
- this :
- parentAdapterFactory.getRootAdapterFactory();
- }
-
- /**
- * This sets the composed adapter factory that contains this factory.
- */
- public void setParentAdapterFactory(
- ComposedAdapterFactory parentAdapterFactory) {
- this.parentAdapterFactory = parentAdapterFactory;
- }
-
- public boolean isFactoryForType(Object type) {
- return supportedTypes.contains(type) || super.isFactoryForType(type);
- }
-
- /**
- * This implementation substitutes the factory itself as the key for the adapter.
- */
- public Adapter adapt(Notifier notifier, Object type) {
- return super.adapt(notifier, this);
- }
-
- public Object adapt(Object object, Object type) {
- if (isFactoryForType(type)) {
- Object adapter = super.adapt(object, type);
- if (!(type instanceof Class)
- || (((Class) type).isInstance(adapter))) {
- return adapter;
- }
- }
-
- return null;
- }
-
- /**
- * This adds a listener.
- */
- public void addListener(INotifyChangedListener notifyChangedListener) {
- changeNotifier.addListener(notifyChangedListener);
- }
-
- /**
- * This removes a listener.
- */
- public void removeListener(INotifyChangedListener notifyChangedListener) {
- changeNotifier.removeListener(notifyChangedListener);
- }
-
- /**
- * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
- */
- public void fireNotifyChanged(Notification notification) {
- changeNotifier.fireNotifyChanged(notification);
-
- if (parentAdapterFactory != null) {
- parentAdapterFactory.fireNotifyChanged(notification);
- }
- }
-
- /**
- * This disposes all of the item providers created by this factory.
- */
- public void dispose() {
- if (javaCompilationUnitItemProvider != null) {
- javaCompilationUnitItemProvider.dispose();
- }
- if (javaPersistentTypeItemProvider != null) {
- javaPersistentTypeItemProvider.dispose();
- }
- if (javaPersistentAttributeItemProvider != null) {
- javaPersistentAttributeItemProvider.dispose();
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullLabelProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullLabelProvider.java
deleted file mode 100644
index 7fb66541d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullLabelProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.jface;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-
-public class NullLabelProvider
- implements ILabelProvider
-{
- public static NullLabelProvider INSTANCE = new NullLabelProvider();
-
-
- private NullLabelProvider() {
- super();
- }
-
-
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return null;
- }
-
- public void addListener(ILabelProviderListener listener) {}
-
- public void dispose() {}
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {}
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullTreeContentProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullTreeContentProvider.java
deleted file mode 100644
index 864a29b08f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullTreeContentProvider.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.jface;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-public class NullTreeContentProvider
- implements ITreeContentProvider
-{
- public static NullTreeContentProvider INSTANCE = new NullTreeContentProvider();
-
-
- private NullTreeContentProvider() {
- super();
- }
-
-
- public Object[] getChildren(Object parentElement) {
- return new Object[0];
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return false;
- }
-
- public Object[] getElements(Object inputElement) {
- return new Object[0];
- }
-
- public void dispose() {}
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsImages.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsImages.java
deleted file mode 100644
index 7acab93e34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsImages.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings;
-
-import org.eclipse.jpt.ui.internal.JptUiPlugin;
-import org.eclipse.swt.graphics.Image;
-
-public class JptUiMappingsImages
-{
- public final static String BASIC = "full/obj16/basic";
-
- public final static String EMBEDDABLE = "full/obj16/embeddable";
-
- public final static String EMBEDDED = "full/obj16/embedded";
-
- public final static String EMBEDDED_ID = "full/obj16/embedded-id";
-
- public final static String ENTITY = "full/obj16/entity";
-
- public final static String ENTITY_MAPPINGS = "full/obj16/entity-mappings";
-
- public final static String ID = "full/obj16/id";
-
- public final static String NULL_ATTRIBUTE_MAPPING = "full/obj16/null-attribute-mapping";
-
- public final static String MANY_TO_MANY = "full/obj16/many-to-many";
-
- public final static String MANY_TO_ONE = "full/obj16/many-to-one";
-
- public final static String MAPPED_SUPERCLASS = "full/obj16/mapped-superclass";
-
- public final static String NULL_TYPE_MAPPING = "full/obj16/null-type-mapping";
-
- public final static String ONE_TO_MANY = "full/obj16/one-to-many";
-
- public final static String ONE_TO_ONE = "full/obj16/one-to-one";
-
- public final static String TEMPORAL = "full/obj16/temporal";
-
- public final static String TRANSIENT = "full/obj16/transient";
-
- public final static String VERSION = "full/obj16/version";
-
-
- public static Image getImage(String imageLocator) {
- return JptUiPlugin.getPlugin().getImageDescriptor(imageLocator).createImage();
- }
-
-
- private JptUiMappingsImages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsMessages.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsMessages.java
deleted file mode 100644
index 03380e75d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsMessages.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings;
-
-import org.eclipse.osgi.util.NLS;
-
-public class JptUiMappingsMessages extends NLS
-{
- private static final String BUNDLE_NAME = "jpt_ui_mappings"; //$NON-NLS-1$
-
- public static String PersistentTypePage_EntityLabel;
- public static String PersistentTypePage_EmbeddableLabel;
- public static String PersistentTypePage_MappedSuperclassLabel;
-
- public static String PersistentAttributePage_BasicLabel;
- public static String PersistentAttributePage_TransientLabel;
- public static String PersistentAttributePage_IdLabel;
- public static String PersistentAttributePage_OneToManyLabel;
- public static String PersistentAttributePage_ManyToOneLabel;
- public static String PersistentAttributePage_ManyToManyLabel;
- public static String PersistentAttributePage_VersionLabel;
- public static String PersistentAttributePage_EmbeddedLabel;
- public static String PersistentAttributePage_EmbeddedIdLabel;
- public static String PersistentAttributePage_OneToOneLabel;
-
-
- public static String EntityGeneralSection_nameDefaultWithOneParam;
- public static String EntityGeneralSection_nameDefaultEmpty;
- public static String EntityGeneralSection_name;
-
- public static String BasicGeneralSection_name;
- public static String BasicGeneralSection_nameDefault;
- public static String BasicGeneralSection_fetchLabel;
- public static String BasicGeneralSection_optionalLabel;
- public static String BasicGeneralSection_lobLabel;
- public static String BasicGeneralSection_temporalLabel;
- public static String BasicGeneralSection_enumeratedLabel;
-
- public static String EntityComposite_tableDefault;
- public static String EntityComposite_tableNoDefaultSpecified;
- public static String EntityComposite_inheritance;
- public static String TableComposite_tableSection;
- public static String TableComposite_defaultEmpty;
- public static String TableComposite_defaultWithOneParam;
-
- public static String TableChooser_label;
- public static String CatalogChooser_label;
- public static String SchemaChooser_label;
-
- public static String ColumnChooser_label;
- public static String ColumnTableChooser_label;
-
- public static String TargetEntityChooser_label;
- public static String TargetEntityChooser_defaultEmpty;
- public static String TargetEntityChooser_defaultWithOneParam;
- public static String TargetEntityChooser_browse;
-
- public static String NonOwningMapping_mappedByLabel;
-
- public static String JoinTableComposite_add;
- public static String JoinTableComposite_defaultEmpty;
- public static String JoinTableComposite_defaultWithOneParam;
- public static String JoinTableComposite_edit;
- public static String JoinTableComposite_inverseJoinColumn;
- public static String JoinTableComposite_joinColumn;
- public static String JoinTableComposite_mappingBetweenTwoParams;
- public static String JoinTableComposite_mappingBetweenTwoParamsDefault;
- public static String JoinTableComposite_mappingBetweenTwoParamsBothDefault;
- public static String JoinTableComposite_mappingBetweenTwoParamsFirstDefault;
- public static String JoinTableComposite_mappingBetweenTwoParamsSecDefault;
- public static String JoinTableComposite_name;
- public static String JoinTableComposite_remove;
- public static String JoinTableComposite_overrideDefaultJoinColumns;
- public static String JoinTableComposite_overrideDefaultInverseJoinColumns;
-
- public static String JoinColumnDialog_addJoinColumn;
- public static String JoinColumnDialog_editJoinColumn;
- public static String JoinColumnDialog_name;
- public static String JoinColumnDialog_insertable;
- public static String JoinColumnDialog_updatable;
- public static String JoinColumnDialog_defaultWithOneParam;
- public static String JoinColumnDialog_referencedColumnName;
- public static String JoinColumnDialog_table;
-
- public static String InverseJoinColumnDialog_defaultWithOneParam;
- public static String InverseJoinColumnDialog_editInverseJoinColumn;
-
-
- public static String MultiRelationshipMappingComposite_cascadeType;
- public static String MultiRelationshipMappingComposite_fetchType;
- public static String MultiRelationshipMappingComposite_general;
- public static String MultiRelationshipMappingComposite_joinTable;
- public static String MultiRelationshipMappingComposite_mappedBy;
- public static String MultiRelationshipMappingComposite_targetEntity;
-
- public static String ColumnComposite_columnSection;
- public static String ColumnComposite_defaultWithOneParam;
- public static String ColumnComposite_defaultEmpty;
- public static String ColumnComposite_insertable;
- public static String ColumnComposite_updatable;
-
- public static String JoinColumnComposite_defaultEmpty;
- public static String JoinColumnComposite_defaultWithOneParam;
- public static String JoinColumnComposite_joinColumn;
- public static String JoinColumnComposite_name;
- public static String JoinColumnComposite_add;
- public static String JoinColumnComposite_edit;
- public static String JoinColumnComposite_mappingBetweenTwoParams;
- public static String JoinColumnComposite_mappingBetweenTwoParamsDefault;
- public static String JoinColumnComposite_mappingBetweenTwoParamsBothDefault;
- public static String JoinColumnComposite_mappingBetweenTwoParamsFirstDefault;
- public static String JoinColumnComposite_mappingBetweenTwoParamsSecDefault;
- public static String JoinColumnComposite_remove;
- public static String JoinColumnComposite_overrideDefaultJoinColumns;
-
- public static String PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns;
- public static String PrimaryKeyJoinColumnsComposite_add;
- public static String PrimaryKeyJoinColumnsComposite_edit;
- public static String PrimaryKeyJoinColumnsComposite_remove;
- public static String PrimaryKeyJoinColumnsComposite_defaultEmpty;
- public static String PrimaryKeyJoinColumnsComposite_defaultWithOneParam;
- public static String PrimaryKeyJoinColumnsComposite_primaryKeyJoinColumn;
- public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParams;
- public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsDefault;
- public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsBothDefault;
- public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsFirstDefault;
- public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsSecDefault;
-
- public static String AttributeOverridesComposite_attributeOverrides;
- public static String AttributeOverridesComposite_overridDefault;
- public static String OverridesComposite_joinColumn;
-
- public static String InheritanceComposite_default;
- public static String InheritanceComposite_strategy;
- public static String InheritanceComposite_discriminatorValue;
- public static String InheritanceComposite_discriminatorValueDefaultWithOneParam;
-
- public static String DiscriminatorColumnComposite_defaultEmpty;
- public static String DiscriminatorColumnComposite_column;
- public static String DiscriminatorColumnComposite_discriminatorType;
-
- public static String GeneratedValueComposite_generatedValue;
- public static String GeneratedValueComposite_generatorName;
- public static String GeneratedValueComposite_strategy;
-
- public static String TableGeneratorComposite_default;
- public static String TableGeneratorComposite_name;
- public static String TableGeneratorComposite_pkColumn;
- public static String TableGeneratorComposite_pkColumnValue;
- public static String TableGeneratorComposite_table;
- public static String TableGeneratorComposite_tableGenerator;
- public static String TableGeneratorComposite_valueColumn;
-
- public static String SequenceGeneratorComposite_sequenceGenerator;
- public static String SequenceGeneratorComposite_name;
- public static String SequenceGeneratorComposite_sequence;
- public static String SequenceGeneratorComposite_default;
-
- public static String IdMappingComposite_pk_generation;
- public static String IdMappingComposite_primaryKeyGeneration;
- public static String IdMappingComposite_tableGenerator;
- public static String IdMappingComposite_sequenceGenerator;
-
- public static String OrderByComposite_orderByGroup;
- public static String OrderByComposite_noOrdering;
- public static String OrderByComposite_primaryKeyOrdering;
- public static String OrderByComposite_customOrdering;
- public static String OrderByComposite_orderByLabel;
-
- public static String SecondaryTablesComposite_secondaryTables;
- public static String SecondaryTablesComposite_add;
- public static String SecondaryTablesComposite_edit;
- public static String SecondaryTablesComposite_remove;
-
- public static String SecondaryTableDialog_editSecondaryTable;
- public static String SecondaryTableDialog_name;
- public static String SecondaryTableDialog_catalog;
- public static String SecondaryTableDialog_schema;
- public static String SecondaryTableDialog_defaultSchema;
- public static String SecondaryTableDialog_defaultCatalog;
-
- public static String AccessTypeCombo_default;
- public static String EnumComboViewer_default;
- public static String MetaDataCompleteCombo_Default;
- public static String JoinColumnDialog_defaultTrue;
- public static String InheritanceComposite_defaultDiscriminatorType;
- public static String GeneratedValueComposite_default;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, JptUiMappingsMessages.class);
- }
-
- private JptUiMappingsMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialog.java
deleted file mode 100644
index 2435c30c6f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialog.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-//if there is only 1 joinColumn and the user is editing it, they should be
-//able to define defaults. otherwise, we probably shouldn't allow it.
-public abstract class AbstractJoinColumnDialog<E extends IAbstractJoinColumn> extends Dialog {
-
- //if creating a new JoinColumn, this will be null,
- //specify the JoinColumnOwner instead in the appropriate construtor
- private E joinColumn;
-
- private Combo nameCombo;
- private Combo referencedColumnNameCombo;
-
- private boolean defaultNameSelected;
- private String selectedName;
- private boolean defaultReferencedColumnNameSelected;
- private String selectedReferencedColumnName;
-
- AbstractJoinColumnDialog(Shell parent) {
- super(parent);
- }
-
- AbstractJoinColumnDialog(Shell parent, E joinColumn) {
- super(parent);
- this.joinColumn = joinColumn;
- }
-
- protected String getAddTitle() {
- return JptUiMappingsMessages.JoinColumnDialog_addJoinColumn;
- }
-
- protected String getEditTitle() {
- return JptUiMappingsMessages.JoinColumnDialog_editJoinColumn;
- }
-
- protected Control createDialogArea(Composite parent) {
- if (this.joinColumn == null) {
- getShell().setText(getAddTitle());
- }
- else {
- getShell().setText(getEditTitle());
- }
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout gridLayout = (GridLayout) composite.getLayout();
- gridLayout.numColumns = 2;
-
- Label nameLabel = new Label(composite, SWT.LEFT);
- nameLabel.setText(JptUiMappingsMessages.JoinColumnDialog_name);
- GridData gridData = new GridData();
- nameLabel.setLayoutData(gridData);
-
- this.nameCombo = new Combo(composite, SWT.LEFT);
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.nameCombo.setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.nameCombo, IJpaHelpContextIds.MAPPING_JOIN_COLUMN_NAME);
- populateNameCombo();
-
- Label referencedColumnNameLabel = new Label(composite, SWT.LEFT);
- referencedColumnNameLabel.setText(JptUiMappingsMessages.JoinColumnDialog_referencedColumnName);
- gridData = new GridData();
- referencedColumnNameLabel.setLayoutData(gridData);
-
- this.referencedColumnNameCombo = new Combo(composite, SWT.LEFT);
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.referencedColumnNameCombo.setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.referencedColumnNameCombo, IJpaHelpContextIds.MAPPING_JOIN_REFERENCED_COLUMN);
- populateReferencedNameCombo();
-
- return composite;
- }
-
- protected void populateNameCombo() {
- this.nameCombo.removeAll();
- if (getJoinColumn() != null) {
- this.nameCombo.add(NLS.bind(JptUiMappingsMessages.JoinColumnDialog_defaultWithOneParam, getJoinColumn().getDefaultName()));
- }
- Table table = getNameTable();
- if (table != null) {
- for (Iterator i = table.columnNames(); i.hasNext(); ) {
- this.nameCombo.add((String) i.next());
- }
- }
- if (getJoinColumn() != null) {
- if (getJoinColumn().getSpecifiedName() != null) {
- this.nameCombo.setText(getJoinColumn().getSpecifiedName());
- }
- else {
- this.nameCombo.select(0);
- }
- }
- }
-
- protected Combo getNameCombo() {
- return this.nameCombo;
- }
-
- protected Combo getReferencedColumnNameCombo() {
- return this.referencedColumnNameCombo;
- }
-
- protected abstract Table getNameTable();
-
- protected abstract Table getReferencedNameTable();
-
- protected void populateReferencedNameCombo() {
- if (getJoinColumn() != null) {
- this.referencedColumnNameCombo.add(NLS.bind(JptUiMappingsMessages.JoinColumnDialog_defaultWithOneParam, getJoinColumn().getDefaultReferencedColumnName()));
- }
- Table referencedNameTable = getReferencedNameTable();
- if (referencedNameTable != null) {
- for (Iterator i = referencedNameTable.columnNames(); i.hasNext(); ) {
- this.referencedColumnNameCombo.add((String) i.next());
- }
- }
- if (getJoinColumn() != null) {
- if (getJoinColumn().getSpecifiedReferencedColumnName() != null) {
- this.referencedColumnNameCombo.setText(getJoinColumn().getSpecifiedReferencedColumnName());
- }
- else {
- this.referencedColumnNameCombo.select(0);
- }
- }
- }
-
- protected E getJoinColumn() {
- return this.joinColumn;
- }
-
- protected boolean isDefaultNameSelected() {
- return this.defaultNameSelected;
- }
-
- protected String getSelectedName() {
- return this.selectedName;
- }
-
- protected boolean isDefaultReferencedColumnNameSelected() {
- return this.defaultReferencedColumnNameSelected;
- }
-
- protected String getReferencedColumnName() {
- return this.selectedReferencedColumnName;
- }
-
- public boolean close() {
- this.defaultNameSelected = this.nameCombo.getSelectionIndex() == 0;
- this.selectedName = this.nameCombo.getText();
- this.defaultReferencedColumnNameSelected = this.referencedColumnNameCombo.getSelectionIndex() == 0;
- this.selectedReferencedColumnName = this.referencedColumnNameCombo.getText();
- return super.close();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/BasicComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/BasicComposite.java
deleted file mode 100644
index 3a2542b73e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/BasicComposite.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType;
-import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean;
-import org.eclipse.jpt.core.internal.mappings.EnumType;
-import org.eclipse.jpt.core.internal.mappings.IBasic;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.core.internal.mappings.TemporalType;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class BasicComposite extends BaseJpaComposite
-{
- private IBasic basic;
-
- private ColumnComposite columnComposite;
-
- private EnumComboViewer fetchTypeComboViewer;
- private EnumComboViewer optionalComboViewer;
- private LobCheckBox lobCheckBox;
- private EnumComboViewer temporalTypeViewer;
- private EnumComboViewer enumeratedTypeViewer;
-
- public BasicComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
-
- Control generalControl = buildGeneralComposite(composite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- generalControl.setLayoutData(gridData);
-
- }
-
- private Control buildGeneralComposite(Composite composite) {
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-
- Composite generalComposite = getWidgetFactory().createComposite(composite);
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- generalComposite.setLayout(layout);
-
- this.columnComposite = new ColumnComposite(generalComposite, this.commandStack, getWidgetFactory());
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalSpan = 2;
- this.columnComposite.getControl().setLayoutData(gridData);
-
- CommonWidgets.buildFetchLabel(generalComposite, getWidgetFactory());
- this.fetchTypeComboViewer = CommonWidgets.buildFetchTypeComboViewer(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.fetchTypeComboViewer.getControl().setLayoutData(gridData);
- helpSystem.setHelp(fetchTypeComboViewer.getControl(), IJpaHelpContextIds.MAPPING_FETCH_TYPE);
-
- CommonWidgets.buildOptionalLabel(generalComposite, getWidgetFactory());
- this.optionalComboViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.optionalComboViewer.getControl().setLayoutData(gridData);
- helpSystem.setHelp(optionalComboViewer.getControl(), IJpaHelpContextIds.MAPPING_OPTIONAL);
-
- CommonWidgets.buildTemporalLabel(generalComposite, getWidgetFactory());
- this.temporalTypeViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.temporalTypeViewer.getControl().setLayoutData(gridData);
- helpSystem.setHelp(temporalTypeViewer.getControl(), IJpaHelpContextIds.MAPPING_TEMPORAL);
-
- CommonWidgets.buildEnumeratedLabel(generalComposite, getWidgetFactory());
- this.enumeratedTypeViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.enumeratedTypeViewer.getControl().setLayoutData(gridData);
- helpSystem.setHelp(enumeratedTypeViewer.getControl(), IJpaHelpContextIds.MAPPING_ENUMERATED);
-
- this.lobCheckBox = buildLobCheckBox(generalComposite);
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalSpan = 2;
- this.lobCheckBox.getControl().setLayoutData(gridData);
- helpSystem.setHelp(lobCheckBox.getControl(), IJpaHelpContextIds.MAPPING_LOB);
-
- return generalComposite;
- }
-
- private LobCheckBox buildLobCheckBox(Composite parent) {
- return new LobCheckBox(parent, this.commandStack, getWidgetFactory());
- }
-
- public void doPopulate(EObject obj) {
- this.basic = (IBasic) obj;
- if (this.basic != null) {
- this.columnComposite.populate(this.basic.getColumn());
- }
- else {
- this.columnComposite.populate(null);
- }
- this.fetchTypeComboViewer.populate(new FetchHolder(this.basic));
- this.optionalComboViewer.populate(new OptionalHolder(this.basic));
- this.lobCheckBox.populate(this.basic);
- this.temporalTypeViewer.populate(new TemporalTypeHolder(this.basic));
- this.enumeratedTypeViewer.populate(new EnumeratedTypeHolder(this.basic));
- }
-
- public void doPopulate() {
- this.columnComposite.populate();
- this.fetchTypeComboViewer.populate();
- this.optionalComboViewer.populate();
- this.lobCheckBox.populate();
- this.temporalTypeViewer.populate();
- this.enumeratedTypeViewer.populate();
- }
-
- protected void engageListeners() {
- }
-
- protected void disengageListeners() {
- }
-
- @Override
- public void dispose() {
- this.columnComposite.dispose();
- this.fetchTypeComboViewer.dispose();
- this.optionalComboViewer.dispose();
- this.lobCheckBox.dispose();
- this.temporalTypeViewer.dispose();
- this.enumeratedTypeViewer.dispose();
- super.dispose();
- }
-
- protected IBasic getBasic() {
- return this.basic;
- }
-
- private class FetchHolder extends EObjectImpl implements EnumHolder {
-
- private IBasic basic;
-
- FetchHolder(IBasic basic) {
- super();
- this.basic = basic;
- }
-
- public Object get() {
- return this.basic.getFetch();
- }
-
- public void set(Object enumSetting) {
- this.basic.setFetch((DefaultEagerFetchType) enumSetting);
-
- }
-
- public Class featureClass() {
- return IBasic.class;
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.IBASIC__FETCH;
- }
-
- public EObject wrappedObject() {
- return this.basic;
- }
-
- public Object[] enumValues() {
- return DefaultEagerFetchType.VALUES.toArray();
- }
-
- public Object defaultValue() {
- return DefaultEagerFetchType.DEFAULT;
- }
-
- public String defaultString() {
- //TODO move this out of the UI into the model
- return "Eager";
- }
- }
-
-
- private class OptionalHolder extends EObjectImpl implements EnumHolder {
-
- private IBasic basic;
-
- OptionalHolder(IBasic basic) {
- super();
- this.basic = basic;
- }
-
- public Object get() {
- return this.basic.getOptional();
- }
-
- public void set(Object enumSetting) {
- this.basic.setOptional((DefaultTrueBoolean) enumSetting);
- }
-
- public Class featureClass() {
- return IBasic.class;
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.IBASIC__OPTIONAL;
- }
-
- public EObject wrappedObject() {
- return this.basic;
- }
-
- public Object[] enumValues() {
- return DefaultTrueBoolean.VALUES.toArray();
- }
-
- public Object defaultValue() {
- return DefaultTrueBoolean.DEFAULT;
- }
-
- public String defaultString() {
- //TODO move this out of the UI into the model
- return "True";
- }
-
- }
-
-
- private class TemporalTypeHolder extends EObjectImpl implements EnumHolder {
-
- private IBasic basic;
-
- TemporalTypeHolder(IBasic basic) {
- super();
- this.basic = basic;
- }
-
- public Object get() {
- return this.basic.getTemporal();
- }
-
- public void set(Object enumSetting) {
- this.basic.setTemporal((TemporalType) enumSetting);
- }
-
- public Class featureClass() {
- return IBasic.class;
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.IBASIC__TEMPORAL;
- }
-
- public EObject wrappedObject() {
- return this.basic;
- }
-
- public Object[] enumValues() {
- return TemporalType.VALUES.toArray();
- }
-
- /**
- * TemporalType has no Default, return null
- */
- public Object defaultValue() {
- return null;
- }
-
- /**
- * TemporalType has no Default, return null
- */
- public String defaultString() {
- return null;
- }
- }
-
- private class EnumeratedTypeHolder extends EObjectImpl implements EnumHolder {
-
- private IBasic basic;
-
- EnumeratedTypeHolder(IBasic basic) {
- super();
- this.basic = basic;
- }
-
- public Object get() {
- return this.basic.getEnumerated();
- }
-
- public void set(Object enumSetting) {
- this.basic.setEnumerated((EnumType) enumSetting);
- }
-
- public Class featureClass() {
- return IBasic.class;
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.IBASIC__ENUMERATED;
- }
-
- public EObject wrappedObject() {
- return this.basic;
- }
-
- public Object[] enumValues() {
- return EnumType.VALUES.toArray();
- }
-
- public Object defaultValue() {
- return EnumType.DEFAULT;
- }
-
- public String defaultString() {
- //TODO move this out of the UI into the model
- return "Ordinal";
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java
deleted file mode 100644
index a2eb0eb160..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.ICascade;
-import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class CascadeComposite extends BaseJpaComposite
-{
- private IRelationshipMapping relationshipMapping;
- private ICascade cascade;
-
- private Adapter relationshipMappingListener;
- private Adapter cascadeListener;
-
-
- private Button allCheckBox;
- private Button persistCheckBox;
- private Button mergeCheckBox;
- private Button removeCheckBox;
- private Button refreshCheckBox;
-
- public CascadeComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.relationshipMappingListener = buildRelationshipMappingListener();
- this.cascadeListener = buildCascadeListener();
- }
-
- private Adapter buildRelationshipMappingListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- relationshipMappingChanged(notification);
- }
- };
- }
-
- private Adapter buildCascadeListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- cascadeChanged(notification);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- composite.setLayout(new FillLayout());
-
- Group cascadeGroup = getWidgetFactory().createGroup(composite, "Cascade");
- GridLayout layout = new GridLayout(5, false);
- cascadeGroup.setLayout(layout);
-
- GridData gridData;
-
- this.allCheckBox = createAllCheckBox(cascadeGroup);
- gridData = new GridData();
- this.allCheckBox.setLayoutData(gridData);
-
- this.persistCheckBox = createPersistCheckBox(cascadeGroup);
- gridData = new GridData();
- this.persistCheckBox.setLayoutData(gridData);
-
- this.mergeCheckBox = createMergeCheckBox(cascadeGroup);
- gridData = new GridData();
- this.mergeCheckBox.setLayoutData(gridData);
-
- this.removeCheckBox = createRemoveCheckBox(cascadeGroup);
- gridData = new GridData();
- this.removeCheckBox.setLayoutData(gridData);
-
- this.refreshCheckBox = createRefreshCheckBox(cascadeGroup);
- gridData = new GridData();
- this.refreshCheckBox.setLayoutData(gridData);
- }
-
- private Button createAllCheckBox(Composite composite) {
- Button button = getWidgetFactory().createButton(composite, "All", SWT.CHECK);
- button.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- CascadeComposite.this.allSelected(e);
- }
- public void widgetSelected(SelectionEvent e) {
- CascadeComposite.this.allSelected(e);
- }
- });
- return button;
- }
-
- protected void allSelected(SelectionEvent e) {
- boolean setSelection = initializeCascade();
- if (setSelection) {
- this.cascade.setAll(this.allCheckBox.getSelection());
- }
- }
-
- private boolean initializeCascade() {
- if (allCheckBoxesFalse() && this.cascade != null) {
- disengageCascadeListener();
- this.relationshipMapping.setCascade(null);
- return false;
- }
- if (this.cascade == null) {
- this.cascade = this.relationshipMapping.createCascade();
- this.relationshipMapping.setCascade(this.cascade);
- engageCascadeListener();
- }
- return true;
- }
-
- private Button createPersistCheckBox(Composite composite) {
- Button button = getWidgetFactory().createButton(composite, "Persist", SWT.CHECK);
- button.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- CascadeComposite.this.persistSelected(e);
- }
- public void widgetSelected(SelectionEvent e) {
- CascadeComposite.this.persistSelected(e);
- }
- });
- return button;
- }
-
- protected void persistSelected(SelectionEvent e) {
- boolean setSelection = initializeCascade();
- if (setSelection) {
- this.cascade.setPersist(this.persistCheckBox.getSelection());
- }
- }
-
- private Button createMergeCheckBox(Composite composite) {
- Button button = getWidgetFactory().createButton(composite, "Merge", SWT.CHECK);
- button.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- CascadeComposite.this.mergeSelected(e);
- }
- public void widgetSelected(SelectionEvent e) {
- CascadeComposite.this.mergeSelected(e);
- }
- });
- return button;
- }
-
- protected void mergeSelected(SelectionEvent e) {
- boolean setSelection = initializeCascade();
- if (setSelection) {
- this.cascade.setMerge(this.mergeCheckBox.getSelection());
- }
- }
-
- private Button createRemoveCheckBox(Composite composite) {
- Button button = getWidgetFactory().createButton(composite, "Remove", SWT.CHECK);
- button.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- CascadeComposite.this.removeSelected(e);
- }
- public void widgetSelected(SelectionEvent e) {
- CascadeComposite.this.removeSelected(e);
- }
- });
- return button;
- }
-
- protected void removeSelected(SelectionEvent e) {
- boolean setSelection = initializeCascade();
- if (setSelection) {
- this.cascade.setRemove(this.removeCheckBox.getSelection());
- }
- }
-
- private Button createRefreshCheckBox(Composite composite) {
- Button button = getWidgetFactory().createButton(composite, "Refresh", SWT.CHECK);
- button.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- CascadeComposite.this.refreshSelected(e);
- }
- public void widgetSelected(SelectionEvent e) {
- CascadeComposite.this.refreshSelected(e);
- }
- });
- return button;
- }
-
- protected void refreshSelected(SelectionEvent e) {
- boolean setSelection = initializeCascade();
- if (setSelection) {
- this.cascade.setRefresh(this.refreshCheckBox.getSelection());
- }
- }
-
- private boolean allCheckBoxesFalse() {
- return !(this.allCheckBox.getSelection()
- || this.persistCheckBox.getSelection()
- || this.mergeCheckBox.getSelection()
- || this.removeCheckBox.getSelection()
- || this.refreshCheckBox.getSelection());
-
-
- }
-
- private void relationshipMappingChanged(Notification notification) {
- if (notification.getFeatureID(IRelationshipMapping.class) ==
- JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__CASCADE) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- if (CascadeComposite.this.cascade != null) {
- disengageCascadeListener();
- }
- CascadeComposite.this.cascade = CascadeComposite.this.relationshipMapping.getCascade();
- populateCascade();
-
- if (CascadeComposite.this.cascade != null) {
- engageCascadeListener();
- }
- }
- });
- }
- }
-
- private void cascadeChanged(final Notification notification) {
- switch (notification.getFeatureID(ICascade.class)) {
- case JpaCoreMappingsPackage.ICASCADE__ALL :
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- CascadeComposite.this.allCheckBox.setSelection(notification.getNewBooleanValue());
- }
- });
- break;
- case JpaCoreMappingsPackage.ICASCADE__PERSIST :
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- CascadeComposite.this.persistCheckBox.setSelection(notification.getNewBooleanValue());
- }
- });
- break;
- case JpaCoreMappingsPackage.ICASCADE__MERGE :
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- CascadeComposite.this.mergeCheckBox.setSelection(notification.getNewBooleanValue());
- }
- });
- break;
- case JpaCoreMappingsPackage.ICASCADE__REMOVE :
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- CascadeComposite.this.removeCheckBox.setSelection(notification.getNewBooleanValue());
- }
- });
- break;
- case JpaCoreMappingsPackage.ICASCADE__REFRESH :
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- CascadeComposite.this.refreshCheckBox.setSelection(notification.getNewBooleanValue());
- }
- });
- break;
- default :
- break;
- }
- if (notification.getFeatureID(ICascade.class) ==
- JpaCoreMappingsPackage.ICASCADE__ALL) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- CascadeComposite.this.allCheckBox.setSelection(notification.getNewBooleanValue());
- }
- });
- }
-
- }
-
-
- public void doPopulate(EObject obj) {
- this.relationshipMapping = (IRelationshipMapping) obj;
-
- if (this.relationshipMapping != null) {
- this.cascade = this.relationshipMapping.getCascade();
- populateCascade();
- }
- }
-
- private void populateCascade() {
- if (this.cascade != null) {
- this.allCheckBox.setSelection(this.cascade.isAll());
- this.persistCheckBox.setSelection(this.cascade.isPersist());
- this.mergeCheckBox.setSelection(this.cascade.isMerge());
- this.removeCheckBox.setSelection(this.cascade.isRemove());
- this.refreshCheckBox.setSelection(this.cascade.isRefresh());
- }
- else {
- this.allCheckBox.setSelection(false);
- this.persistCheckBox.setSelection(false);
- this.mergeCheckBox.setSelection(false);
- this.removeCheckBox.setSelection(false);
- this.refreshCheckBox.setSelection(false);
- }
- }
-
- public void doPopulate() {
- }
-
- protected void engageListeners() {
- if (this.relationshipMapping != null) {
- this.relationshipMapping.eAdapters().add(this.relationshipMappingListener);
- if (this.cascade != null) {
- engageCascadeListener();
- }
- }
- }
-
- protected void engageCascadeListener() {
- this.cascade.eAdapters().add(this.cascadeListener);
- }
-
- protected void disengageCascadeListener() {
- this.cascade.eAdapters().remove(this.cascadeListener);
- }
-
- protected void disengageListeners() {
- if (this.relationshipMapping != null) {
- this.relationshipMapping.eAdapters().remove(this.relationshipMappingListener);
- if (this.cascade != null) {
- disengageCascadeListener();
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CatalogCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CatalogCombo.java
deleted file mode 100644
index c51d015c88..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CatalogCombo.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.ITable;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.db.internal.Connection;
-import org.eclipse.jpt.db.internal.ConnectionListener;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.Database;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class CatalogCombo extends BaseJpaController
-{
- private ITable table;
-
- private Adapter listener;
-
- /**
- * Caching the connectionProfile so we can remove the listener. If the
- * cached table object has been removed from the model then we no longer
- * have access to the parent and cannot find the connectionProfile
- */
- private ConnectionProfile connectionProfile;
-
- private ConnectionListener connectionListener;
-
- private CCombo combo;
-
- public CatalogCombo(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- this.listener = this.buildTableListener();
- this.connectionListener = this.buildConnectionListener();
- }
-
- private Adapter buildTableListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- CatalogCombo.this.catalogChanged(notification);
- }
- };
- }
-
- private ConnectionListener buildConnectionListener() {
- return new ConnectionListener() {
- public void aboutToClose(Connection connection) {
- // not interested to this event.
- }
-
- public void closed(Connection connection) {
- getCombo().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- CatalogCombo.this.populateCatalogCombo();
- }
- });
- }
-
- public void modified(Connection connection) {
- getCombo().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- CatalogCombo.this.populateCatalogCombo();
- }
- });
- }
-
- public boolean okToClose(Connection connection) {
- // not interested to this event.
- return true;
- }
-
- public void opened(Connection connection) {
- getCombo().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- CatalogCombo.this.populateCatalogCombo();
- }
- });
- }
-
- public void databaseChanged(Connection connection, final Database database) {
- getControl().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (database == CatalogCombo.this.getDatabase()) {
- if (!getControl().isDisposed()) {
- CatalogCombo.this.populateCatalogCombo();
- }
- }
- }
- });
- }
-
- public void schemaChanged(Connection connection, final Schema schema) {
- // not interested to this event.
- }
-
- public void tableChanged(Connection connection, final Table table) {
- // not interested to this event.
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- this.combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- this.combo.add(JptUiMappingsMessages.TableComposite_defaultEmpty);
- this.combo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String catalogText = ((CCombo) e.getSource()).getText();
- if (catalogText.equals("")) { //$NON-NLS-1$
- catalogText = null;
- if (CatalogCombo.this.table.getSpecifiedCatalog() == null || CatalogCombo.this.table.getSpecifiedCatalog().equals("")) { //$NON-NLS-1$
- return;
- }
- }
- if (catalogText != null && combo.getItemCount() > 0 && catalogText.equals(combo.getItem(0))) {
- catalogText = null;
- }
- if (CatalogCombo.this.table.getSpecifiedCatalog() == null && catalogText != null) {
- CatalogCombo.this.setSpecifiedCatalog(catalogText);
- }
- if (CatalogCombo.this.table.getSpecifiedCatalog() != null && !CatalogCombo.this.table.getSpecifiedCatalog().equals(catalogText)) {
- CatalogCombo.this.setSpecifiedCatalog(catalogText);
- }
- }
- });
- }
-
- private void setSpecifiedCatalog(String catalogName) {
- this.table.setSpecifiedCatalog(catalogName);
- this.getConnectionProfile().setCatalogName(catalogName);
- }
-
- protected void catalogChanged(Notification notification) {
- if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_CATALOG) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- CatalogCombo.this.populateCatalogName();
- }
- });
- }
- else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_CATALOG) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- CatalogCombo.this.populateDefaultCatalogName();
- }
- });
- }
- }
-
- public void doPopulate(EObject obj) {
- this.table = (ITable) obj;
- if (this.table != null) {
- this.populateCatalogCombo();
- }
- else {
- this.connectionProfile = null;
- }
- }
-
- public void doPopulate() {
- this.populateCatalogCombo();
- }
-
- protected Database getDatabase() {
- return this.getConnectionProfile().getDatabase();
- }
-
- private ConnectionProfile getConnectionProfile() {
- if (this.connectionProfile == null) {
- this.connectionProfile = this.table.getJpaProject().connectionProfile();
- }
- return this.connectionProfile;
- }
-
- private void populateCatalogCombo() {
- if (this.table == null) {
- return;
- }
- this.populateDefaultCatalogName();
- if (this.getConnectionProfile().isConnected()) {
- this.combo.remove(1, this.combo.getItemCount() - 1);
- Database database = this.getDatabase();
- if (database != null) {
- Iterator<String> catalogs = database.catalogNames();
- for (Iterator<String> stream = CollectionTools.sort(catalogs); stream.hasNext();) {
- this.combo.add(stream.next());
- }
- }
- }
- else {
- this.combo.remove(1, this.combo.getItemCount() - 1);
- }
- this.populateCatalogName();
- }
-
- protected void populateDefaultCatalogName() {
- // String defaultCatalogName = this.table.getDefaultCatalog(); //
- // DefaultCatalog cannot be initialized if DB not online
- String defaultCatalogName = this.getDatabase().getDefaultCatalogName(); // TOREVIEW
- int selectionIndex = combo.getSelectionIndex();
- combo.setItem(0, NLS.bind(JptUiMappingsMessages.TableComposite_defaultWithOneParam, defaultCatalogName));
- if (selectionIndex == 0) {
- combo.clearSelection();
- combo.select(0);
- }
- }
-
- protected void populateCatalogName() {
- if (this.table == null) {
- return;
- }
- String catalogName = this.table.getSpecifiedCatalog();
- // String defaultCatalogName = this.table.getDefaultCatalog(); //
- // DefaultCatalog cannot be initialized if DB not online
- String defaultCatalogName = this.getDatabase().getDefaultCatalogName(); // TOREVIEW
- if (!StringTools.stringIsEmpty(catalogName)) {
- if (!this.combo.getText().equals(catalogName)) {
- this.combo.setText(catalogName);
- }
- }
- else {
- if (!this.combo.getText().equals(NLS.bind(JptUiMappingsMessages.TableComposite_defaultWithOneParam, defaultCatalogName))) {
- this.combo.select(0);
- }
- }
- }
-
- public CCombo getCombo() {
- return this.combo;
- }
-
- @Override
- public Control getControl() {
- return getCombo();
- }
-
- @Override
- protected void disengageListeners() {
- if (this.table != null) {
- this.removeConnectionListener();
- this.table.eAdapters().remove(this.listener);
- }
- }
-
- @Override
- protected void engageListeners() {
- if (this.table != null) {
- this.table.eAdapters().add(this.listener);
- this.addConnectionListener();
- }
- }
-
- private void addConnectionListener() {
- this.getConnectionProfile().addConnectionListener(this.connectionListener);
- }
-
- private void removeConnectionListener() {
- this.getConnectionProfile().removeConnectionListener(this.connectionListener);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ColumnComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ColumnComposite.java
deleted file mode 100644
index 7502f7981f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ColumnComposite.java
+++ /dev/null
@@ -1,567 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean;
-import org.eclipse.jpt.core.internal.mappings.IAbstractColumn;
-import org.eclipse.jpt.core.internal.mappings.IColumn;
-import org.eclipse.jpt.core.internal.mappings.INamedColumn;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.db.internal.Connection;
-import org.eclipse.jpt.db.internal.ConnectionListener;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.Database;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-//TODO repopulate this panel based on the Entity table changing
-public class ColumnComposite extends BaseJpaComposite
-{
-
- private IColumn column;
-
- private Adapter columnListener;
- private ConnectionListener connectionListener;
-
- protected CCombo columnCombo;
- protected CCombo tableCombo;
- protected EnumComboViewer insertableComboViewer;
- protected EnumComboViewer updatableComboViewer;
-
- private ConnectionProfile connectionProfile;
-
- public ColumnComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.columnListener = buildColumnListener();
- this.connectionListener = buildConnectionListener();
- }
-
- private Adapter buildColumnListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- columnChanged(notification);
- }
- };
- }
-
- private ConnectionListener buildConnectionListener() {
- return new ConnectionListener() {
-
- public void aboutToClose(Connection connection) {
- // not interested to this event.
- }
-
- public void closed(Connection connection) {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- ColumnComposite.this.populateColumnCombo();
- }
- });
- }
-
- public void modified(Connection connection) {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- ColumnComposite.this.populateColumnCombo();
- }
- });
- }
-
- public boolean okToClose(Connection connection) {
- // not interested to this event.
- return true;
- }
-
- public void opened(Connection connection) {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- ColumnComposite.this.populateColumnCombo();
- }
- });
- }
-
- public void databaseChanged(Connection connection, final Database database) {
- return;
- }
-
- public void schemaChanged(Connection connection, final Schema schema) {
- return;
- }
-
- public void tableChanged(Connection connection, final Table table) {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- if(table == getDbTable()) {
- if (!getControl().isDisposed()) {
- ColumnComposite.this.populateColumnCombo();
- }
- }
- }
- });
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- Group columnGroup = getWidgetFactory().createGroup(composite, JptUiMappingsMessages.ColumnComposite_columnSection);
- layout = new GridLayout();
- layout.marginHeight = 0;
- columnGroup.setLayout(layout);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace= true;
- columnGroup.setLayoutData(gridData);
-
- //created this composite because combos as direct children of a Group do not have a border, no clue why
- Composite intermediaryComposite = getWidgetFactory().createComposite(columnGroup);
- layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- intermediaryComposite.setLayout(layout);
-
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace= true;
- intermediaryComposite.setLayoutData(gridData);
-
-
- CommonWidgets.buildColumnLabel(intermediaryComposite, getWidgetFactory());
-
- this.columnCombo = buildColumnCombo(intermediaryComposite);
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.columnCombo.setLayoutData(gridData);
- helpSystem.setHelp(columnCombo, IJpaHelpContextIds.MAPPING_COLUMN);
-
-
- CommonWidgets.buildColumnTableLabel(intermediaryComposite, getWidgetFactory());
-
- this.tableCombo = buildTableCombo(intermediaryComposite);
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.tableCombo.setLayoutData(gridData);
- helpSystem.setHelp(tableCombo, IJpaHelpContextIds.MAPPING_COLUMN_TABLE);
-
- getWidgetFactory().createLabel(intermediaryComposite, JptUiMappingsMessages.ColumnComposite_insertable);
-
- this.insertableComboViewer = new EnumComboViewer(intermediaryComposite, this.commandStack, getWidgetFactory());
- this.insertableComboViewer.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
- helpSystem.setHelp(this.insertableComboViewer.getControl(), IJpaHelpContextIds.MAPPING_COLUMN_INSERTABLE);
-
- getWidgetFactory().createLabel(intermediaryComposite, JptUiMappingsMessages.ColumnComposite_updatable);
-
- this.updatableComboViewer = new EnumComboViewer(intermediaryComposite, this.commandStack, getWidgetFactory());
- this.updatableComboViewer.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
- helpSystem.setHelp(this.updatableComboViewer.getControl(), IJpaHelpContextIds.MAPPING_COLUMN_UPDATABLE);
- }
-
-
- private CCombo buildColumnCombo(Composite parent) {
- final CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- combo.add(JptUiMappingsMessages.ColumnComposite_defaultEmpty);
- combo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String columnText = ((CCombo) e.getSource()).getText();
- if (columnText.equals("")) { //$NON-NLS-1$
- columnText = null;
- if (column.getSpecifiedName() == null || column.getSpecifiedName().equals("")) { //$NON-NLS-1$
- return;
- }
- }
-
- if (columnText != null && combo.getItemCount() > 0 && columnText.equals(combo.getItem(0))) {
- columnText = null;
- }
-
- if (column.getSpecifiedName() == null && columnText != null) {
- column.setSpecifiedName(columnText);
- }
- if (column.getSpecifiedName() != null && !column.getSpecifiedName().equals(columnText)) {
- column.setSpecifiedName(columnText);
- }
- }
- });
- return combo;
- }
-
- private CCombo buildTableCombo(Composite parent) {
- final CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- combo.add(JptUiMappingsMessages.ColumnComposite_defaultEmpty);
- combo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String tableText = ((CCombo) e.getSource()).getText();
- if (tableText.equals("")) { //$NON-NLS-1$
- tableText = null;
- if (column.getSpecifiedTable() == null || column.getSpecifiedTable().equals("")) { //$NON-NLS-1$
- return;
- }
- }
-
- if (tableText != null && combo.getItemCount() > 0 && tableText.equals(combo.getItem(0))) {
- tableText = null;
- }
-
- if (column.getSpecifiedTable() == null && tableText != null) {
- column.setSpecifiedTable(tableText);
- }
- if (column.getSpecifiedTable() != null && !column.getSpecifiedTable().equals(tableText)) {
- column.setSpecifiedTable(tableText);
- }
- }
- });
- return combo;
-
- }
-
- protected void columnChanged(Notification notification) {
- if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed() || isPopulating()) {
- return;
- }
- populateColumnName();
- }
- });
- }
- else if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateDefaultColumnName();
- }
- });
- }
- else if (notification.getFeatureID(IAbstractColumn.class) == JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateDefaultColumnTable();
- populateColumnCombo();
- }
- });
- }
- else if (notification.getFeatureID(IAbstractColumn.class) == JpaCoreMappingsPackage.IABSTRACT_COLUMN__SPECIFIED_TABLE) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateColumnTable();
- populateColumnCombo();
- }
- });
- }
- }
-
- @Override
- protected void engageListeners() {
- if (this.column != null) {
- this.column.eAdapters().add(this.columnListener);
- this.addConnectionListener();
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.column != null) {
- this.removeConnectionListener();
- this.column.eAdapters().remove(this.columnListener);
- }
- }
-
- private ConnectionProfile getConnectionProfile() {
- if (this.connectionProfile == null) {
- this.connectionProfile = this.column.getJpaProject().connectionProfile();
- }
- return this.connectionProfile;
- }
-
- private void addConnectionListener() {
- this.getConnectionProfile().addConnectionListener(this.connectionListener);
- }
-
- private void removeConnectionListener() {
- this.getConnectionProfile().removeConnectionListener(this.connectionListener);
- }
-
- private Table getDbTable() {
- return this.column.dbTable();
- }
-
- private void populateColumnCombo() {
- //TODO don't do instanceof check here - check on Table, or isRoot check on Entity
- //this.tableCombo.setEnabled(!(this.table instanceof SingleTableInheritanceChildTableImpl));
- populateDefaultColumnName();
-
- if (this.getConnectionProfile().isConnected()) {
- this.columnCombo.remove(1, this.columnCombo.getItemCount()-1);
- Table table = getDbTable();
- if (table != null) {
- for (Iterator i = CollectionTools.sort(CollectionTools.list(table.columnNames())).iterator(); i.hasNext();) {
- this.columnCombo.add((String) i.next());
- }
- }
- }
- else {
- this.columnCombo.remove(1, this.columnCombo.getItemCount()-1);
- }
- populateColumnName();
- }
-
- protected void populateDefaultColumnName() {
- String defaultTableName = column.getDefaultName();
- int selectionIndex = columnCombo.getSelectionIndex();
- columnCombo.setItem(0, NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultTableName));
- if (selectionIndex == 0) {
- //combo text does not update when switching between 2 mappings of the same type
- //that both have a default column name. clear the selection and then set it again
- columnCombo.clearSelection();
- columnCombo.select(0);
- }
- }
-
- protected void populateColumnName() {
- String specifiedColumnName = this.column.getSpecifiedName();
- if (specifiedColumnName != null) {
- if (!this.columnCombo.getText().equals(specifiedColumnName)) {
- this.columnCombo.setText(specifiedColumnName);
- }
- }
- else {
- String defaultColumnName = this.column.getDefaultName();
- if (!this.columnCombo.getText().equals(NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultColumnName))) {
- this.columnCombo.select(0);
- }
- }
- }
-
- private void populateTableCombo() {
- //TODO don't do instanceof check here - check on Table, or isRoot check on Entity
- //this.tableCombo.setEnabled(!(this.table instanceof SingleTableInheritanceChildTableImpl));
- populateDefaultColumnTable();
- this.tableCombo.remove(1, this.tableCombo.getItemCount()-1);
-
- if (this.column != null) {
- for (Iterator i = this.column.getOwner().getTypeMapping().associatedTableNamesIncludingInherited(); i.hasNext(); ) {
- this.tableCombo.add((String) i.next());
- }
- }
- populateColumnTable();
- }
-
- protected void populateDefaultColumnTable() {
- String defaultTableName = column.getDefaultTable();
- int selectionIndex = tableCombo.getSelectionIndex();
- tableCombo.setItem(0, NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultTableName));
- if (selectionIndex == 0) {
- //combo text does not update when switching between 2 mappings of the same type
- //that both have a default column name. clear the selection and then set it again
- tableCombo.clearSelection();
- tableCombo.select(0);
- }
- }
-
- protected void populateColumnTable() {
- String tableName = this.column.getSpecifiedTable();
- String defaultTableName = this.column.getDefaultTable();
- if (tableName != null) {
- if (!this.tableCombo.getText().equals(tableName)) {
- this.tableCombo.setText(tableName);
- }
- }
- else {
- if (!this.tableCombo.getText().equals(NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultTableName))) {
- this.tableCombo.select(0);
- }
- }
- }
-
- public void doPopulate(EObject obj) {
- this.column = (IColumn) obj;
- if (this.column != null) {
- populateColumnCombo();
- populateTableCombo();
- }
- this.insertableComboViewer.populate(new InsertableHolder(this.column));
- this.updatableComboViewer.populate(new UpdatableHolder(this.column));
- }
-
- public void doPopulate() {
- if (this.column != null) {
- populateColumnCombo();
- populateTableCombo();
- }
- else {
- this.connectionProfile = null;
- }
- this.insertableComboViewer.populate();
- this.updatableComboViewer.populate();
- }
-
- protected void enableWidgets(boolean enabled) {
- this.columnCombo.setEnabled(enabled);
- this.tableCombo.setEnabled(enabled);
- this.insertableComboViewer.getControl().setEnabled(enabled);
- this.updatableComboViewer.getControl().setEnabled(enabled);
- }
-
- @Override
- public void dispose() {
- this.insertableComboViewer.dispose();
- this.updatableComboViewer.dispose();
- super.dispose();
- }
-
- private class InsertableHolder extends EObjectImpl implements EnumHolder {
-
- private IAbstractColumn column;
-
- InsertableHolder(IAbstractColumn column) {
- super();
- this.column = column;
- }
-
- public Object get() {
- return this.column.getInsertable();
- }
-
- public void set(Object enumSetting) {
- this.column.setInsertable((DefaultTrueBoolean) enumSetting);
-
- }
-
- public Class featureClass() {
- return IAbstractColumn.class;
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.IABSTRACT_COLUMN__INSERTABLE;
- }
-
- public EObject wrappedObject() {
- return this.column;
- }
-
- public Object[] enumValues() {
- return DefaultTrueBoolean.VALUES.toArray();
- }
-
- public Object defaultValue() {
- return DefaultTrueBoolean.DEFAULT;
- }
-
- public String defaultString() {
- //TODO move this out of the UI into the model
- return "True";
- }
- }
-
- private class UpdatableHolder extends EObjectImpl implements EnumHolder {
-
- private IAbstractColumn column;
-
- UpdatableHolder(IAbstractColumn column) {
- super();
- this.column = column;
- }
-
- public Object get() {
- return this.column.getUpdatable();
- }
-
- public void set(Object enumSetting) {
- this.column.setUpdatable((DefaultTrueBoolean) enumSetting);
-
- }
-
- public Class featureClass() {
- return IAbstractColumn.class;
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.IABSTRACT_COLUMN__UPDATABLE;
- }
-
- public EObject wrappedObject() {
- return this.column;
- }
-
- public Object[] enumValues() {
- return DefaultTrueBoolean.VALUES.toArray();
- }
-
- public Object defaultValue() {
- return DefaultTrueBoolean.DEFAULT;
- }
-
- public String defaultString() {
- //TODO move this out of the UI into the model
- return "True";
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CommonWidgets.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CommonWidgets.java
deleted file mode 100644
index 43e66643fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CommonWidgets.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType;
-import org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType;
-import org.eclipse.jpt.core.internal.mappings.EnumType;
-import org.eclipse.jpt.core.internal.mappings.IAbstractColumn;
-import org.eclipse.jpt.core.internal.mappings.IColumn;
-import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping;
-import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder;
-import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser.StringHolder;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class CommonWidgets
-{
- public static Label buildEntityNameLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiMappingsMessages.EntityGeneralSection_name);
- }
-
- public static EntityNameCombo buildEntityNameCombo(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new EntityNameCombo(parent, commandStack, widgetFactory);
- }
-
- public static Label buildTableLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiMappingsMessages.TableChooser_label);
- }
-
- public static Label buildCatalogLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiMappingsMessages.CatalogChooser_label);
- }
-
- public static Label buildSchemaLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiMappingsMessages.SchemaChooser_label);
- }
-
- public static StringWithDefaultChooser buildStringWithDefaultChooser(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new StringWithDefaultChooser(parent, commandStack, widgetFactory);
- }
-
-
- public static Label buildFetchLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiMappingsMessages.BasicGeneralSection_fetchLabel);
- }
-
- public static Label buildTargetEntityLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiMappingsMessages.TargetEntityChooser_label);
- }
-
- public static Label buildOptionalLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiMappingsMessages.BasicGeneralSection_optionalLabel);
- }
-
- public static Label buildTemporalLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiMappingsMessages.BasicGeneralSection_temporalLabel);
- }
-
- public static Label buildEnumeratedLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiMappingsMessages.BasicGeneralSection_enumeratedLabel);
- }
-
- public static Label buildMappedByLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiMappingsMessages.NonOwningMapping_mappedByLabel);
- }
-
- public static EnumComboViewer buildFetchTypeComboViewer(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new EnumComboViewer(parent, commandStack, widgetFactory);
- }
-
- public static EnumComboViewer buildEnumComboViewer(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new EnumComboViewer(parent, commandStack, widgetFactory);
- }
-
- public static EnumHolder buildMultiRelationshipMappingFetchEnumHolder(IMultiRelationshipMapping mapping) {
- return new FetchHolder(mapping);
- }
-
- public static EnumHolder buildSingleRelationshipMappingFetchEnumHolder(ISingleRelationshipMapping mapping) {
- return new SingleRelationshipMappingFetchHolder(mapping);
- }
-
- public static Label buildColumnLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiMappingsMessages.ColumnChooser_label);
- }
-
- public static Label buildColumnTableLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiMappingsMessages.ColumnTableChooser_label);
- }
-
- public static ColumnTableHolder buildColumnTableHolder(IColumn column) {
- return new ColumnTableHolder(column);
- }
-
- public static TargetEntityChooser buildTargetEntityChooser(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new TargetEntityChooser(parent, commandStack, widgetFactory);
- }
- private static class FetchHolder extends EObjectImpl implements EnumHolder {
-
- private IMultiRelationshipMapping mapping;
-
- FetchHolder(IMultiRelationshipMapping mapping) {
- super();
- this.mapping = mapping;
- }
-
- public Object get() {
- return this.mapping.getFetch();
- }
-
- public void set(Object enumSetting) {
- this.mapping.setFetch((DefaultLazyFetchType) enumSetting);
-
- }
-
- public Class featureClass() {
- return IMultiRelationshipMapping.class;
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH;
- }
-
- public EObject wrappedObject() {
- return this.mapping;
- }
-
- public Object[] enumValues() {
- return DefaultLazyFetchType.VALUES.toArray();
- }
-
- public Object defaultValue() {
- return DefaultLazyFetchType.DEFAULT;
- }
-
- public String defaultString() {
- //TODO move this out of the UI into the model
- return "Lazy";
- }
- }
-
- private static class SingleRelationshipMappingFetchHolder extends EObjectImpl implements EnumHolder {
-
- private ISingleRelationshipMapping mapping;
-
- SingleRelationshipMappingFetchHolder(ISingleRelationshipMapping mapping) {
- super();
- this.mapping = mapping;
- }
-
- public Object get() {
- return this.mapping.getFetch();
- }
-
- public void set(Object enumSetting) {
- this.mapping.setFetch((DefaultEagerFetchType) enumSetting);
-
- }
-
- public Class featureClass() {
- return ISingleRelationshipMapping.class;
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__FETCH;
- }
-
- public EObject wrappedObject() {
- return this.mapping;
- }
-
- public Object[] enumValues() {
- return DefaultEagerFetchType.VALUES.toArray();
- }
-
- public Object defaultValue() {
- return DefaultEagerFetchType.DEFAULT;
- }
-
- public String defaultString() {
- //TODO move this out of the UI into the model
- return "Eager";
- }
- }
- private static abstract class ColumnHolder extends EObjectImpl implements StringHolder {
- private IAbstractColumn column;
-
- ColumnHolder(IAbstractColumn column) {
- super();
- this.column = column;
- }
-
- public Class featureClass() {
- return IAbstractColumn.class;
- }
-
- public boolean supportsDefault() {
- return true;
- }
-
- public EObject wrappedObject() {
- return this.column;
- }
-
- protected IAbstractColumn getColumn() {
- return this.column;
- }
- }
-
- public static class ColumnTableHolder extends ColumnHolder implements StringHolder {
-
- ColumnTableHolder(IAbstractColumn column) {
- super(column);
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.IABSTRACT_COLUMN__SPECIFIED_TABLE;
- }
-
- public int defaultFeatureId() {
- return JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE;
- }
-
- public String defaultItem() {
- String defaultName = getColumn().getDefaultTable();
- if (defaultName != null) {
- return NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultName);
- }
- return JptUiMappingsMessages.ColumnComposite_defaultEmpty;
- }
-
- public String getString() {
- return getColumn().getSpecifiedTable();
- }
-
- public void setString(String newName) {
- getColumn().setSpecifiedTable(newName);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddableComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddableComposite.java
deleted file mode 100644
index 2c98eb093f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddableComposite.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.IEmbeddable;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EmbeddableComposite extends BaseJpaComposite
-{
- private IEmbeddable embeddable;
- private Adapter mappedSuperclassListener;
-
- private CommandStack commandStack;
-
-
- public EmbeddableComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.mappedSuperclassListener = buildMappedSuperclassListener();
- }
-
- private Adapter buildMappedSuperclassListener() {
- return new AdapterImpl() {
- @Override
- public void notifyChanged(Notification notification) {
- mappedSuperclassChanged(notification);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- composite.setLayout(new FillLayout(SWT.VERTICAL));
-
-// Label accessTypeLabel = new Label(composite, SWT.LEFT);
-// accessTypeLabel.setText(DaliUiMessages.MappedSuperclassComposite_accessType);
-// this.accessTypeComboViewer = buildAccessTypeCombo(composite);
-// //eventually this will be enabled if editing xml instead of java
-// this.accessTypeComboViewer.getCombo().setEnabled(false);
-// GridData gridData = new GridData();
-// gridData.horizontalAlignment = GridData.FILL;
-// gridData.grabExcessHorizontalSpace = true;
-// this.accessTypeComboViewer.getCombo().setLayoutData(gridData);
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(this.accessTypeComboViewer.getCombo(), IDaliHelpContextIds.ENTITY_ACCESS_TYPE);
-
- }
-
-// private ComboViewer buildAccessTypeCombo(Composite parent) {
-// ComboViewer viewer = new ComboViewer(parent, SWT.READ_ONLY);
-// viewer.add(AccessType.VALUES.toArray());
-// viewer.addSelectionChangedListener(new ISelectionChangedListener() {
-// public void selectionChanged(SelectionChangedEvent event) {
-// if (populating) {
-// return;
-// }
-// if (event.getSelection() instanceof StructuredSelection) {
-// StructuredSelection selection = (StructuredSelection) event.getSelection();
-// editingDomain.getCommandStack().execute(SetCommand.create(editingDomain, persistentType, OrmPackage.eINSTANCE.getPersistentType_AccessType(), selection.getFirstElement()));
-// }
-// }
-// });
-// return viewer;
-// }
-
- @Override
- protected void doPopulate(EObject model) {
- this.embeddable = (IEmbeddable) model;
- }
-
- @Override
- protected void doPopulate() {
-
- }
-
-
- protected void engageListeners() {
-// this.persistentTypeItemProvider.addListener(getPersistentTypeListener());
-// this.persistentType.eAdapters().add(this.persistentTypeItemProvider);
- }
-
- protected void disengageListeners() {
-// if (this.persistentType != null){
-// this.persistentType.eAdapters().remove(this.persistentTypeItemProvider);
-// this.persistentTypeItemProvider.removeListener(getPersistentTypeListener());
-// }
- }
-
- private void mappedSuperclassChanged(Notification notification) {
-
- }
-
-// private INotifyChangedListener getPersistentTypeListener() {
-// if (this.persistentTypeListener == null) {
-// this.persistentTypeListener = new INotifyChangedListener() {
-// public void notifyChanged(Notification notification) {
-// if (notification.getFeatureID(PersistentType.class) == OrmPackage.PERSISTENT_TYPE__ACCESS_TYPE) {
-// final AccessType accessType = (AccessType) notification.getNewValue();
-// Display.getDefault().syncExec(new Runnable() {
-// public void run() {
-// if (((StructuredSelection) accessTypeComboViewer.getSelection()).getFirstElement() != accessType) {
-// accessTypeComboViewer.setSelection(new StructuredSelection(accessType));
-// }
-// }
-// });
-// }
-// }
-// };
-// }
-// return this.persistentTypeListener;
-// }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedAttributeOverridesComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedAttributeOverridesComposite.java
deleted file mode 100644
index d0da0632d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedAttributeOverridesComposite.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.core.internal.mappings.IAttributeOverride;
-import org.eclipse.jpt.core.internal.mappings.IEmbedded;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EmbeddedAttributeOverridesComposite extends BaseJpaComposite
-{
- private ListViewer listViewer;
-
- private IEmbedded embedded;
- private Adapter embeddedListener;
-
- private IAttributeOverride attributeOverride;
- private Adapter attributeOverrideListener;
-
- protected ColumnComposite columnComposite;
-
- private Button overrideDefaultButton;
-
- public EmbeddedAttributeOverridesComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.embeddedListener = buildEmbeddedListener();
- this.attributeOverrideListener = buildAttributeOverrideListener();
- }
-
- private Adapter buildEmbeddedListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- embeddedChanged(notification);
- }
- };
- }
-
- private Adapter buildAttributeOverrideListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- attributeOverrideChanged(notification);
- }
- };
- }
-
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- Group attributeOverridesGroup = getWidgetFactory().createGroup(
- composite, JptUiMappingsMessages.AttributeOverridesComposite_attributeOverrides);
- attributeOverridesGroup.setLayout(new GridLayout(2, true));
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace= true;
- attributeOverridesGroup.setLayoutData(gridData);
-
- this.listViewer = buildAttributeOverridesListViewer(attributeOverridesGroup);
- gridData = new GridData();
- gridData.verticalSpan = 2;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace= true;
- this.listViewer.getList().setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.listViewer.getList(), IJpaHelpContextIds.MAPPING_EMBEDDED_ATTRIBUTE_OVERRIDES);
-
- this.overrideDefaultButton = getWidgetFactory().createButton(attributeOverridesGroup, "Override Default", SWT.CHECK);
- this.overrideDefaultButton.addSelectionListener(buildOverrideDefaultSelectionListener());
- gridData = new GridData();
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.overrideDefaultButton.setLayoutData(gridData);
-
-
- this.columnComposite = new ColumnComposite(attributeOverridesGroup, commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.columnComposite.getControl().setLayoutData(gridData);
-
- }
-
- private SelectionListener buildOverrideDefaultSelectionListener() {
- return new SelectionListener(){
-
- public void widgetSelected(SelectionEvent e) {
- overrideDefaultButtonSelected(e);
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- overrideDefaultButtonSelected(e);
- }
- };
- }
-
- private void overrideDefaultButtonSelected(SelectionEvent e) {
- boolean selection = this.overrideDefaultButton.getSelection();
- if (selection) {
- int index = this.embedded.getSpecifiedAttributeOverrides().size();
- IAttributeOverride attributeOverride = this.embedded.createAttributeOverride(index);
- this.embedded.getSpecifiedAttributeOverrides().add(attributeOverride);
- attributeOverride.setName(this.attributeOverride.getName());
- attributeOverride.getColumn().setSpecifiedName(this.attributeOverride.getColumn().getName());
- }
- else {
- this.embedded.getSpecifiedAttributeOverrides().remove(this.attributeOverride);
- }
- }
-
-
- private ListViewer buildAttributeOverridesListViewer(Composite parent) {
- ListViewer listViewer = new ListViewer(parent, SWT.SINGLE | SWT.BORDER);
- listViewer.setLabelProvider(buildAttributeOverridesLabelProvider());
- listViewer.setContentProvider(buildAttributeOverridesContentProvider());
-
- listViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- attributeOverridesListSelectionChanged(event);
- }
- });
-
- return listViewer;
- }
-
- protected void attributeOverridesListSelectionChanged(SelectionChangedEvent event) {
- if (((StructuredSelection) event.getSelection()).isEmpty()) {
- this.columnComposite.populate(null);
- this.columnComposite.enableWidgets(false);
- this.overrideDefaultButton.setSelection(false);
- this.overrideDefaultButton.setEnabled(false);
- }
- else {
- this.attributeOverride = getSelectedAttributeOverride();
- boolean specifiedOverride = this.embedded.getSpecifiedAttributeOverrides().contains(this.attributeOverride);
- this.overrideDefaultButton.setSelection(specifiedOverride);
- this.columnComposite.populate(this.attributeOverride.getColumn());
- this.columnComposite.enableWidgets(specifiedOverride);
- this.overrideDefaultButton.setEnabled(true);
- }
- }
-
- private ILabelProvider buildAttributeOverridesLabelProvider() {
- return new LabelProvider() {
- public String getText(Object element) {
- //TODO also display column name somehow
- return ((IAttributeOverride) element).getName();
- }
- };
- }
-
-
- private IContentProvider buildAttributeOverridesContentProvider() {
- return new IStructuredContentProvider() {
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- public void dispose() {
- }
-
- public Object[] getElements(Object inputElement) {
- return ((IEmbedded) inputElement).getAttributeOverrides().toArray();
- }
- };
- }
-
- private IAttributeOverride getSelectedAttributeOverride() {
- return (IAttributeOverride) ((StructuredSelection) this.listViewer.getSelection()).getFirstElement();
- }
-
-
- public void doPopulate(EObject obj) {
- this.embedded = (IEmbedded) obj;
- if (this.embedded == null) {
- this.attributeOverride = null;
- this.columnComposite.populate(null);
- this.listViewer.setInput(null);
- return;
- }
-
- if (this.listViewer.getInput() != this.embedded) {
- this.listViewer.setInput(this.embedded);
- }
- if (!this.embedded.getAttributeOverrides().isEmpty()) {
- if (this.listViewer.getSelection().isEmpty()) {
- IAttributeOverride attributeOverride = this.embedded.getAttributeOverrides().get(0);
- this.listViewer.setSelection(new StructuredSelection(attributeOverride));
- }
- else {
- this.columnComposite.enableWidgets(true);
- this.columnComposite.populate(((IAttributeOverride)((StructuredSelection) this.listViewer.getSelection()).getFirstElement()).getColumn());
- }
- }
- else {
- this.columnComposite.populate(null);
- this.columnComposite.enableWidgets(false);
- }
- }
-
- @Override
- protected void doPopulate() {
- this.columnComposite.doPopulate();
- }
-
- @Override
- protected void engageListeners() {
- if (this.embedded != null) {
- this.embedded.eAdapters().add(this.embeddedListener);
- for (IAttributeOverride attributeOverride : this.embedded.getAttributeOverrides()) {
- attributeOverride.eAdapters().add(this.attributeOverrideListener);
- }
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.embedded != null) {
- this.embedded.eAdapters().remove(this.embeddedListener);
- for (IAttributeOverride attributeOverride : this.embedded.getAttributeOverrides()) {
- attributeOverride.eAdapters().remove(this.attributeOverrideListener);
- }
- }
- }
-
-
- protected void embeddedChanged(Notification notification) {
- switch (notification.getFeatureID(IEmbedded.class)) {
- case JpaCoreMappingsPackage.IEMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES :
- case JpaCoreMappingsPackage.IEMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES :
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (listViewer.getList().isDisposed()) {
- return;
- }
- listViewer.refresh();
- columnComposite.enableWidgets(!listViewer.getSelection().isEmpty());
- if (listViewer.getSelection().isEmpty()) {
- columnComposite.populate(null);
- }
- }
- });
- if (notification.getEventType() == Notification.ADD) {
- ((IAttributeOverride) notification.getNewValue()).eAdapters().add(this.attributeOverrideListener);
- final Object newValue = notification.getNewValue();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (listViewer.getList().isDisposed()) {
- return;
- }
- listViewer.setSelection(new StructuredSelection(newValue));
- }
- });
- }
- else if (notification.getEventType() == Notification.ADD_MANY) {
- List addedList = (List) notification.getNewValue();
- for (Iterator<IAttributeOverride> i = addedList.iterator(); i.hasNext(); ) {
- IAttributeOverride override = i.next();
- override.eAdapters().add(this.attributeOverrideListener);
- }
- }
- else if (notification.getEventType() == Notification.REMOVE) {
- ((IAttributeOverride) notification.getOldValue()).eAdapters().remove(this.attributeOverrideListener);
- }
- else if (notification.getEventType() == Notification.REMOVE_MANY) {
- List removedList = (List) notification.getOldValue();
- for (Iterator<IAttributeOverride> i = removedList.iterator(); i.hasNext(); ) {
- IAttributeOverride override = i.next();
- override.eAdapters().remove(this.attributeOverrideListener);
- }
- }
- break;
- default :
- break;
- }
- }
-
- protected void attributeOverrideChanged(Notification notification) {
- switch (notification.getFeatureID(IAttributeOverride.class)) {
- case JpaCoreMappingsPackage.IATTRIBUTE_OVERRIDE__NAME :
- final IAttributeOverride attributeOverride = (IAttributeOverride) notification.getNotifier();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- listViewer.refresh(attributeOverride);
- }
- });
- break;
- default :
- break;
- }
- }
-
- public void dispose() {
- this.columnComposite.dispose();
- super.dispose();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedComposite.java
deleted file mode 100644
index 734a9c8676..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedComposite.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.IEmbedded;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EmbeddedComposite extends BaseJpaComposite
-{
- private IEmbedded embedded;
-
- private EmbeddedAttributeOverridesComposite attributeOverridesComposite;
-
- public EmbeddedComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- GridData gridData;
-
- this.attributeOverridesComposite = new EmbeddedAttributeOverridesComposite(composite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- this.attributeOverridesComposite.getControl().setLayoutData(gridData);
- }
-
-
- public void doPopulate(EObject obj) {
- this.embedded = (IEmbedded) obj;
- this.attributeOverridesComposite.populate(obj);
- }
-
- public void doPopulate() {
- this.attributeOverridesComposite.populate();
- }
-
- protected void engageListeners() {
- }
-
- protected void disengageListeners() {
- }
-
- @Override
- public void dispose() {
- this.attributeOverridesComposite.dispose();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedIdComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedIdComposite.java
deleted file mode 100644
index 13111065c2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedIdComposite.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EmbeddedIdComposite extends BaseJpaComposite
-{
- public EmbeddedIdComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
-
- }
-
-
- public void doPopulate(EObject obj) {
- }
-
- public void doPopulate() {
- }
-
- protected void engageListeners() {
- }
-
- protected void disengageListeners() {
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityComposite.java
deleted file mode 100644
index 7ddf3c99e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityComposite.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jpt.core.internal.mappings.IEntity;
-import org.eclipse.jpt.core.internal.mappings.INamedQuery;
-import org.eclipse.jpt.core.internal.mappings.IQueryHint;
-import org.eclipse.jpt.core.internal.mappings.ITable;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser.StringHolder;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EntityComposite extends BaseJpaComposite
-{
- private IEntity entity;
-
- private EntityNameCombo entityNameCombo;
-
- private TableComposite tableComposite;
- private InheritanceComposite inheritanceComposite;
- private SecondaryTablesComposite secondaryTablesComposite;
- private OverridesComposite attributeOverridesComposite;
-
- public EntityComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- Control generalControl = buildGeneralComposite(composite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- generalControl.setLayoutData(gridData);
-
- Control attributeOverridesControl = buildAttributeOverridesComposite(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- attributeOverridesControl.setLayoutData(gridData);
-
- Control secondaryTablesControl = buildSecondaryTablesComposite(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- secondaryTablesControl.setLayoutData(gridData);
-
- Control inheritanceControl = buildInheritanceComposite(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- inheritanceControl.setLayoutData(gridData);
- }
-
- private Control buildGeneralComposite(Composite composite) {
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-
- Composite generalComposite = getWidgetFactory().createComposite(composite);
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- generalComposite.setLayout(layout);
-
- CommonWidgets.buildEntityNameLabel(generalComposite, getWidgetFactory());
-
- this.entityNameCombo =
- CommonWidgets.buildEntityNameCombo(generalComposite, this.commandStack, getWidgetFactory());
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.entityNameCombo.getCombo().setLayoutData(gridData);
- helpSystem.setHelp(entityNameCombo.getCombo(), IJpaHelpContextIds.ENTITY_NAME);
-
-
- this.tableComposite = new TableComposite(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalSpan = 2;
- this.tableComposite.getControl().setLayoutData(gridData);
-
- return generalComposite;
- }
-
- private Control buildSecondaryTablesComposite(Composite composite) {
- Section section = getWidgetFactory().createSection(composite, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
- section.setText(JptUiMappingsMessages.SecondaryTablesComposite_secondaryTables);
-
- Composite client = getWidgetFactory().createComposite(section);
- section.setClient(client);
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- client.setLayout(layout);
-
- this.secondaryTablesComposite = new SecondaryTablesComposite(client, this.commandStack, getWidgetFactory());
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- this.secondaryTablesComposite.getControl().setLayoutData(gridData);
-
- return section;
- }
-
- private Control buildInheritanceComposite(Composite composite) {
- Section section = getWidgetFactory().createSection(composite, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
- section.setText(JptUiMappingsMessages.EntityComposite_inheritance);
-
- Composite inheritanceClient = getWidgetFactory().createComposite(section);
- section.setClient(inheritanceClient);
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- inheritanceClient.setLayout(layout);
-
- this.inheritanceComposite = new InheritanceComposite(inheritanceClient, this.commandStack, getWidgetFactory());
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- this.inheritanceComposite.getControl().setLayoutData(gridData);
-
- return section;
- }
-
- private Control buildAttributeOverridesComposite(Composite composite) {
- Section section = getWidgetFactory().createSection(composite, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
- section.setText(JptUiMappingsMessages.AttributeOverridesComposite_attributeOverrides);
- //section.setExpanded(true); //not going to expand this for now, it causes the scroll bar not to appear
- Composite client = getWidgetFactory().createComposite(section);
- section.setClient(client);
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- client.setLayout(layout);
-
- this.attributeOverridesComposite = new OverridesComposite(client, this.commandStack, getWidgetFactory());
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- this.attributeOverridesComposite.getControl().setLayoutData(gridData);
-
- return section;
- }
-
- //TODO talk to JavaEditor people about what we can do to hook in TabbedProperties for the JavaEditor
-
- public void doPopulate(EObject obj) {
- this.entity = (IEntity) obj;
- this.entityNameCombo.populate(obj);
- this.attributeOverridesComposite.populate(obj);
- this.secondaryTablesComposite.populate(obj);
- this.inheritanceComposite.populate(obj);
- if (this.entity != null) {
- this.tableComposite.populate(this.entity.getTable());
- }
- else {
- this.tableComposite.populate(null);
- }
- }
-
- public void doPopulate() {
- this.entityNameCombo.populate();
- this.tableComposite.populate();
- this.attributeOverridesComposite.populate();
- this.secondaryTablesComposite.populate();
- this.inheritanceComposite.populate();
- }
-
- protected void engageListeners() {
- }
-
- protected void disengageListeners() {
- }
-
- @Override
- public void dispose() {
- this.entityNameCombo.dispose();
- this.tableComposite.dispose();
- this.attributeOverridesComposite.dispose();
- this.secondaryTablesComposite.dispose();
- this.inheritanceComposite.dispose();
- super.dispose();
- }
-
- protected IEntity getEntity() {
- return this.entity;
- }
-
-
- private abstract class TableHolder extends EObjectImpl implements StringHolder {
- private ITable table;
-
- TableHolder(ITable table) {
- super();
- this.table = table;
- }
-
- public Class featureClass() {
- return ITable.class;
- }
-
- public boolean supportsDefault() {
- return true;
- }
-
- public EObject wrappedObject() {
- return this.table;
- }
-
- public ITable getTable() {
- return this.table;
- }
- }
-
- private class TableNameHolder extends TableHolder implements StringHolder {
-
- TableNameHolder(ITable table) {
- super(table);
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.ITABLE__SPECIFIED_NAME;
- }
-
- public int defaultFeatureId() {
- return JpaCoreMappingsPackage.ITABLE__DEFAULT_NAME;
- }
-
- public String defaultItem() {
- String defaultName = getTable().getDefaultName();
- if (defaultName != null) {
- return NLS.bind(JptUiMappingsMessages.EntityComposite_tableDefault, defaultName);
- }
- return JptUiMappingsMessages.EntityComposite_tableNoDefaultSpecified;
- }
-
- public String getString() {
- return getTable().getSpecifiedName();
- }
-
- public void setString(String newName) {
- getTable().setSpecifiedName(newName);
- }
- }
-
- private class TableCatalogHolder extends TableHolder implements StringHolder {
-
- TableCatalogHolder(ITable table) {
- super(table);
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.ITABLE__SPECIFIED_CATALOG;
- }
-
- public int defaultFeatureId() {
- return JpaCoreMappingsPackage.ITABLE__DEFAULT_CATALOG;
- }
-
- public String defaultItem() {
- String defaultCatalog = getTable().getDefaultCatalog();
- if (defaultCatalog != null) {
- return NLS.bind(JptUiMappingsMessages.EntityComposite_tableDefault, defaultCatalog);
- }
- return JptUiMappingsMessages.EntityComposite_tableNoDefaultSpecified;
- }
-
- public String getString() {
- return getTable().getSpecifiedCatalog();
- }
-
- public void setString(String newName) {
- getTable().setSpecifiedCatalog(newName);
- }
- }
-
- private class TableSchemaHolder extends TableHolder implements StringHolder {
-
- TableSchemaHolder(ITable table) {
- super(table);
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA;
- }
-
- public int defaultFeatureId() {
- return JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA;
- }
-
- public String defaultItem() {
- String defaultSchema = getTable().getDefaultSchema();
- if (defaultSchema != null) {
- return NLS.bind(JptUiMappingsMessages.EntityComposite_tableDefault, defaultSchema);
- }
- return JptUiMappingsMessages.EntityComposite_tableNoDefaultSpecified;
- }
-
- public String getString() {
- return getTable().getSpecifiedSchema();
- }
-
- public void setString(String newName) {
- getTable().setSpecifiedSchema(newName);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityNameCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityNameCombo.java
deleted file mode 100644
index 8fe0ffcf4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityNameCombo.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import java.util.Arrays;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.IEntity;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-// TODO get Default updating appropriately based on Entity name default
-
-public class EntityNameCombo extends BaseJpaController
-{
- private IEntity entity;
- private Adapter entityListener;
-
- private CCombo combo;
-
-
- public EntityNameCombo(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, commandStack, widgetFactory);
- buildEntityListener();
- }
-
-
- private void buildEntityListener() {
- entityListener = new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- entityChanged(notification);
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- combo = this.widgetFactory.createCCombo(parent, SWT.FLAT);
- combo.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- comboModified(e);
- }
- });
- }
-
- private void comboModified(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
-
- String text = ((CCombo) e.getSource()).getText();
- if (text.equals(combo.getItem(0))) {
- text = null;
- }
-
- entity.setSpecifiedName(text);
-
- // TODO Does this need to be done?
- //this.editingDomain.getCommandStack().execute(SetCommand.create(this.editingDomain, this.entity, MappingsPackage.eINSTANCE.getEntity_SpecifiedName(), text));
- }
-
- private void entityChanged(Notification notification) {
- switch (notification.getFeatureID(IEntity.class)) {
- case JpaCoreMappingsPackage.IENTITY__SPECIFIED_NAME :
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- break;
- case JpaCoreMappingsPackage.IENTITY__DEFAULT_NAME :
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- break;
- }
- }
-
- @Override
- protected void engageListeners() {
- if (entity != null) {
- entity.eAdapters().add(entityListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (entity != null) {
- entity.eAdapters().remove(entityListener);
- }
- }
-
- @Override
- public void doPopulate(EObject obj) {
- entity = (IEntity) obj;
- populateCombo();
- }
-
- @Override
- protected void doPopulate() {
- populateCombo();
- }
-
- private void populateCombo() {
- if (entity == null) {
- combo.clearSelection();
- combo.setItems(new String[] {});
- return;
- }
-
- String defaultItem = NLS.bind(JptUiMappingsMessages.EntityGeneralSection_nameDefaultWithOneParam, entity.getDefaultName());
- String specifiedName = entity.getSpecifiedName();
-
- if (specifiedName == null) {
- setComboData(defaultItem, new String[] {defaultItem});
- }
- else {
- setComboData(specifiedName, new String[] {defaultItem});
- }
- }
-
- private void setComboData(String text, String[] items) {
- if (! Arrays.equals(items, combo.getItems())) {
- combo.setItems(items);
- }
-
- if (! text.equals(combo.getText())) {
- combo.setText(text);
- }
- }
-
- public CCombo getCombo() {
- return combo;
- }
-
- @Override
- public Control getControl() {
- return getCombo();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EnumComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EnumComboViewer.java
deleted file mode 100644
index 2cf6b61dd3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EnumComboViewer.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.core.internal.mappings.InheritanceType;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.CComboViewer;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EnumComboViewer extends BaseJpaController
-{
- private EnumHolder enumHolder;
- private Adapter enumListener;
-
- private CComboViewer comboViewer;
-
-
- public EnumComboViewer(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- buildListener();
- }
-
-
- private void buildListener() {
- this.enumListener = new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- modelChanged(notification);
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent);
- this.comboViewer = new CComboViewer(combo);
- this.comboViewer.setLabelProvider(buildLabelProvider());
- this.comboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- EnumComboViewer.this.selectionChanged(event.getSelection());
- }
- });
- }
- protected IBaseLabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- if (element == enumHolder.defaultValue()) {
- return NLS.bind(JptUiMappingsMessages.EnumComboViewer_default, enumHolder.defaultString());
- }
- return super.getText(element);
- }
- };
- }
-
- void selectionChanged(ISelection sel) {
- if (sel instanceof IStructuredSelection) {
- Object selection = ((IStructuredSelection) sel).getFirstElement();
- if ( ! this.enumHolder.get().equals(selection)) {
- this.enumHolder.set(selection);
-// this.editingDomain.getCommandStack().execute(
-// SetCommand.create(
-// this.editingDomain,
-// this.basicMapping,
-// OrmPackage.eINSTANCE.getBasicMapping_Optional(),
-// optional
-// )
-// );
- }
- }
- }
-
- private void modelChanged(Notification notification) {
- if (notification.getFeatureID(this.enumHolder.featureClass()) ==
- this.enumHolder.featureId()) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- }
- }
-
- @Override
- protected void engageListeners() {
- if (this.enumHolder != null && this.enumHolder.wrappedObject() != null) {
- this.enumHolder.wrappedObject().eAdapters().add(this.enumListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.enumHolder != null && this.enumHolder.wrappedObject() != null) {
- this.enumHolder.wrappedObject().eAdapters().remove(this.enumListener);
- }
- }
-
- public final void populate(EnumHolder enumHolder) {
- super.populate(enumHolder);
- }
-
- @Override
- public void doPopulate(EObject obj) {
- this.enumHolder = (EnumHolder) obj;
- populateCombo();
- }
-
- @Override
- protected void doPopulate() {
- populateCombo();
- }
-
- private void populateCombo() {
- this.comboViewer.getCombo().removeAll();
- if (this.enumHolder.wrappedObject() == null) {
- return;
- }
-
- this.comboViewer.add(this.enumHolder.enumValues());
-
- Object modelSetting = this.enumHolder.get();
-
- if (((IStructuredSelection) this.comboViewer.getSelection()).getFirstElement() != modelSetting) {
- this.comboViewer.setSelection(new StructuredSelection(modelSetting));
- }
- }
-
-
- @Override
- public Control getControl() {
- return this.comboViewer.getCombo();
- }
-
-
- /**
- * An interface to wrap an object that supports accessType
- * An object of this type must be passed in to populate(EObject)
- */
- public static interface EnumHolder extends EObject {
- /**
- * Return the num setting from the wrapped object
- * @return
- */
- Object get();
-
- /**
- * Set the enum setting on the wrapped object
- * @param fetch
- */
- void set(Object enumSetting);
-
- /**
- * Return the Class of the wrapped object
- * @return
- */
- Class featureClass();
-
- /**
- * Return the feature id of enum setting on the wrapped object
- * @return
- */
- int featureId();
-
- /**
- * The wrapped EObject that the enum setting is stored on
- * @return
- */
- EObject wrappedObject();
-
- Object[] enumValues();
-
- /**
- * Return the Default Enumerator object
- */
- Object defaultValue();
-
- /**
- * Return the String to be displayed to the user
- * Deafult ([defaultString()])
- */
- String defaultString();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratedValueComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratedValueComposite.java
deleted file mode 100644
index c13c5f7954..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratedValueComposite.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.core.internal.mappings.GenerationType;
-import org.eclipse.jpt.core.internal.mappings.IGeneratedValue;
-import org.eclipse.jpt.core.internal.mappings.IId;
-import org.eclipse.jpt.core.internal.mappings.InheritanceType;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.core.internal.platform.IGeneratorRepository;
-import org.eclipse.jpt.core.internal.platform.NullGeneratorRepository;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.CComboViewer;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class GeneratedValueComposite extends BaseJpaComposite
-{
- private IId id;
- private IGeneratedValue generatedValue;
- private Adapter generatedValueListener;
-
- private CComboViewer strategyComboViewer;
-
- private CCombo generatorNameCombo;
-
- protected boolean populating;
-
- public GeneratedValueComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.generatedValueListener = buildGeneratedValueListener();
- }
-
- private Adapter buildGeneratedValueListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- generatedValueChanged(notification);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout(2, false);
- composite.setLayout(layout);
-
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.GeneratedValueComposite_strategy);
-
- this.strategyComboViewer = buildStrategyComboViewer(composite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.strategyComboViewer.getCombo().setLayoutData(gridData);
- helpSystem.setHelp(this.strategyComboViewer.getCombo(), IJpaHelpContextIds.MAPPING_GENERATED_VALUE_STRATEGY);
-
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.GeneratedValueComposite_generatorName);
-
- this.generatorNameCombo = buildGeneratorNameCombo(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.generatorNameCombo.setLayoutData(gridData);
- helpSystem.setHelp(this.generatorNameCombo, IJpaHelpContextIds.MAPPING_GENERATED_VALUE_GENERATOR_NAME);
-
- // TODO
- // buildGeneratorNameSelectionButton( this);
- }
-
- private CComboViewer buildStrategyComboViewer(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent);
- CComboViewer viewer = new CComboViewer(combo);
- viewer.setLabelProvider(buildStrategyLabelProvider());
- viewer.add(GenerationType.VALUES.toArray());
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- if (populating) {
- return;
- }
- if (event.getSelection() instanceof StructuredSelection) {
- StructuredSelection selection = (StructuredSelection) event.getSelection();
- GenerationType selectedType = (GenerationType) selection.getFirstElement();
- if (generatedValue == null) {
- createGeneratedValue();
- }
- if (!generatedValue.getStrategy().equals(selectedType)) {
- generatedValue.setStrategy(selectedType);
- }
- }
- }
- });
- return viewer;
- }
-
- private IBaseLabelProvider buildStrategyLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- if (element == GenerationType.DEFAULT) {
- //TODO need to move this to the model, don't want hardcoded String
- return NLS.bind(JptUiMappingsMessages.GeneratedValueComposite_default, "Auto");
- }
- return super.getText(element);
- }
- };
- }
-
-
- protected CCombo buildGeneratorNameCombo(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- combo.add(JptUiMappingsMessages.TableComposite_defaultEmpty);
- combo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String generatorName = ((CCombo) e.getSource()).getText();
-
- if (generatorName.equals("")) { //$NON-NLS-1$
- if (generatedValue.getGenerator() == null || generatedValue.getGenerator().equals("")) {
- return;
- }
- generatorName = null;
- }
- if (generatedValue == null) {
- createGeneratedValue();
- }
- generatedValue.setGenerator(generatorName);
- }
- });
- return combo;
- }
-
- private void createGeneratedValue() {
- IGeneratedValue generatedValue = this.id.createGeneratedValue();
- this.id.setGeneratedValue(generatedValue);
- }
-
-
- protected void generatedValueChanged(Notification notification) {
- if (notification.getFeatureID(IGeneratedValue.class) == JpaCoreMappingsPackage.IGENERATED_VALUE__STRATEGY) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- if (selectedStrategy() != generatedValue.getStrategy()) {
- strategyComboViewer.setSelection(new StructuredSelection(generatedValue.getStrategy()));
- }
- }
- });
- }
- else if (notification.getFeatureID(IGeneratedValue.class) == JpaCoreMappingsPackage.IGENERATED_VALUE__GENERATOR) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateGeneratorName();
- }
- });
- }
- }
-
- @Override
- protected void doPopulate(EObject obj) {
- this.id = (IId) obj;
- if (this.id == null) {
- this.generatedValue= null;
- }
- else {
- this.generatedValue = this.id.getGeneratedValue();
- }
- if (this.generatedValue == null) {
- this.strategyComboViewer.getCombo().deselectAll();
- this.generatorNameCombo.setText("");
- this.populating = false;
- return;
- }
- populateStrategyCombo();
- populateGeneratorNameCombo();
- }
-
- @Override
- protected void doPopulate() {
-
- }
-
- protected void engageListeners() {
- if (this.generatedValue != null) {
- this.generatedValue.eAdapters().add(this.generatedValueListener);
- }
- }
-
- protected void disengageListeners() {
- if (this.generatedValue != null) {
- this.generatedValue.eAdapters().remove(this.generatedValueListener);
- }
- }
-
- private IGeneratorRepository getGeneratorRepository() {
- return NullGeneratorRepository.instance(); //this.id.getJpaProject().getPlatform().generatorRepository(this.id.typeMapping().getPersistentType());
- }
-
- private void populateGeneratorNameCombo() {
- this.generatorNameCombo.removeAll();
- for (Iterator<String> i = getGeneratorRepository().generatorNames(); i.hasNext(); ){
- this.generatorNameCombo.add(i.next());
- }
-
- populateGeneratorName();
- }
- private void populateGeneratorName() {
- String generatorName = this.generatedValue.getGenerator();
- if (generatorName == null || generatorName.equals("")) {
- this.generatorNameCombo.setText("");
- }
- else if (!this.generatorNameCombo.getText().equals(generatorName)) {
- this.generatorNameCombo.setText(generatorName);
- }
- }
-
- private void populateStrategyCombo() {
- GenerationType selectedType = selectedStrategy();
- GenerationType strategy = this.generatedValue.getStrategy();
- if (strategy == GenerationType.AUTO) {
- if (selectedType != GenerationType.AUTO) {
- this.strategyComboViewer.setSelection(new StructuredSelection(GenerationType.AUTO));
- }
- }
- else if (strategy == GenerationType.SEQUENCE) {
- if (selectedType != GenerationType.SEQUENCE) {
- this.strategyComboViewer.setSelection(new StructuredSelection(GenerationType.SEQUENCE));
- }
- }
- else if (strategy == GenerationType.IDENTITY) {
- if (selectedType != GenerationType.IDENTITY) {
- this.strategyComboViewer.setSelection(new StructuredSelection(GenerationType.IDENTITY));
- }
- }
- else if (strategy == GenerationType.TABLE) {
- if (selectedType != GenerationType.TABLE) {
- this.strategyComboViewer.setSelection(new StructuredSelection(GenerationType.TABLE));
- }
- }
- else {
- if (selectedType != GenerationType.DEFAULT) {
- this.strategyComboViewer.setSelection(new StructuredSelection(GenerationType.DEFAULT));
- }
- }
- // TODO first initialization
- }
-
- private GenerationType selectedStrategy() {
- return (GenerationType) ((StructuredSelection) this.strategyComboViewer.getSelection()).getFirstElement();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratorComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratorComposite.java
deleted file mode 100644
index a9f0227daf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratorComposite.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.IGenerator;
-import org.eclipse.jpt.core.internal.mappings.IId;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * GeneratorComposite
- */
-public abstract class GeneratorComposite<E extends IGenerator> extends BaseJpaComposite
-{
- private IId id;
- private E generator;
- private Adapter generatorListener;
-
- protected Text nameTextWidget;
-
- public GeneratorComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.generatorListener = buildGeneratorListner();
- }
-
- private Adapter buildGeneratorListner() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- generatorChanged(notification);
- }
- };
- }
-
- /**
- * Builds the Generator specifiedName viewer.
- *
- * @param parent
- * @return
- */
- protected Text buildNameText(Composite parent) {
- final Text text = getWidgetFactory().createText(parent, null);
- text.addModifyListener(new ModifyListener() {
- public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
-
- String name = text.getText();
- if (name.equals("")) { //$NON-NLS-1$
- if (getGenerator().getName() == null) {
- return;
- }
- name = null;
- }
- IGenerator generator = getGenerator();
- if (generator == null) {
- generator = createGenerator();
- }
- generator.setName(name);
- }
- });
- return text;
- }
-
- protected abstract E createGenerator();
-
- @Override
- protected void doPopulate(EObject obj) {
- this.id = (IId) obj;
- if (this.id == null) {
- this.generator = null;
- return;
- }
- this.generator = generator(this.id);
- if (this.generator == null) {
- clear();
- return;
- }
- populateNameViewer();
- return;
- }
-
- @Override
- protected void doPopulate() {
- populateNameViewer();
- }
-
- protected void engageListeners() {
- if (this.generator != null) {
- this.generator.eAdapters().add(this.generatorListener);
- }
- }
-
- protected void disengageListeners() {
- if (this.generator != null) {
- this.generator.eAdapters().remove(this.generatorListener);
- }
- }
-
- protected abstract E generator(IId id);
-
- protected IId idMapping() {
- return this.id;
- }
-
- protected void generatorChanged(Notification notification) {
- if (notification.getFeatureID(IGenerator.class) == JpaCoreMappingsPackage.IGENERATOR__NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- if (nameTextWidget.getText() == null || !nameTextWidget.getText().equals(getGenerator().getName())) {
- if (getGenerator().getName() == null) {
- clearNameViewer();
- }
- else {
- nameTextWidget.setText(getGenerator().getName());
- }
- }
- }
- });
- }
- }
-
- private void populateNameViewer() {
- String name = this.getGenerator().getName();
- if (name != null) {
- if (!this.nameTextWidget.getText().equals(name)) {
- this.nameTextWidget.setText(name);
- }
- }
- else {
- this.clearNameViewer();
- }
- }
-
- protected E getGenerator() {
- return this.generator;
- }
-
- protected void clear() {
- this.clearNameViewer();
- }
-
- protected void clearNameViewer() {
- this.nameTextWidget.setText(""); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/IdComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/IdComposite.java
deleted file mode 100644
index b71d4cfffe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/IdComposite.java
+++ /dev/null
@@ -1,459 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jpt.core.internal.mappings.IGeneratedValue;
-import org.eclipse.jpt.core.internal.mappings.IId;
-import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator;
-import org.eclipse.jpt.core.internal.mappings.ITableGenerator;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.core.internal.mappings.TemporalType;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class IdComposite extends BaseJpaComposite
-{
- private IId id;
- private Adapter idListener;
-
- private ColumnComposite columnComposite;
-
- private EnumComboViewer temporalTypeViewer;
-
- private Section pkGenerationSection;
- private Button primaryKeyGenerationCheckBox;
- private GeneratedValueComposite generatedValueComposite;
-
- private Section tableGenSection;
- private Button tableGeneratorCheckBox;
- private TableGeneratorComposite tableGeneratorComposite;
-
- private Section sequenceGenSection;
- private Button sequenceGeneratorCheckBox;
- private SequenceGeneratorComposite sequenceGeneratorComposite;
-
-
- public IdComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.idListener = buildIdListener();
- }
-
- private Adapter buildIdListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- idMappingChanged(notification);
- }
- };
- }
- void idMappingChanged(Notification notification) {
- switch (notification.getFeatureID(IId.class)) {
- case JpaCoreMappingsPackage.IID__TABLE_GENERATOR :
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- IdComposite.this.populateTableGeneratorComposite();
- }
- });
- break;
- case JpaCoreMappingsPackage.IID__SEQUENCE_GENERATOR :
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- IdComposite.this.populateSequenceGeneratorComposite();
- }
- });
- break;
- case JpaCoreMappingsPackage.IID__GENERATED_VALUE :
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- IdComposite.this.populateGeneratedValueComposite();
- }
- });
- break;
- }
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
-
- Control generalControl = buildGeneralComposite(composite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- generalControl.setLayoutData(gridData);
-
- Control generationControl = buildGenerationComposite(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- generationControl.setLayoutData(gridData);
- }
-
- private Control buildGeneralComposite(Composite composite) {
- Composite generalComposite = getWidgetFactory().createComposite(composite);
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- generalComposite.setLayout(layout);
-
- this.columnComposite = new ColumnComposite(generalComposite, this.commandStack, getWidgetFactory());
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalSpan = 2;
- this.columnComposite.getControl().setLayoutData(gridData);
-
- CommonWidgets.buildTemporalLabel(generalComposite, getWidgetFactory());
- this.temporalTypeViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.temporalTypeViewer.getControl().setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(temporalTypeViewer.getControl(), IJpaHelpContextIds.MAPPING_TEMPORAL);
-
- return generalComposite;
- }
-
- private Control buildGenerationComposite(Composite composite) {
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-
- this.pkGenerationSection = getWidgetFactory().createSection(composite, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
- this.pkGenerationSection.setText(JptUiMappingsMessages.IdMappingComposite_primaryKeyGeneration);
-
- Composite generationClient = getWidgetFactory().createComposite(this.pkGenerationSection);
- this.pkGenerationSection.setClient(generationClient);
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- generationClient.setLayout(layout);
-
- this.primaryKeyGenerationCheckBox = buildPrimaryKeyGenerationCheckBox(generationClient);
- GridData gridData = new GridData();
- this.primaryKeyGenerationCheckBox.setLayoutData(gridData);
- helpSystem.setHelp(primaryKeyGenerationCheckBox, IJpaHelpContextIds.MAPPING_PRIMARY_KEY_GENERATION);
-
- this.generatedValueComposite = new GeneratedValueComposite(generationClient, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalIndent = 20;
- this.generatedValueComposite.getControl().setLayoutData(gridData);
-
- this.tableGenSection = getWidgetFactory().createSection(generationClient, SWT.FLAT | ExpandableComposite.TWISTIE);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.tableGenSection.setLayoutData(gridData);
-
- this.tableGenSection.setText(JptUiMappingsMessages.IdMappingComposite_tableGenerator);
-
- Composite tableGenClient = getWidgetFactory().createComposite(this.tableGenSection);
- this.tableGenSection.setClient(tableGenClient);
-
- layout = new GridLayout();
- layout.marginWidth = 0;
- tableGenClient.setLayout(layout);
-
- this.tableGeneratorCheckBox = buildTableGeneratorCheckBox(tableGenClient);
- gridData = new GridData();
- this.tableGeneratorCheckBox.setLayoutData(gridData);
- helpSystem.setHelp(tableGeneratorCheckBox, IJpaHelpContextIds.MAPPING_TABLE_GENERATOR);
-
- this.tableGeneratorComposite = new TableGeneratorComposite(tableGenClient, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalIndent = 20;
- this.tableGeneratorComposite.getControl().setLayoutData(gridData);
-
-
-
- this.sequenceGenSection = getWidgetFactory().createSection(generationClient, SWT.FLAT | ExpandableComposite.TWISTIE);
- this.sequenceGenSection.setText(JptUiMappingsMessages.IdMappingComposite_sequenceGenerator);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.sequenceGenSection.setLayoutData(gridData);
-
- Composite sequenceGenClient = getWidgetFactory().createComposite(this.sequenceGenSection);
- this.sequenceGenSection.setClient(sequenceGenClient);
-
- layout = new GridLayout();
- layout.marginWidth = 0;
- sequenceGenClient.setLayout(layout);
-
- this.sequenceGeneratorCheckBox = buildSequenceGeneratorCheckBox(sequenceGenClient);
- gridData = new GridData();
- this.sequenceGeneratorCheckBox.setLayoutData(gridData);
- helpSystem.setHelp(sequenceGeneratorCheckBox, IJpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR);
-
- this.sequenceGeneratorComposite = new SequenceGeneratorComposite(sequenceGenClient, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalIndent = 20;
- this.sequenceGeneratorComposite.getControl().setLayoutData(gridData);
-
- return this.pkGenerationSection;
- }
-
- private Button buildPrimaryKeyGenerationCheckBox(Composite parent) {
- Button button = getWidgetFactory().createButton(parent,JptUiMappingsMessages.IdMappingComposite_primaryKeyGeneration, SWT.CHECK);
- button.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // ignore
- }
-
- public void widgetSelected(SelectionEvent e) {
- IdComposite.this.primaryKeyGenerationCheckBoxClicked(e);
- }
- });
- return button;
- }
-
- void primaryKeyGenerationCheckBoxClicked(SelectionEvent e) {
- boolean mappingHasGeneratedValue = this.id.getGeneratedValue() != null;
- boolean checked = this.primaryKeyGenerationCheckBox.getSelection();
- if (checked == mappingHasGeneratedValue) {
- return;
- }
- IGeneratedValue generatedValue = null;
- if (checked) {
- generatedValue = this.id.createGeneratedValue();
- }
- this.id.setGeneratedValue(generatedValue);
- }
-
- private Button buildTableGeneratorCheckBox(Composite parent) {
- Button button = getWidgetFactory().createButton(parent,JptUiMappingsMessages.IdMappingComposite_tableGenerator, SWT.CHECK);
- button.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // ignore
- }
-
- public void widgetSelected(SelectionEvent e) {
- IdComposite.this.tableGeneratorCheckBoxClicked(e);
- }
- });
- return button;
- }
-
- void tableGeneratorCheckBoxClicked(SelectionEvent e) {
- boolean mappingHasTableGenerator = this.id.getTableGenerator() != null;
- boolean checked = this.tableGeneratorCheckBox.getSelection();
- if (checked == mappingHasTableGenerator) {
- return;
- }
- ITableGenerator tableGenerator = null;
- if (checked) {
- tableGenerator = this.id.createTableGenerator();
- }
- this.id.setTableGenerator(tableGenerator);
- if (checked) {
- IGeneratedValue generatedValue = this.id.getGeneratedValue();
- if (generatedValue != null && generatedValue.getGenerator() != null) {
- tableGenerator.setName(generatedValue.getGenerator());
- }
- }
- }
-
- private Button buildSequenceGeneratorCheckBox(Composite parent) {
- Button button = getWidgetFactory().createButton(parent,JptUiMappingsMessages.IdMappingComposite_sequenceGenerator, SWT.CHECK);
- button.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // ignore
- }
-
- public void widgetSelected(SelectionEvent e) {
- IdComposite.this.sequenceGeneratorCheckBoxClicked(e);
- }
- });
- return button;
- }
-
- void sequenceGeneratorCheckBoxClicked(SelectionEvent e) {
- boolean mappingHasSequenceGenerator = this.id.getSequenceGenerator() != null;
- boolean checked = this.sequenceGeneratorCheckBox.getSelection();
- if (checked == mappingHasSequenceGenerator) {
- return;
- }
- ISequenceGenerator sequenceGenerator = null;
- if (checked) {
- sequenceGenerator = this.id.createSequenceGenerator();
- }
- this.id.setSequenceGenerator(sequenceGenerator);
- if (checked) {
- IGeneratedValue generatedValue = this.id.getGeneratedValue();
- if (generatedValue != null && generatedValue.getGenerator() != null) {
- sequenceGenerator.setName(generatedValue.getGenerator());
- }
- }
- }
-
-
-
- public void doPopulate(EObject obj) {
- this.id = (IId) obj;
- if (this.id != null) {
- this.columnComposite.populate(this.id.getColumn());
- }
- else {
- this.columnComposite.populate(null);
- this.generatedValueComposite.populate(null);
- this.tableGeneratorComposite.populate(null);
- this.sequenceGeneratorComposite.populate(null);
- return;
- }
- this.pkGenerationSection.setExpanded(true);
- this.temporalTypeViewer.populate(new TemporalTypeHolder(this.id));
- populateGeneratedValueComposite();
- populateSequenceGeneratorComposite();
- populateTableGeneratorComposite();
- }
-
- public void doPopulate() {
- this.columnComposite.populate();
- this.temporalTypeViewer.populate();
- this.generatedValueComposite.populate();
- this.tableGeneratorComposite.populate();
- this.sequenceGeneratorComposite.populate();
- }
-
- private void populateTableGeneratorComposite() {
- this.tableGeneratorComposite.populate(this.id);
- boolean tableGeneratorExists = this.id.getTableGenerator() != null;
- this.tableGeneratorCheckBox.setSelection(tableGeneratorExists);
- if (tableGeneratorExists) {
- this.tableGenSection.setExpanded(true);
- }
- }
-
- private void populateSequenceGeneratorComposite() {
- this.sequenceGeneratorComposite.populate(this.id);
- boolean sequenceGeneratorExists = this.id.getSequenceGenerator() != null;
- this.sequenceGeneratorCheckBox.setSelection(sequenceGeneratorExists);
- if (sequenceGeneratorExists) {
- this.sequenceGenSection.setExpanded(true);
- }
- }
-
- private void populateGeneratedValueComposite() {
- this.generatedValueComposite.populate(this.id);
- this.primaryKeyGenerationCheckBox.setSelection(this.id.getGeneratedValue() != null);
- }
-
-
- protected void engageListeners() {
- if (this.id !=null) {
- this.id.eAdapters().add(this.idListener);
- }
- }
-
- protected void disengageListeners() {
- if (this.id !=null) {
- this.id.eAdapters().remove(this.idListener);
- }
- }
-
- @Override
- public void dispose() {
- this.columnComposite.dispose();
- this.temporalTypeViewer.dispose();
- this.generatedValueComposite.dispose();
- this.tableGeneratorComposite.dispose();
- this.sequenceGeneratorComposite.dispose();
- super.dispose();
- }
-
- protected IId getId() {
- return this.id;
- }
-
- private class TemporalTypeHolder extends EObjectImpl implements EnumHolder {
-
- private IId id;
-
- TemporalTypeHolder(IId id) {
- super();
- this.id = id;
- }
-
- public Object get() {
- return this.id.getTemporal();
- }
-
- public void set(Object enumSetting) {
- this.id.setTemporal((TemporalType) enumSetting);
- }
-
- public Class featureClass() {
- return IId.class;
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.IID__TEMPORAL;
- }
-
- public EObject wrappedObject() {
- return this.id;
- }
-
- public Object[] enumValues() {
- return TemporalType.VALUES.toArray();
- }
-
- /**
- * TemporalType has no Default, return null
- */
- public Object defaultValue() {
- return null;
- }
-
- /**
- * TemporalType has no Default, return null
- */
- public String defaultString() {
- return null;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InheritanceComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InheritanceComposite.java
deleted file mode 100644
index deb61540bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InheritanceComposite.java
+++ /dev/null
@@ -1,620 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.core.internal.mappings.DiscriminatorType;
-import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn;
-import org.eclipse.jpt.core.internal.mappings.IEntity;
-import org.eclipse.jpt.core.internal.mappings.INamedColumn;
-import org.eclipse.jpt.core.internal.mappings.InheritanceType;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.db.internal.Connection;
-import org.eclipse.jpt.db.internal.ConnectionListener;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.Database;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.CComboViewer;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class InheritanceComposite extends BaseJpaComposite {
-
- private IEntity entity;
- private IDiscriminatorColumn discriminatorColumn;
- private final Adapter entityListener;
- private final Adapter discriminatorColumnListener;
-
- private CComboViewer strategyViewer;
- private CCombo columnCombo;
- private CComboViewer discriminatorTypeViewer;
- private CCombo discriminatorValueCombo;
-
- private ConnectionListener connectionListener;
-
- private ConnectionProfile connectionProfile;
-
-
- private PrimaryKeyJoinColumnsComposite pkJoinColumnsComposite;
-
- public InheritanceComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.entityListener = buildEntityListener();
- this.discriminatorColumnListener = buildDiscriminatorColumnListener();
- this.connectionListener = buildConnectionListener();
- }
-
- private Adapter buildEntityListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- entityChanged(notification);
- }
- };
- }
-
- private Adapter buildDiscriminatorColumnListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- discriminatorColumnChanged(notification);
- }
- };
- }
-
- private ConnectionListener buildConnectionListener() {
- return new ConnectionListener() {
-
- public void aboutToClose(Connection connection) {
- // not interested to this event.
- }
-
- public void closed(Connection connection) {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- InheritanceComposite.this.populateColumnCombo();
- }
- });
- }
-
- public void modified(Connection connection) {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- InheritanceComposite.this.populateColumnCombo();
- }
- });
- }
-
- public boolean okToClose(Connection connection) {
- // not interested to this event.
- return true;
- }
-
- public void opened(Connection connection) {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- InheritanceComposite.this.populateColumnCombo();
- }
- });
- }
-
- public void databaseChanged(Connection connection, final Database database) {
- return;
- }
-
- public void schemaChanged(Connection connection, final Schema schema) {
- return;
- }
-
- public void tableChanged(Connection connection, final Table table) {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- if(table == getDbTable()) {
- if (!getControl().isDisposed()) {
- InheritanceComposite.this.populateColumnCombo();
- }
- }
- }
- });
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- GridData gridData;
-
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.InheritanceComposite_strategy);
-
- this.strategyViewer = buildStrategyCombo(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.strategyViewer.getCombo().setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.strategyViewer.getCombo(), IJpaHelpContextIds.ENTITY_INHERITANCE_STRATEGY);
-
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.DiscriminatorColumnComposite_column);
-
- this.columnCombo = buildColumnCombo(composite);
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.columnCombo.setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.columnCombo, IJpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_COLUMN);
-
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.DiscriminatorColumnComposite_discriminatorType);
-
- this.discriminatorTypeViewer = buildDiscriminatorTypeCombo(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.discriminatorTypeViewer.getCombo().setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.discriminatorTypeViewer.getCombo(), IJpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_TYPE);
-
-
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.InheritanceComposite_discriminatorValue);
-
- this.discriminatorValueCombo = buildDiscriminatorValueCombo(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.discriminatorValueCombo.setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.discriminatorValueCombo, IJpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_VALUE);
-
- this.pkJoinColumnsComposite = new PrimaryKeyJoinColumnsComposite(composite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalSpan = 2;
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessVerticalSpace = true;
- this.pkJoinColumnsComposite.getControl().setLayoutData(gridData);
- }
-
- private CComboViewer buildStrategyCombo(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent);
- CComboViewer strategyViewer = new CComboViewer(combo);
- strategyViewer.setLabelProvider(buildStrategyLabelProvider());
- strategyViewer.add(InheritanceType.VALUES.toArray());
- strategyViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- InheritanceComposite.this.strategySelectionChanged(event.getSelection());
- }
- });
-
- return strategyViewer;
- }
-
- private IBaseLabelProvider buildStrategyLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- if (element == InheritanceType.DEFAULT) {
- //TODO need to move this to the model, don't want hardcoded String
- return NLS.bind(JptUiMappingsMessages.InheritanceComposite_default, "Single Table");
- }
- return super.getText(element);
- }
- };
- }
-
- void strategySelectionChanged(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- InheritanceType inheritanceType = (InheritanceType) ((IStructuredSelection) selection).getFirstElement();
- if ( ! this.entity.getInheritanceStrategy().equals(inheritanceType)) {
- this.entity.setInheritanceStrategy(inheritanceType);
- }
- }
- }
-
- private CCombo buildColumnCombo(Composite parent) {
- final CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- combo.add(JptUiMappingsMessages.ColumnComposite_defaultEmpty);
- combo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String tableText = ((CCombo) e.getSource()).getText();
- if (tableText.equals("")) { //$NON-NLS-1$
- tableText = null;
- if (discriminatorColumn.getSpecifiedName() == null || discriminatorColumn.getSpecifiedName().equals("")) { //$NON-NLS-1$
- return;
- }
- }
-
- if (tableText != null && combo.getItemCount() > 0 && tableText.equals(combo.getItem(0))) {
- tableText = null;
- }
-
- if (discriminatorColumn.getSpecifiedName() == null && tableText != null) {
- discriminatorColumn.setSpecifiedName(tableText);
- }
- if (discriminatorColumn.getSpecifiedName() != null && !discriminatorColumn.getSpecifiedName().equals(tableText)) {
- discriminatorColumn.setSpecifiedName(tableText);
- }
- }
- });
- return combo;
-
- }
-
- private CComboViewer buildDiscriminatorTypeCombo(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent);
- CComboViewer discriminatorTypeViewer = new CComboViewer(combo);
- discriminatorTypeViewer.setLabelProvider(buildDiscriminatorTypeLabelProvider());
- discriminatorTypeViewer.add(DiscriminatorType.VALUES.toArray());
-
- discriminatorTypeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- InheritanceComposite.this.discriminatorTypeSelectionChanged(event.getSelection());
- }
- });
-
- return discriminatorTypeViewer;
- }
-
- private IBaseLabelProvider buildDiscriminatorTypeLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- if (element == DiscriminatorType.DEFAULT) {
- //TODO need to move this to the model, don't want hardcoded String
- return NLS.bind(JptUiMappingsMessages.InheritanceComposite_defaultDiscriminatorType, "String");
- }
- return super.getText(element);
- }
- };
- }
-
- void discriminatorTypeSelectionChanged(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- DiscriminatorType discriminatorType = (DiscriminatorType) ((IStructuredSelection) selection).getFirstElement();
- if ( ! this.discriminatorColumn.getDiscriminatorType().equals(discriminatorType)) {
- this.discriminatorColumn.setDiscriminatorType(discriminatorType);
- }
- }
- }
-
- private CCombo buildDiscriminatorValueCombo(Composite parent) {
- final CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- combo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String discriminatorValue = entity.getSpecifiedDiscriminatorValue();
- String value = ((CCombo) e.getSource()).getText();
- if (value.equals("")) { //$NON-NLS-1$
- value = null;
- if (discriminatorValue == null || discriminatorValue.equals("")) { //$NON-NLS-1$
- return;
- }
- }
-
- if (value != null && combo.getItemCount() > 0 && value.equals(combo.getItem(0))) {
- value = null;
- }
-
- if (discriminatorValue == null || !discriminatorValue.equals(value)) {
- entity.setSpecifiedDiscriminatorValue(value);
- }
- }
- });
- return combo;
- }
-
- public void doPopulate(EObject obj) {
- this.entity = (IEntity) obj;
- if (this.entity != null) {
- this.discriminatorColumn = this.entity.getDiscriminatorColumn();
- populateColumnCombo();
- popuplateDiscriminatorTypeComboViewer();
- populateStrategyComboViewer();
- populateDiscriminatorValueCombo();
- this.pkJoinColumnsComposite.populate(this.entity);
- }
- else {
- this.discriminatorColumn = null;
- this.connectionProfile = null;
- }
- }
-
- public void doPopulate() {
- if (this.entity != null) {
- populateColumnCombo();
-// popuplateStrategyComboViewer();
-// popuplateDiscriminatorValueCombo();
- }
- }
-
- @Override
- protected void engageListeners() {
- if (this.entity != null) {
- this.entity.eAdapters().add(this.entityListener);
- this.discriminatorColumn.eAdapters().add(this.discriminatorColumnListener);
- this.addConnectionListener();
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.entity != null) {
- this.entity.eAdapters().remove(this.entityListener);
- this.removeConnectionListener();
- this.discriminatorColumn.eAdapters().remove(this.discriminatorColumnListener);
- }
- }
-
- private ConnectionProfile getConnectionProfile() {
- if(this.connectionProfile == null) {
- this.connectionProfile = this.entity.getJpaProject().connectionProfile();
- }
- return this.connectionProfile;
- }
-
- private void addConnectionListener() {
- this.getConnectionProfile().addConnectionListener(this.connectionListener);
- }
-
- private void removeConnectionListener() {
- this.getConnectionProfile().removeConnectionListener(this.connectionListener);
- }
-
- private Table getDbTable() {
- return this.entity.primaryDbTable();
- }
-
- private void populateColumnCombo() {
- //TODO don't do instanceof check here - check on Table, or isRoot check on Entity
- //this.tableCombo.setEnabled(!(this.table instanceof SingleTableInheritanceChildTableImpl));
- populateDefaultColumnName();
-
- if (this.getConnectionProfile().isConnected()) {
- this.columnCombo.remove(1, this.columnCombo.getItemCount()-1);
- Table table = getDbTable();
- if (table != null) {
- for (Iterator i = CollectionTools.sort(CollectionTools.list(table.columnNames())).iterator(); i.hasNext();) {
- this.columnCombo.add((String) i.next());
- }
- }
- }
- else {
- this.columnCombo.remove(1, this.columnCombo.getItemCount()-1);
- }
- populateColumnName();
- }
-
- protected void populateDefaultColumnName() {
- String defaultTableName = discriminatorColumn.getDefaultName();
- int selectionIndex = columnCombo.getSelectionIndex();
- columnCombo.setItem(0, NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultTableName));
- if (selectionIndex == 0) {
- //combo text does not update when switching between 2 mappings of the same type
- //that both have a default column name. clear the selection and then set it again
- columnCombo.clearSelection();
- columnCombo.select(0);
- }
- }
-
- protected void populateColumnName() {
- String tableName = this.discriminatorColumn.getSpecifiedName();
- String defaultName = this.discriminatorColumn.getDefaultName();
- if (tableName != null) {
- if (!this.columnCombo.getText().equals(tableName)) {
- this.columnCombo.setText(tableName);
- }
- }
- else {
- if (!this.columnCombo.getText().equals(NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultName))) {
- this.columnCombo.select(0);
- }
- }
- }
-
- private void popuplateDiscriminatorTypeComboViewer() {
- if (this.discriminatorColumn.getDiscriminatorType() == DiscriminatorType.DEFAULT) {
- if (((StructuredSelection) this.discriminatorTypeViewer.getSelection()).getFirstElement() != DiscriminatorType.DEFAULT) {
- this.discriminatorTypeViewer.setSelection(new StructuredSelection(DiscriminatorType.DEFAULT));
- }
- }
- else if (this.discriminatorColumn.getDiscriminatorType() == DiscriminatorType.CHAR) {
- if (((StructuredSelection) this.discriminatorTypeViewer.getSelection()).getFirstElement() != DiscriminatorType.CHAR) {
- this.discriminatorTypeViewer.setSelection(new StructuredSelection(DiscriminatorType.CHAR));
- }
- }
- else if (this.discriminatorColumn.getDiscriminatorType() == DiscriminatorType.INTEGER) {
- if (((StructuredSelection) this.discriminatorTypeViewer.getSelection()).getFirstElement() != DiscriminatorType.INTEGER) {
- this.discriminatorTypeViewer.setSelection(new StructuredSelection(DiscriminatorType.INTEGER));
- }
- }
- else {
- if (((StructuredSelection) this.discriminatorTypeViewer.getSelection()).getFirstElement() != DiscriminatorType.STRING) {
- this.discriminatorTypeViewer.setSelection(new StructuredSelection(DiscriminatorType.STRING));
- }
- }
- }
-
- private void populateStrategyComboViewer() {
- if (this.entity.getInheritanceStrategy() == InheritanceType.DEFAULT) {
- if (((StructuredSelection) this.strategyViewer.getSelection()).getFirstElement() != InheritanceType.DEFAULT) {
- this.strategyViewer.setSelection(new StructuredSelection(InheritanceType.DEFAULT));
- }
- }
- else if (this.entity.getInheritanceStrategy() == InheritanceType.JOINED) {
- if (((StructuredSelection) this.strategyViewer.getSelection()).getFirstElement() != InheritanceType.JOINED) {
- this.strategyViewer.setSelection(new StructuredSelection(InheritanceType.JOINED));
- }
- }
- else if (this.entity.getInheritanceStrategy() == InheritanceType.SINGLE_TABLE) {
- if (((StructuredSelection) this.strategyViewer.getSelection()).getFirstElement() != InheritanceType.SINGLE_TABLE) {
- this.strategyViewer.setSelection(new StructuredSelection(InheritanceType.SINGLE_TABLE));
- }
- }
- else {
- if (((StructuredSelection) this.strategyViewer.getSelection()).getFirstElement() != InheritanceType.TABLE_PER_CLASS) {
- this.strategyViewer.setSelection(new StructuredSelection(InheritanceType.TABLE_PER_CLASS));
- }
- }
- }
-
- private void populateDiscriminatorValueCombo() {
- String specifiedValue = this.entity.getSpecifiedDiscriminatorValue();
- String defaultValue = this.entity.getDefaultDiscriminatorValue();
-
- if (this.entity.discriminatorValueIsAllowed()) {
- this.discriminatorValueCombo.setEnabled(true);
- if (this.discriminatorValueCombo.getItemCount() == 0) {
- this.discriminatorValueCombo.add(JptUiMappingsMessages.DiscriminatorColumnComposite_defaultEmpty);
- }
- if (defaultValue != null) {
- this.discriminatorValueCombo.setItem(0, NLS.bind(JptUiMappingsMessages.ColumnComposite_defaultWithOneParam, defaultValue));
- }
- else {
- this.discriminatorValueCombo.setItem(0, JptUiMappingsMessages.DiscriminatorColumnComposite_defaultEmpty);
- }
- }
- else {
- this.discriminatorValueCombo.setEnabled(false);
- if (this.discriminatorValueCombo.getItemCount() == 1) {
- this.discriminatorValueCombo.setText("");
- this.discriminatorValueCombo.removeAll();
- }
- }
-
- if (specifiedValue != null) {
- if (!this.discriminatorValueCombo.getText().equals(specifiedValue)) {
- this.discriminatorValueCombo.setText(specifiedValue);
- }
- }
- else {
- //combo text does not update when switching between 2 entities that both have a default discriminator value.
- //clear the selection and then set it again
- this.discriminatorValueCombo.clearSelection();
- this.discriminatorValueCombo.select(0);
- }
- }
-
- private void entityChanged(Notification notification) {
- if (notification.getFeatureID(IEntity.class) == JpaCoreMappingsPackage.IENTITY__INHERITANCE_STRATEGY) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- InheritanceType inheritanceType = entity.getInheritanceStrategy();
- if (((StructuredSelection) strategyViewer.getSelection()).getFirstElement() != inheritanceType) {
- strategyViewer.setSelection(new StructuredSelection(inheritanceType));
- }
- }
- });
- }
- else if (notification.getFeatureID(IEntity.class) == JpaCoreMappingsPackage.IENTITY__SPECIFIED_DISCRIMINATOR_VALUE) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- String discriminatorValue = entity.getSpecifiedDiscriminatorValue();
- if (discriminatorValueCombo.getText() == null || !discriminatorValueCombo.getText().equals(discriminatorValue)) {
- if (discriminatorValue == null) {
- discriminatorValueCombo.select(0);
- }
- else {
- discriminatorValueCombo.setText(discriminatorValue);
- }
- }
- }
- });
- }
- else if (notification.getFeatureID(IEntity.class) == JpaCoreMappingsPackage.IENTITY__DEFAULT_DISCRIMINATOR_VALUE) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateDiscriminatorValueCombo();
- }
- });
- }
- }
-
- protected void discriminatorColumnChanged(Notification notification) {
- if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateColumnName();
- }
- });
- }
- else if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateDefaultColumnName();
- }
- });
- }
-
- else if (notification.getFeatureID(IDiscriminatorColumn.class) == JpaCoreMappingsPackage.IDISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- DiscriminatorType discriminatorType = discriminatorColumn.getDiscriminatorType();
- if (((StructuredSelection) discriminatorTypeViewer.getSelection()).getFirstElement() != discriminatorType) {
- discriminatorTypeViewer.setSelection(new StructuredSelection(discriminatorType));
- }
- }
- });
- }
- }
-
- public void dispose() {
- this.pkJoinColumnsComposite.dispose();
- super.dispose();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnDialog.java
deleted file mode 100644
index 4d45d3732b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnDialog.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.internal.mappings.IEntity;
-import org.eclipse.jpt.core.internal.mappings.IJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.IJoinTable;
-import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Shell;
-
-public class InverseJoinColumnDialog extends JoinColumnInJoinTableDialog {
-
- InverseJoinColumnDialog(Shell parent, IJoinTable joinTable) {
- super(parent, joinTable);
- }
-
- InverseJoinColumnDialog(Shell parent, IJoinColumn joinColumn) {
- super(parent, joinColumn);
- }
-
- protected String getTitle() {
- return JptUiMappingsMessages.InverseJoinColumnDialog_editInverseJoinColumn;
- }
-
- protected void populateNameCombo() {
- if (getJoinTable() == null) {
- return;
- }
- if (getJoinColumn() != null) {
- getNameCombo().add(NLS.bind(JptUiMappingsMessages.InverseJoinColumnDialog_defaultWithOneParam, getJoinColumn().getDefaultName()));
- }
- Table joinDBTable = getJoinTable().dbTable();
- if (joinDBTable != null) {
- for (Iterator i = joinDBTable.columnNames(); i.hasNext(); ) {
- getNameCombo().add((String) i.next());
- }
- }
- if (getJoinColumn() != null && getJoinColumn().getSpecifiedName() != null) {
- getNameCombo().setText(getJoinColumn().getSpecifiedName());
- }
- else {
- getNameCombo().select(0);
- }
- }
-
- protected void populateReferencedNameCombo() {
- if (getJoinTable() == null) {
- return;
- }
- if (getJoinColumn() != null) {
- getReferencedColumnNameCombo().add(NLS.bind(JptUiMappingsMessages.InverseJoinColumnDialog_defaultWithOneParam, getJoinColumn().getDefaultReferencedColumnName()));
- }
- IMultiRelationshipMapping multiRelationshipMapping = (IMultiRelationshipMapping) getJoinTable().eContainer();
- IEntity targetEntity = multiRelationshipMapping.getResolvedTargetEntity();
- if (targetEntity != null) {
- Table referencedDbTable = targetEntity.primaryDbTable();
- if (referencedDbTable != null) {
- for (Iterator i = referencedDbTable.columnNames(); i.hasNext(); ) {
- getReferencedColumnNameCombo().add((String) i.next());
- }
- }
- }
- if (getJoinColumn() != null && getJoinColumn().getSpecifiedReferencedColumnName() != null) {
- getReferencedColumnNameCombo().setText(getJoinColumn().getSpecifiedReferencedColumnName());
- }
- else {
- getReferencedColumnNameCombo().select(0);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnComposite.java
deleted file mode 100644
index 98b52e4fc1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnComposite.java
+++ /dev/null
@@ -1,428 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean;
-import org.eclipse.jpt.core.internal.mappings.IAbstractColumn;
-import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.IJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.INamedColumn;
-import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class JoinColumnComposite
- extends BaseJpaComposite
-{
- private ISingleRelationshipMapping singleRelationshipMapping;
- private final Adapter singleRelationshipMappingListener;
- private final Adapter joinColumnListener;
-
-
- private Group joinColumnsGroup;
- Button overrideDefaultJoinColumnsCheckBox;
- ListViewer joinColumnsListViewer;
- private Button joinColumnsRemoveButton;
- private Button joinColumnsEditButton;
-
-
-
- public JoinColumnComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.singleRelationshipMappingListener = buildSingleRelationshipMappingListener();
- this.joinColumnListener = buildJoinColumnListener();
- }
-
-
- private Adapter buildSingleRelationshipMappingListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- singleRelationshipMappingChanged(notification);
- }
- };
- }
-
- private Adapter buildJoinColumnListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- joinColumnChanged(notification);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
-
- this.overrideDefaultJoinColumnsCheckBox =
- getWidgetFactory().createButton(
- composite,
- JptUiMappingsMessages.JoinColumnComposite_overrideDefaultJoinColumns,
- SWT.CHECK);
- this.overrideDefaultJoinColumnsCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (JoinColumnComposite.this.overrideDefaultJoinColumnsCheckBox.getSelection()) {
- IJoinColumn defaultJoinColumn = JoinColumnComposite.this.singleRelationshipMapping.getDefaultJoinColumns().get(0);
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
-
- IJoinColumn joinColumn = JoinColumnComposite.this.singleRelationshipMapping.createJoinColumn(0);
- JoinColumnComposite.this.singleRelationshipMapping.getSpecifiedJoinColumns().add(joinColumn);
- joinColumn.setSpecifiedName(columnName);
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- } else {
- JoinColumnComposite.this.singleRelationshipMapping.getSpecifiedJoinColumns().clear();
- }
- }
- });
-
- this.joinColumnsGroup =
- getWidgetFactory().createGroup(
- composite,
- JptUiMappingsMessages.JoinColumnComposite_joinColumn);
- this.joinColumnsGroup.setLayout(new GridLayout(2, false));
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalSpan = 2;
- this.joinColumnsGroup.setLayoutData(gridData);
-
- this.joinColumnsListViewer = new ListViewer(this.joinColumnsGroup, SWT.BORDER | SWT.MULTI);
- this.joinColumnsListViewer.setContentProvider(buildJoinColumnsListContentProvider());
- this.joinColumnsListViewer.setLabelProvider(buildJoinColumnsListLabelProvider());
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.verticalSpan = 3;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- this.joinColumnsListViewer.getList().setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.joinColumnsListViewer.getList(), IJpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS);
-
- Button addJoinColumnButton = getWidgetFactory().createButton(this.joinColumnsGroup, JptUiMappingsMessages.JoinColumnComposite_add, SWT.NONE);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- addJoinColumnButton.setLayoutData(gridData);
- addJoinColumnButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- addJoinColumn();
- }
- });
-
- this.joinColumnsEditButton = getWidgetFactory().createButton(this.joinColumnsGroup, JptUiMappingsMessages.JoinColumnComposite_edit, SWT.NONE);
- this.joinColumnsEditButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- editJoinColumn();
- }
- });
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- this.joinColumnsEditButton.setLayoutData(gridData);
-
- this.joinColumnsRemoveButton = getWidgetFactory().createButton(this.joinColumnsGroup, JptUiMappingsMessages.JoinColumnComposite_remove, SWT.NONE);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- this.joinColumnsRemoveButton.setLayoutData(gridData);
- this.joinColumnsRemoveButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- removeJoinColumn();
- }
- });
-
- this.joinColumnsListViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateEnablement();
- }
- });
-
- }
- private IContentProvider buildJoinColumnsListContentProvider() {
- return new IStructuredContentProvider(){
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
- public void dispose() {
- // do nothing
- }
- public Object[] getElements(Object inputElement) {
- return ((ISingleRelationshipMapping) inputElement).getJoinColumns().toArray();
- }
- };
- }
-
- private ILabelProvider buildJoinColumnsListLabelProvider() {
- return new LabelProvider() {
- public String getText(Object element) {
- IJoinColumn joinColumn = (IJoinColumn) element;
- return (JoinColumnComposite.this.singleRelationshipMapping.getSpecifiedJoinColumns().size() == 0) ?
- buildDefaultJoinColumnLabel(joinColumn)
- :
- buildJoinColumnLabel(joinColumn);
- }
- };
- }
-
- String buildDefaultJoinColumnLabel(IJoinColumn joinColumn) {
- return NLS.bind(JptUiMappingsMessages.JoinColumnComposite_mappingBetweenTwoParamsDefault, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
-
- String buildJoinColumnLabel(IJoinColumn joinColumn) {
- if (joinColumn.getSpecifiedName() == null) {
- if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(JptUiMappingsMessages.JoinColumnComposite_mappingBetweenTwoParamsBothDefault, joinColumn.getName(),joinColumn.getReferencedColumnName());
- }
- return NLS.bind(JptUiMappingsMessages.JoinColumnComposite_mappingBetweenTwoParamsFirstDefault, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
- else if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(JptUiMappingsMessages.JoinColumnComposite_mappingBetweenTwoParamsSecDefault, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
- else {
- return NLS.bind(JptUiMappingsMessages.JoinColumnComposite_mappingBetweenTwoParams, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
- }
-
- protected void joinColumnChanged(Notification notification) {
- if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME
- || notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME
- || notification.getFeatureID(IAbstractColumn.class) == JpaCoreMappingsPackage.IABSTRACT_COLUMN__SPECIFIED_TABLE
- || notification.getFeatureID(IAbstractColumn.class) == JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE
- || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME
- || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- joinColumnsListViewer.refresh();
- }
- });
- }
- }
-
- void addJoinColumn() {
- JoinColumnDialog dialog = new JoinColumnInRelationshipMappingDialog(this.getControl().getShell(), this.singleRelationshipMapping);
- this.addJoinColumnFromDialog(dialog);
- }
-
- private void addJoinColumnFromDialog(JoinColumnDialog dialog) {
- if (dialog.open() != Window.OK) {
- return;
- }
- int index = this.singleRelationshipMapping.getJoinColumns().size();
- IJoinColumn joinColumn = this.singleRelationshipMapping.createJoinColumn(index);
- this.singleRelationshipMapping.getSpecifiedJoinColumns().add(joinColumn);
- joinColumn.setSpecifiedName(dialog.getSelectedName());
- joinColumn.setSpecifiedReferencedColumnName(dialog.getReferencedColumnName());
- if (!dialog.isDefaultTableSelected()) {
- //not checking this for name and referenced column name because there is no
- //default option when you are adding a second join column. There is always
- //at least 1 join column (the default)
- joinColumn.setSpecifiedTable(dialog.getSelectedTable());
- }
- }
-
- void editJoinColumn() {
- IJoinColumn joinColumn = getSelectedJoinColumn();
- JoinColumnDialog dialog = new JoinColumnInRelationshipMappingDialog(this.getControl().getShell(), joinColumn);
- editJoinColumnFromDialog(dialog, joinColumn);
- }
-
- private IJoinColumn getSelectedJoinColumn() {
- return (IJoinColumn) ((StructuredSelection) this.joinColumnsListViewer.getSelection()).getFirstElement();
- }
-
- private void editJoinColumnFromDialog(JoinColumnDialog dialog, IJoinColumn joinColumn) {
- if (dialog.open() == Window.OK) {
- editJoinColumnDialogOkd(dialog, joinColumn);
- }
- }
-
- private void editJoinColumnDialogOkd(JoinColumnDialog dialog, IJoinColumn joinColumn) {
- String name = dialog.getSelectedName();
- String referencedColumnName = dialog.getReferencedColumnName();
- String table = dialog.getSelectedTable();
-
- if (dialog.isDefaultNameSelected()) {
- if (joinColumn.getSpecifiedName() != null) {
- joinColumn.setSpecifiedName(null);
- }
- }
- else if (joinColumn.getSpecifiedName() == null || !joinColumn.getSpecifiedName().equals(name)){
- joinColumn.setSpecifiedName(name);
- }
- if (dialog.isDefaultReferencedColumnNameSelected()) {
- if (joinColumn.getSpecifiedReferencedColumnName() != null) {
- joinColumn.setSpecifiedReferencedColumnName(null);
- }
- }
- else if (joinColumn.getSpecifiedReferencedColumnName() == null || !joinColumn.getSpecifiedReferencedColumnName().equals(referencedColumnName)){
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- }
-
- if (dialog.isDefaultTableSelected()) {
- if (joinColumn.getSpecifiedTable() != null) {
- joinColumn.setSpecifiedTable(null);
- }
- }
- else if (joinColumn.getSpecifiedTable() == null || !joinColumn.getSpecifiedTable().equals(table)){
- joinColumn.setSpecifiedTable(table);
- }
-
- DefaultTrueBoolean insertable = dialog.getInsertable();
- if (joinColumn.getInsertable() != insertable) {
- joinColumn.setInsertable(insertable);
- }
-
- DefaultTrueBoolean updatable = dialog.getUpdatable();
- if (joinColumn.getUpdatable() != updatable) {
- joinColumn.setUpdatable(updatable);
- }
- }
-
- void removeJoinColumn() {
- ISelection selection = this.joinColumnsListViewer.getSelection();
- if (selection instanceof StructuredSelection) {
- for (Iterator stream = ((StructuredSelection) selection).iterator(); stream.hasNext(); ) {
- this.singleRelationshipMapping.getJoinColumns().remove(stream.next());
- }
- }
- }
-
- protected void singleRelationshipMappingChanged(Notification notification) {
- if (notification.getFeatureID(ISingleRelationshipMapping.class) == JpaCoreMappingsPackage.ISINGLE_RELATIONSHIP_MAPPING__SPECIFIED_JOIN_COLUMNS) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- JoinColumnComposite.this.joinColumnsListViewer.refresh();
- JoinColumnComposite.this.overrideDefaultJoinColumnsCheckBox.setSelection(singleRelationshipMapping.containsSpecifiedJoinColumns());
- JoinColumnComposite.this.updateEnablement();
- }
- });
- if (notification.getEventType() == Notification.ADD) {
- ((IJoinColumn) notification.getNewValue()).eAdapters().add(this.joinColumnListener);
- }
- else if (notification.getEventType() == Notification.REMOVE) {
- ((IJoinColumn) notification.getOldValue()).eAdapters().remove(this.joinColumnListener);
- }
- }
- }
-
- private void enableGroup(Group group, boolean enabled) {
- group.setEnabled(enabled);
- for (int i = 0; i < group.getChildren().length; i++) {
- group.getChildren()[i].setEnabled(enabled);
- }
- }
-
-
-
- protected void engageListeners() {
- if (this.singleRelationshipMapping != null) {
- this.singleRelationshipMapping.eAdapters().add(this.singleRelationshipMappingListener);
- for (Iterator i = this.singleRelationshipMapping.getJoinColumns().iterator(); i.hasNext(); ) {
- ((IJoinColumn) i.next()).eAdapters().add(this.joinColumnListener);
- }
- }
- }
-
- protected void disengageListeners() {
- if (this.singleRelationshipMapping != null) {
- for (Iterator i = this.singleRelationshipMapping.getJoinColumns().iterator(); i.hasNext(); ) {
- ((IJoinColumn) i.next()).eAdapters().remove(this.joinColumnListener);
- }
- this.singleRelationshipMapping.eAdapters().remove(this.singleRelationshipMappingListener);
- }
- }
-
- public void doPopulate(EObject obj) {
- this.singleRelationshipMapping = (ISingleRelationshipMapping) obj;
- if (this.singleRelationshipMapping == null) {
- this.joinColumnsListViewer.setInput(null);
- return;
- }
-
- this.joinColumnsListViewer.setInput(this.singleRelationshipMapping);
-
-
- updateEnablement();
- this.overrideDefaultJoinColumnsCheckBox.setSelection(this.singleRelationshipMapping.containsSpecifiedJoinColumns());
- }
-
- @Override
- protected void doPopulate() {
- this.joinColumnsListViewer.setInput(this.singleRelationshipMapping);
- }
-
- void updateEnablement() {
- boolean groupEnabledState = this.singleRelationshipMapping.containsSpecifiedJoinColumns();
- enableGroup(this.joinColumnsGroup, groupEnabledState);
-
- this.joinColumnsRemoveButton.setEnabled(groupEnabledState && !((StructuredSelection) this.joinColumnsListViewer.getSelection()).isEmpty());
- this.joinColumnsEditButton.setEnabled(groupEnabledState && ((StructuredSelection) this.joinColumnsListViewer.getSelection()).size() == 1);
- }
-
- public void dispose() {
- disengageListeners();
- super.dispose();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialog.java
deleted file mode 100644
index e36b19e9d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialog.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean;
-import org.eclipse.jpt.core.internal.mappings.IJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.InheritanceType;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-public abstract class JoinColumnDialog extends AbstractJoinColumnDialog<IJoinColumn> {
-
- private Combo tableCombo;
- private ComboViewer insertableComboViewer;
- private ComboViewer updatableComboViewer;
-
- private boolean defaultTableSelected;
- private String selectedTable;
- private DefaultTrueBoolean insertable;
- private DefaultTrueBoolean updatable;
-
- JoinColumnDialog(Shell parent) {
- super(parent);
- }
-
- JoinColumnDialog(Shell parent, IJoinColumn joinColumn) {
- super(parent, joinColumn);
- }
-
- protected Control createDialogArea(Composite parent) {
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
- Composite composite = (Composite) super.createDialogArea(parent);
-
- Label tableLabel = new Label(composite, SWT.LEFT);
- tableLabel.setText(JptUiMappingsMessages.JoinColumnDialog_table);
- GridData gridData = new GridData();
- tableLabel.setLayoutData(gridData);
-
- this.tableCombo = new Combo(composite, SWT.LEFT);
- this.tableCombo.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- populateNameCombo();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- populateNameCombo();
- }
- });
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.tableCombo.setLayoutData(gridData);
- //PlatformUI.getWorkbench().getHelpSystem().setHelp(this.tableCombo, IJpaHelpContextIds.MAPPING_JOIN_REFERENCED_COLUMN);
- populateTableCombo();
-
- Label insertableLabel = new Label(composite, SWT.LEFT);
- insertableLabel.setText(JptUiMappingsMessages.JoinColumnDialog_insertable);
- insertableLabel.setLayoutData(new GridData());
-
- this.insertableComboViewer = this.buildInsertableComboViewer(composite);
- this.insertableComboViewer.getCombo().setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
- helpSystem.setHelp(this.insertableComboViewer.getCombo(), IJpaHelpContextIds.MAPPING_COLUMN_INSERTABLE);
-
- Label updatableLabel = new Label(composite, SWT.LEFT);
- updatableLabel.setText(JptUiMappingsMessages.JoinColumnDialog_updatable);
- updatableLabel.setLayoutData(new GridData());
-
- this.updatableComboViewer = this.buildUpdatableComboViewer(composite);
- this.updatableComboViewer.getCombo().setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
- helpSystem.setHelp(this.updatableComboViewer.getCombo(), IJpaHelpContextIds.MAPPING_COLUMN_UPDATABLE);
-
- return composite;
- }
-
- private ComboViewer buildInsertableComboViewer(Composite parent) {
- ComboViewer viewer = new ComboViewer(parent, SWT.READ_ONLY);
- viewer.setLabelProvider(buildDefaultTrueLabelProvider());
- viewer.add(DefaultTrueBoolean.VALUES.toArray());
-
- DefaultTrueBoolean sel = (this.joinColumn() == null) ? DefaultTrueBoolean.DEFAULT : this.joinColumn().getInsertable();
- viewer.setSelection(new StructuredSelection(sel));
- return viewer;
- }
-
- private IBaseLabelProvider buildDefaultTrueLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- if (element == DefaultTrueBoolean.DEFAULT) {
- //TODO need to move this to the model, don't want hardcoded String
- return NLS.bind(JptUiMappingsMessages.JoinColumnDialog_defaultTrue, "True");
- }
- return super.getText(element);
- }
- };
- }
-
- private ComboViewer buildUpdatableComboViewer(Composite parent) {
- ComboViewer viewer = new ComboViewer(parent, SWT.READ_ONLY);
- viewer.setLabelProvider(buildDefaultTrueLabelProvider());
- viewer.add(DefaultTrueBoolean.VALUES.toArray());
- DefaultTrueBoolean sel = (this.joinColumn() == null) ? DefaultTrueBoolean.DEFAULT : this.joinColumn().getUpdatable();
- viewer.setSelection(new StructuredSelection(sel));
- return viewer;
- }
-
- protected void populateTableCombo() {
- this.tableCombo.add(NLS.bind(JptUiMappingsMessages.JoinColumnDialog_defaultWithOneParam, defaultTableName()));
- Schema schema = this.getSchema();
- if (schema != null) {
- Iterator<String> tables = schema.tableNames();
- for (Iterator<String> stream = CollectionTools.sort( tables); stream.hasNext(); ) {
- this.tableCombo.add(stream.next());
- }
- }
- if (specifiedTableName() != null) {
- this.tableCombo.setText(specifiedTableName());
- }
- else {
- this.tableCombo.select(0);
- }
- }
-
- protected abstract String defaultTableName();
-
- protected String specifiedTableName() {
- if (getJoinColumn() != null) {
- return getJoinColumn().getSpecifiedTable();
- }
- return null;
- }
-
- protected String tableName() {
- if (this.tableCombo != null) {
- if (this.tableCombo.getSelectionIndex() == 0) {
- return defaultTableName();
- }
- return this.tableCombo.getText();
- }
- return (this.specifiedTableName() == null) ? defaultTableName() : this.specifiedTableName();
- }
-
- protected abstract Schema getSchema();
-
- private IJoinColumn joinColumn() {
- return this.getJoinColumn();
- }
-
- protected boolean isDefaultTableSelected() {
- return this.defaultTableSelected;
- }
-
- public String getSelectedTable() {
- return this.selectedTable;
- }
-
- public DefaultTrueBoolean getInsertable() {
- return this.insertable;
- }
-
- public DefaultTrueBoolean getUpdatable() {
- return this.updatable;
- }
-
- public boolean close() {
- this.defaultTableSelected = this.tableCombo.getSelectionIndex() == 0;
- this.selectedTable = this.tableCombo.getText();
-
- ISelection selection = this.insertableComboViewer.getSelection();
- if (selection instanceof IStructuredSelection) {
- this.insertable = (DefaultTrueBoolean) ((IStructuredSelection) selection).getFirstElement();
- }
-
- selection = this.updatableComboViewer.getSelection();
- if (selection instanceof IStructuredSelection) {
- this.updatable = (DefaultTrueBoolean) ((IStructuredSelection) selection).getFirstElement();
- }
-
- return super.close();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideDialog.java
deleted file mode 100644
index c324a95b34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideDialog.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import org.eclipse.jpt.core.internal.IAttributeMapping;
-import org.eclipse.jpt.core.internal.mappings.IAssociationOverride;
-import org.eclipse.jpt.core.internal.mappings.IEntity;
-import org.eclipse.jpt.core.internal.mappings.IJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.swt.widgets.Shell;
-
-public class JoinColumnInAssociationOverrideDialog extends JoinColumnDialog {
-
- private IAssociationOverride associationOverride;
-
- JoinColumnInAssociationOverrideDialog(Shell parent, IAssociationOverride associationOverride) {
- super(parent);
- this.associationOverride = associationOverride;
- }
-
- JoinColumnInAssociationOverrideDialog(Shell parent, IJoinColumn joinColumn) {
- super(parent, joinColumn);
- this.associationOverride = (IAssociationOverride) joinColumn.eContainer();
- }
-
- protected Schema getSchema() {
- return this.associationOverride.typeMapping().dbSchema();
- }
-
- protected String defaultTableName() {
- if (getJoinColumn() != null) {
- return getJoinColumn().getDefaultTable();
- }
- return this.associationOverride.typeMapping().getTableName();
- }
-
- protected Table getNameTable() {
- return this.associationOverride.typeMapping().primaryDbTable();
- }
-
- protected Table getReferencedNameTable() {
- IAttributeMapping attributeMapping = this.associationOverride.getOwner().attributeMapping(this.associationOverride.getName());
- if (attributeMapping == null || !(attributeMapping instanceof IRelationshipMapping)) {
- return null;
- }
- IEntity targetEntity = ((IRelationshipMapping) attributeMapping).getResolvedTargetEntity();
- if (targetEntity != null) {
- return targetEntity.primaryDbTable();
- }
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableDialog.java
deleted file mode 100644
index 5a8a7479c2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableDialog.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import org.eclipse.jpt.core.internal.mappings.IJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.IJoinTable;
-import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.swt.widgets.Shell;
-
-//if there is only 1 joinColumn and the user is editing it, they should be
-//able to define defaults. otherwise, we probably shouldn't allow it.
-public class JoinColumnInJoinTableDialog extends AbstractJoinColumnDialog<IJoinColumn> {
-
- private IJoinTable joinTable;
-
- JoinColumnInJoinTableDialog(Shell parent, IJoinTable joinTable) {
- super(parent);
- this.joinTable = joinTable;
- }
-
- JoinColumnInJoinTableDialog(Shell parent, IJoinColumn joinColumn) {
- super(parent, joinColumn);
- this.joinTable = (IJoinTable) joinColumn.eContainer();
- }
- protected IJoinTable getJoinTable() {
- return this.joinTable;
- }
-
- protected Table getNameTable() {
- return getJoinTable().dbTable();
- }
-
- protected Table getReferencedNameTable() {
- IMultiRelationshipMapping multiRelationshipMapping = (IMultiRelationshipMapping) getJoinTable().eContainer();
- return multiRelationshipMapping.typeMapping().primaryDbTable();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingDialog.java
deleted file mode 100644
index e60a047663..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingDialog.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import org.eclipse.jpt.core.internal.mappings.IEntity;
-import org.eclipse.jpt.core.internal.mappings.IJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.swt.widgets.Shell;
-
-public class JoinColumnInRelationshipMappingDialog extends JoinColumnDialog {
-
- private ISingleRelationshipMapping singleRelationshipMapping;
-
- JoinColumnInRelationshipMappingDialog(Shell parent, ISingleRelationshipMapping singleRelationshipMapping) {
- super(parent);
- this.singleRelationshipMapping = singleRelationshipMapping;
- }
-
- JoinColumnInRelationshipMappingDialog(Shell parent, IJoinColumn joinColumn) {
- super(parent, joinColumn);
- this.singleRelationshipMapping = (ISingleRelationshipMapping) joinColumn.eContainer();
- }
-
- protected String defaultTableName() {
- if (getJoinColumn() != null) {
- return getJoinColumn().getDefaultTable();
- }
- return this.singleRelationshipMapping.typeMapping().getTableName();
- }
-
- protected Schema getSchema() {
- return this.singleRelationshipMapping.typeMapping().dbSchema();
- }
-
- protected Table getNameTable() {
- Schema schema = this.getSchema();
- return (schema == null) ? null : schema.tableNamed(tableName());
- }
-
- protected Table getReferencedNameTable() {
- IEntity targetEntity = this.singleRelationshipMapping.getResolvedTargetEntity();
- if (targetEntity != null) {
- return targetEntity.primaryDbTable();
- }
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnsComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnsComposite.java
deleted file mode 100644
index 886e200383..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnsComposite.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.core.internal.mappings.IAbstractColumn;
-import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.IJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.INamedColumn;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class JoinColumnsComposite extends BaseJpaComposite
-{
-
- private Owner owner;
- private final Adapter joinColumnsOwnerListener;
-
- private ListViewer joinColumnsListViewer;
-
- private final Adapter joinColumnListener;
-
- private Group joinColumnsGroup;
- private Button joinColumnsAddButton;
- private Button joinColumnsRemoveButton;
- private Button joinColumnsEditButton;
-
-
- public JoinColumnsComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory, String groupTitle) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.joinColumnsOwnerListener = buildJoinColumnsOwnerListener();
- this.joinColumnListener = buildJoinColumnListener();
- this.joinColumnsGroup.setText(groupTitle);
- }
-
- private Adapter buildJoinColumnsOwnerListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- joinColumnsOwnerChanged(notification);
- }
- };
- }
-
- private Adapter buildJoinColumnListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- joinColumnChanged(notification, joinColumnsListViewer);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- this.joinColumnsGroup =
- getWidgetFactory().createGroup(
- composite,
- "");
- this.joinColumnsGroup.setLayout(new GridLayout(2, false));
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalSpan = 2;
- this.joinColumnsGroup.setLayoutData(gridData);
-
- this.joinColumnsListViewer = new ListViewer(this.joinColumnsGroup, SWT.BORDER | SWT.MULTI);
- this.joinColumnsListViewer.setContentProvider(buildJoinColumnsListContentProvider());
- this.joinColumnsListViewer.setLabelProvider(buildJoinColumnsListLabelProvider());
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.verticalSpan = 3;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- this.joinColumnsListViewer.getList().setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.joinColumnsListViewer.getList(), IJpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS);
-
- this.joinColumnsAddButton = getWidgetFactory().createButton(this.joinColumnsGroup, JptUiMappingsMessages.JoinTableComposite_add, SWT.NONE);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- this.joinColumnsAddButton.setLayoutData(gridData);
- this.joinColumnsAddButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- owner.addJoinColumn();
- }
- });
-
- this.joinColumnsEditButton = getWidgetFactory().createButton(this.joinColumnsGroup, JptUiMappingsMessages.JoinTableComposite_edit, SWT.NONE);
- this.joinColumnsEditButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- editJoinColumn();
- }
- });
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- this.joinColumnsEditButton.setLayoutData(gridData);
-
- this.joinColumnsRemoveButton = getWidgetFactory().createButton(this.joinColumnsGroup, JptUiMappingsMessages.JoinTableComposite_remove, SWT.NONE);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- this.joinColumnsRemoveButton.setLayoutData(gridData);
- this.joinColumnsRemoveButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- removeJoinColumn();
- }
- });
-
- this.joinColumnsListViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateJoinColumnsEnablement();
- }
- });
- }
-
- private IContentProvider buildJoinColumnsListContentProvider() {
- return new IStructuredContentProvider(){
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- public void dispose() {
-
- }
-
- public Object[] getElements(Object inputElement) {
- return ((Owner) inputElement).getJoinColumns().toArray();
- }
- };
- }
-
- private ILabelProvider buildJoinColumnsListLabelProvider() {
- return new LabelProvider() {
- public String getText(Object element) {
- IJoinColumn joinColumn = (IJoinColumn) element;
- return (JoinColumnsComposite.this.owner.containsSpecifiedJoinColumns()) ?
- buildJoinColumnLabel(joinColumn)
- :
- buildDefaultJoinColumnLabel(joinColumn);
- }
- };
- }
-
- private String buildDefaultJoinColumnLabel(IJoinColumn joinColumn) {
- return NLS.bind(JptUiMappingsMessages.JoinTableComposite_mappingBetweenTwoParamsDefault, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
-
- private String buildJoinColumnLabel(IJoinColumn joinColumn) {
- if (joinColumn.getSpecifiedName() == null) {
- if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(JptUiMappingsMessages.JoinTableComposite_mappingBetweenTwoParamsBothDefault, joinColumn.getName(),joinColumn.getReferencedColumnName());
- }
- return NLS.bind(JptUiMappingsMessages.JoinTableComposite_mappingBetweenTwoParamsFirstDefault, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
- else if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(JptUiMappingsMessages.JoinTableComposite_mappingBetweenTwoParamsSecDefault, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
- else {
- return NLS.bind(JptUiMappingsMessages.JoinTableComposite_mappingBetweenTwoParams, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
- }
-
- void editJoinColumn() {
- this.owner.editJoinColumn(getSelectedJoinColumn());
- }
-
- void removeJoinColumn() {
- ISelection selection = this.joinColumnsListViewer.getSelection();
- if (selection instanceof StructuredSelection) {
- for (Iterator stream = ((StructuredSelection) selection).iterator(); stream.hasNext(); ) {
- this.owner.getJoinColumns().remove(stream.next());
- }
- }
- }
-
- private IJoinColumn getSelectedJoinColumn() {
- return (IJoinColumn) ((StructuredSelection) this.joinColumnsListViewer.getSelection()).getFirstElement();
- }
-
- protected void joinColumnsOwnerChanged(Notification notification) {
- if (notification.getFeatureID(owner.owningFeatureClass()) == owner.specifiedJoinColumnsFeatureId()) {
- if (notification.getEventType() == Notification.ADD) {
- ((IJoinColumn) notification.getNewValue()).eAdapters().add(this.joinColumnListener);
- }
- else if (notification.getEventType() == Notification.REMOVE) {
- ((IJoinColumn) notification.getOldValue()).eAdapters().remove(this.joinColumnListener);
- }
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- joinColumnsListViewer.refresh();
- updateJoinColumnsEnablement();
- }
- });
- }
- }
-
- private void enableGroup(Group group, boolean enabled) {
- group.setEnabled(enabled);
- for (int i = 0; i < group.getChildren().length; i++) {
- group.getChildren()[i].setEnabled(enabled);
- }
- }
- protected void joinColumnChanged(Notification notification, final ListViewer listViewer) {
- if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME
- || notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME
- || notification.getFeatureID(IAbstractColumn.class) == JpaCoreMappingsPackage.IABSTRACT_COLUMN__SPECIFIED_TABLE
- || notification.getFeatureID(IAbstractColumn.class) == JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE
- || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME
- || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- listViewer.refresh();
- }
- });
- }
- }
-
- protected void engageListeners() {
- if (this.owner != null) {
- this.owner.getEObject().eAdapters().add(this.joinColumnsOwnerListener);
- for (IJoinColumn joinColumn : this.owner.getJoinColumns()) {
- joinColumn.eAdapters().add(this.joinColumnListener);
- }
- }
- }
-
- protected void disengageListeners() {
- if (this.owner != null) {
- for (IJoinColumn joinColumn : this.owner.getJoinColumns()) {
- joinColumn.eAdapters().remove(this.joinColumnListener);
- }
- this.owner.getEObject().eAdapters().remove(this.joinColumnsOwnerListener);
- }
- }
-
- public void doPopulate(EObject obj) {
- this.owner = (Owner) obj;
- if (this.owner == null) {
- this.joinColumnsListViewer.setInput(null);
- return;
- }
-
- this.joinColumnsListViewer.setInput(this.owner);
-
- updateEnablement();
- }
-
- @Override
- protected void doPopulate() {
- }
-
- private void updateEnablement() {
- updateJoinColumnsEnablement();
- }
-
- void updateJoinColumnsEnablement() {
- boolean groupEnabledState = this.owner.containsSpecifiedJoinColumns();
- enableGroup(this.joinColumnsGroup, groupEnabledState);
-
- this.joinColumnsRemoveButton.setEnabled(groupEnabledState && !((StructuredSelection) this.joinColumnsListViewer.getSelection()).isEmpty());
- this.joinColumnsEditButton.setEnabled(groupEnabledState && ((StructuredSelection) this.joinColumnsListViewer.getSelection()).size() == 1);
- }
-
- protected void enableWidgets(boolean enabled) {
- enableGroup(this.joinColumnsGroup, enabled);
- this.joinColumnsAddButton.setEnabled(enabled);
- this.joinColumnsEditButton.setEnabled(enabled);
- this.joinColumnsRemoveButton.setEnabled(enabled);
- this.joinColumnsListViewer.getList().setEnabled(enabled);
- }
-
- public interface Owner {
- int specifiedJoinColumnsFeatureId();
-
- Class owningFeatureClass();
-
- EObject getEObject();
-
- boolean containsSpecifiedJoinColumns();
-
- List<IJoinColumn> getJoinColumns();
-
- List<IJoinColumn> getSpecifiedJoinColumns();
-
- IJoinColumn createJoinColumn(int index);
-
- void addJoinColumn();
-
- void editJoinColumn(IJoinColumn joinColumn);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinTableComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinTableComposite.java
deleted file mode 100644
index f5fd60c608..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinTableComposite.java
+++ /dev/null
@@ -1,473 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.mappings.details;
-
-import java.util.List;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.core.internal.JpaEObject;
-import org.eclipse.jpt.core.internal.mappings.IJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.IJoinTable;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.db.internal.Connection;
-import org.eclipse.jpt.db.internal.ConnectionListener;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.Database;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.JoinColumnsComposite.Owner;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class JoinTableComposite extends BaseJpaComposite
-{
-
- private IJoinTable joinTable;
- private final Adapter joinTableListener;
-
- protected TableCombo tableCombo;
-
- private ConnectionProfile connectionProfile;
- private ConnectionListener connectionListener;
-
- private Button overrideDefaultJoinColumnsCheckBox;
- private JoinColumnsComposite joinColumnsComposite;
-
- private Button overrideDefaultInverseJoinColumnsCheckBox;
- private JoinColumnsComposite inverseJoinColumnsComposite;
-
- public JoinTableComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.joinTableListener = buildJoinTableListener();
- this.connectionListener = buildConnectionListener();
- }
-
- private Adapter buildJoinTableListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- joinTableChanged(notification);
- }
- };
- }
-
- private ConnectionListener buildConnectionListener() {
- return new ConnectionListener() {
-
- public void aboutToClose(Connection connection) {
- // not interested to this event.
- }
-
- public void closed(Connection connection) {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- JoinTableComposite.this.tableCombo.populate();
- }
- });
- }
-
- public void modified(Connection connection) {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- JoinTableComposite.this.tableCombo.populate();
- }
- });
- }
-
- public boolean okToClose(Connection connection) {
- // not interested to this event.
- return true;
- }
-
- public void opened(Connection connection) {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- JoinTableComposite.this.tableCombo.populate();
- }
- });
- }
-
- public void databaseChanged(Connection connection, final Database database) {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- if(database == JoinTableComposite.this.tableCombo.getDatabase()) {
- if (!getControl().isDisposed()) {
- JoinTableComposite.this.tableCombo.populate();
- }
- }
- }
- });
- }
-
- public void schemaChanged(Connection connection, final Schema schema) {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- if(schema == JoinTableComposite.this.tableCombo.getTableSchema()) {
- if (!getControl().isDisposed()) {
- JoinTableComposite.this.tableCombo.populate();
- }
- }
- }
- });
- }
-
- public void tableChanged(Connection connection, final Table table) {
- // not interested to this event.
- }
- };
- }
-
- private ConnectionProfile getConnectionProfile() {
- if(this.connectionProfile == null) {
- IJpaProject jpaProject = this.joinTable.getJpaProject();
- this.connectionProfile = jpaProject.connectionProfile();
- }
- return this.connectionProfile;
- }
-
- private void addConnectionListener() {
- this.getConnectionProfile().addConnectionListener(this.connectionListener);
- }
-
- private void removeConnectionListener() {
- this.getConnectionProfile().removeConnectionListener(this.connectionListener);
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.JoinTableComposite_name);
-
- this.tableCombo = new TableCombo(composite, this.commandStack, getWidgetFactory());
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.tableCombo.getCombo().setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.tableCombo.getCombo(), IJpaHelpContextIds.MAPPING_JOIN_TABLE_NAME);
-
- this.overrideDefaultJoinColumnsCheckBox =
- getWidgetFactory().createButton(
- composite,
- JptUiMappingsMessages.JoinTableComposite_overrideDefaultJoinColumns,
- SWT.CHECK);
- this.overrideDefaultJoinColumnsCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (JoinTableComposite.this.overrideDefaultJoinColumnsCheckBox.getSelection()) {
- IJoinColumn defaultJoinColumn = JoinTableComposite.this.joinTable.getDefaultJoinColumns().get(0);
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
- IJoinColumn joinColumn = JoinTableComposite.this.joinTable.createJoinColumn(0);
- JoinTableComposite.this.joinTable.getSpecifiedJoinColumns().add(joinColumn);
- joinColumn.setSpecifiedName(columnName);
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- } else {
- JoinTableComposite.this.joinTable.getSpecifiedJoinColumns().clear();
- }
- }
- });
-
- this.joinColumnsComposite = new JoinColumnsComposite(composite, this.commandStack, getWidgetFactory(), JptUiMappingsMessages.JoinTableComposite_joinColumn);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalSpan = 2;
- this.joinColumnsComposite.getControl().setLayoutData(gridData);
-
- this.overrideDefaultInverseJoinColumnsCheckBox = getWidgetFactory().createButton(composite, JptUiMappingsMessages.JoinTableComposite_overrideDefaultInverseJoinColumns, SWT.CHECK);
- this.overrideDefaultInverseJoinColumnsCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (JoinTableComposite.this.overrideDefaultInverseJoinColumnsCheckBox.getSelection()) {
- IJoinColumn defaultJoinColumn = JoinTableComposite.this.joinTable.getDefaultInverseJoinColumns().get(0);
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
- IJoinColumn joinColumn = JoinTableComposite.this.joinTable.createInverseJoinColumn(0);
- JoinTableComposite.this.joinTable.getSpecifiedInverseJoinColumns().add(joinColumn);
- joinColumn.setSpecifiedName(columnName);
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- } else {
- JoinTableComposite.this.joinTable.getSpecifiedInverseJoinColumns().clear();
- }
- }
- });
- this.inverseJoinColumnsComposite = new JoinColumnsComposite(composite, this.commandStack, getWidgetFactory(), JptUiMappingsMessages.JoinTableComposite_inverseJoinColumn);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalSpan = 2;
- this.inverseJoinColumnsComposite.getControl().setLayoutData(gridData);
- }
-
- void addJoinColumn() {
- JoinColumnInJoinTableDialog dialog = new JoinColumnInJoinTableDialog(this.getControl().getShell(), this.joinTable);
- this.addJoinColumnFromDialog(dialog);
- }
-
- private void addJoinColumnFromDialog(JoinColumnInJoinTableDialog dialog) {
- if (dialog.open() != Window.OK) {
- return;
- }
- int index = this.joinTable.getJoinColumns().size();
- IJoinColumn joinColumn = this.joinTable.createJoinColumn(index);
- this.joinTable.getSpecifiedJoinColumns().add(joinColumn);
- joinColumn.setSpecifiedName(dialog.getSelectedName());
- joinColumn.setSpecifiedReferencedColumnName(dialog.getReferencedColumnName());
- }
-
- void addInverseJoinColumn() {
- InverseJoinColumnDialog dialog = new InverseJoinColumnDialog(this.getControl().getShell(), this.joinTable);
- this.addInverseJoinColumnFromDialog(dialog);
- }
-
- private void addInverseJoinColumnFromDialog(InverseJoinColumnDialog dialog) {
- if (dialog.open() != Window.OK) {
- return;
- }
- int index = this.joinTable.getInverseJoinColumns().size();
- IJoinColumn joinColumn = this.joinTable.createInverseJoinColumn(index);
- this.joinTable.getSpecifiedInverseJoinColumns().add(joinColumn);
- joinColumn.setSpecifiedName(dialog.getSelectedName());
- joinColumn.setSpecifiedReferencedColumnName(dialog.getReferencedColumnName());
- }
-
- void editJoinColumn(IJoinColumn joinColumn) {
- JoinColumnInJoinTableDialog dialog = new JoinColumnInJoinTableDialog(this.getControl().getShell(), joinColumn);
- editJoinColumnFromDialog(dialog, joinColumn);
- }
-
- private void editJoinColumnFromDialog(JoinColumnInJoinTableDialog dialog, IJoinColumn joinColumn) {
- if (dialog.open() == Window.OK) {
- editJoinColumnDialogOkd(dialog, joinColumn);
- }
- }
-
- private void editJoinColumnDialogOkd(JoinColumnInJoinTableDialog dialog, IJoinColumn joinColumn) {
- String name = dialog.getSelectedName();
- String referencedColumnName = dialog.getReferencedColumnName();
-
- if (dialog.isDefaultNameSelected()) {
- if (joinColumn.getSpecifiedName() != null) {
- joinColumn.setSpecifiedName(null);
- }
- }
- else if (joinColumn.getSpecifiedName() == null || !joinColumn.getSpecifiedName().equals(name)){
- joinColumn.setSpecifiedName(name);
- }
-
- if (dialog.isDefaultReferencedColumnNameSelected()) {
- if (joinColumn.getSpecifiedReferencedColumnName() != null) {
- joinColumn.setSpecifiedReferencedColumnName(null);
- }
- }
- else if (joinColumn.getSpecifiedReferencedColumnName() == null || !joinColumn.getSpecifiedReferencedColumnName().equals(referencedColumnName)){
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- }
- }
-
-
- void editInverseJoinColumn(IJoinColumn joinColumn) {
- InverseJoinColumnDialog dialog = new InverseJoinColumnDialog(getControl().getShell(), joinColumn);
- editJoinColumnFromDialog(dialog, joinColumn);
- }
-
- protected void joinTableChanged(Notification notification) {
- if (notification.getFeatureID(IJoinTable.class) == JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_JOIN_COLUMNS) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- overrideDefaultJoinColumnsCheckBox.setSelection(joinTable.containsSpecifiedJoinColumns());
- }
- });
- }
- else if (notification.getFeatureID(IJoinTable.class) == JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS) {
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- overrideDefaultInverseJoinColumnsCheckBox.setSelection(joinTable.containsSpecifiedInverseJoinColumns());
- }
- });
- }
- }
-
- protected void engageListeners() {
- if (this.joinTable != null) {
- this.joinTable.eAdapters().add(this.joinTableListener);
- this.addConnectionListener();
- }
- }
-
- protected void disengageListeners() {
- if (this.joinTable != null) {
- this.joinTable.eAdapters().remove(this.joinTableListener);
- this.removeConnectionListener();
- }
- }
-
- public void doPopulate(EObject obj) {
- this.joinTable = (IJoinTable) obj;
- if (this.joinTable == null) {
- this.joinColumnsComposite.populate(null);
- this.inverseJoinColumnsComposite.populate(null);
- this.connectionProfile = null;
- return;
- }
-
- this.tableCombo.populate(this.joinTable);
- this.joinColumnsComposite.populate(new JoinColumnsOwner(this.joinTable));
- this.inverseJoinColumnsComposite.populate(new InverseJoinColumnsOwner(this.joinTable));
-
- this.overrideDefaultJoinColumnsCheckBox.setSelection(this.joinTable.containsSpecifiedJoinColumns());
- this.overrideDefaultInverseJoinColumnsCheckBox.setSelection(this.joinTable.containsSpecifiedInverseJoinColumns());
- }
-
- @Override
- protected void doPopulate() {
- this.tableCombo.populate();
- this.joinColumnsComposite.populate();
- this.inverseJoinColumnsComposite.populate();
- }
-
- @Override
- public void dispose() {
- this.tableCombo.dispose();
- this.joinColumnsComposite.dispose();
- this.inverseJoinColumnsComposite.dispose();
- super.dispose();
- }
-
- private class JoinColumnsOwner extends JpaEObject implements Owner {
-
- private IJoinTable joinTable;
-
- public JoinColumnsOwner(IJoinTable joinTable) {
- super();
- this.joinTable = joinTable;
- }
-
- public void addJoinColumn() {
- JoinTableComposite.this.addJoinColumn();
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return this.joinTable.containsSpecifiedJoinColumns();
- }
-
- public IJoinColumn createJoinColumn(int index) {
- return this.joinTable.createJoinColumn(index);
- }
-
- public List<IJoinColumn> getJoinColumns() {
- return this.joinTable.getJoinColumns();
- }
-
- public List<IJoinColumn> getSpecifiedJoinColumns() {
- return this.joinTable.getSpecifiedJoinColumns();
- }
-
- public int specifiedJoinColumnsFeatureId() {
- return JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_JOIN_COLUMNS;
- }
-
- public Class owningFeatureClass() {
- return IJoinTable.class;
- }
-
- public void editJoinColumn(IJoinColumn joinColumn) {
- JoinTableComposite.this.editJoinColumn(joinColumn);
- }
-
- public EObject getEObject() {
- return this.joinTable;
- }
- }
-
- private class InverseJoinColumnsOwner extends JpaEObject implements Owner {
-
- private IJoinTable joinTable;
-
- public InverseJoinColumnsOwner(IJoinTable joinTable) {
- super();
- this.joinTable = joinTable;
- }
-
- public void addJoinColumn() {
- JoinTableComposite.this.addInverseJoinColumn();
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return this.joinTable.containsSpecifiedInverseJoinColumns();
- }
-
- public IJoinColumn createJoinColumn(int index) {
- return this.joinTable.createJoinColumn(index);
- }
-
- public List<IJoinColumn> getJoinColumns() {
- return this.joinTable.getInverseJoinColumns();
- }
-
- public List<IJoinColumn> getSpecifiedJoinColumns() {
- return this.joinTable.getSpecifiedInverseJoinColumns();
- }
-
- public int specifiedJoinColumnsFeatureId() {
- return JpaCoreMappingsPackage.IJOIN_TABLE__SPECIFIED_INVERSE_JOIN_COLUMNS;
- }
-
- public Class owningFeatureClass() {
- return IJoinTable.class;
- }
-
- public void editJoinColumn(IJoinColumn joinColumn) {
- JoinTableComposite.this.editInverseJoinColumn(joinColumn);
- }
-
- public EObject getEObject() {
- return this.joinTable;
- }
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/LobCheckBox.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/LobCheckBox.java
deleted file mode 100644
index a81944a32b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/LobCheckBox.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.IBasic;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class LobCheckBox extends BaseJpaController
-{
- private IBasic basicMapping;
- private Adapter basicMappingListener;
-
- private Button button;
-
-
- public LobCheckBox(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- buildBasicMappingListener();
- }
-
- private void buildBasicMappingListener() {
- this.basicMappingListener = new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- bsaicMappingChanged(notification);
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- this.button = getWidgetFactory().createButton(
- parent,
- JptUiMappingsMessages.BasicGeneralSection_lobLabel,
- SWT.CHECK);
-
- this.button.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- LobCheckBox.this.lobSelectionChanged();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- LobCheckBox.this.lobSelectionChanged();
- }
- });
- }
-
- void lobSelectionChanged() {
- boolean lob = this.button.getSelection();
- if (this.basicMapping.isLob() != lob) {
- this.basicMapping.setLob(lob);
- }
- }
-
- private void bsaicMappingChanged(Notification notification) {
- if (notification.getFeatureID(IBasic.class) ==
- JpaCoreMappingsPackage.IBASIC__LOB) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- }
- }
-
- @Override
- protected void engageListeners() {
- if (this.basicMapping != null) {
- this.basicMapping.eAdapters().add(this.basicMappingListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.basicMapping != null) {
- this.basicMapping.eAdapters().remove(this.basicMappingListener);
- }
- }
-
- @Override
- public void doPopulate(EObject obj) {
- this.basicMapping = (IBasic) obj;
- populateButton();
- }
-
- @Override
- protected void doPopulate() {
- populateButton();
- }
-
- private void populateButton() {
- boolean lob = false;
- if (this.basicMapping != null) {
- lob = this.basicMapping.isLob();
- }
-
- if (this.button.getSelection() != lob) {
- this.button.setSelection(lob);
- }
- }
-
-
- @Override
- public Control getControl() {
- return this.button;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyComposite.java
deleted file mode 100644
index 1853ebab4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyComposite.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.IManyToMany;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class ManyToManyComposite extends BaseJpaComposite
-{
- private IManyToMany manyToMany;
-
- private TargetEntityChooser targetEntityChooser;
-
- private EnumComboViewer fetchTypeComboViewer;
-
- private MappedByCombo mappedByCombo;
-
- private CascadeComposite cascadeComposite;
-
- private OrderingComposite orderingComposite;
-
- private JoinTableComposite joinTableComposite;
-
-
- public ManyToManyComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
-
- Control generalControl = buildGeneralComposite(composite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- generalControl.setLayoutData(gridData);
-
- Control joinTableControl = buildJoinTableControl(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- joinTableControl.setLayoutData(gridData);
- }
-
- private Control buildGeneralComposite(Composite composite) {
-// IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-
- Composite generalComposite = getWidgetFactory().createComposite(composite);
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- generalComposite.setLayout(layout);
-
- this.targetEntityChooser = CommonWidgets.buildTargetEntityChooser(generalComposite, commandStack, getWidgetFactory());
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalSpan = 2;
- this.targetEntityChooser.getControl().setLayoutData(gridData);
-
-
- CommonWidgets.buildFetchLabel(generalComposite, getWidgetFactory());
- this.fetchTypeComboViewer = CommonWidgets.buildFetchTypeComboViewer(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.fetchTypeComboViewer.getControl().setLayoutData(gridData);
-
-
- CommonWidgets.buildMappedByLabel(generalComposite, getWidgetFactory());
- this.mappedByCombo = new MappedByCombo(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.mappedByCombo.getControl().setLayoutData(gridData);
-
- this.cascadeComposite = new CascadeComposite(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalSpan = 3;
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.cascadeComposite.getControl().setLayoutData(gridData);
-
-
- this.orderingComposite = new OrderingComposite(composite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalSpan = 3;
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.orderingComposite.getControl().setLayoutData(gridData);
-
- return generalComposite;
- }
-
- private Control buildJoinTableControl(Composite composite) {
- Section section = getWidgetFactory().createSection(composite, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
- section.setText(JptUiMappingsMessages.MultiRelationshipMappingComposite_joinTable);
-
- Composite joinTableClient = getWidgetFactory().createComposite(section);
- section.setClient(joinTableClient);
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- joinTableClient.setLayout(layout);
-
- this.joinTableComposite = new JoinTableComposite(joinTableClient, this.commandStack, getWidgetFactory());
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- this.joinTableComposite.getControl().setLayoutData(gridData);
-
- return section;
- }
-
- public void doPopulate(EObject obj) {
- this.manyToMany = (IManyToMany) obj;
- this.targetEntityChooser.populate(this.manyToMany);
- this.fetchTypeComboViewer.populate(CommonWidgets.buildMultiRelationshipMappingFetchEnumHolder(this.manyToMany));
- this.mappedByCombo.populate(this.manyToMany);
- this.cascadeComposite.populate(this.manyToMany);
- if (this.manyToMany != null) {
- this.joinTableComposite.populate(this.manyToMany.getJoinTable());
- this.orderingComposite.populate(this.manyToMany);
- }
- else {
- this.joinTableComposite.populate(null);
- this.orderingComposite.populate(null);
- }
- }
-
- public void doPopulate() {
- this.targetEntityChooser.populate();
- this.fetchTypeComboViewer.populate();
- this.mappedByCombo.populate();
- this.cascadeComposite.populate();
- this.joinTableComposite.populate();
- this.orderingComposite.populate();
- }
-
- protected void engageListeners() {
- }
-
- protected void disengageListeners() {
- }
-
- @Override
- public void dispose() {
- this.targetEntityChooser.dispose();
- this.fetchTypeComboViewer.dispose();
- this.mappedByCombo.dispose();
- this.cascadeComposite.dispose();
- this.joinTableComposite.dispose();
- this.orderingComposite.dispose();
- super.dispose();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneComposite.java
deleted file mode 100644
index 135529349a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneComposite.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean;
-import org.eclipse.jpt.core.internal.mappings.IManyToOne;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class ManyToOneComposite extends BaseJpaComposite
-{
- private IManyToOne manyToOne;
-
- private TargetEntityChooser targetEntityChooser;
-
- private EnumComboViewer fetchTypeComboViewer;
-
- private EnumComboViewer optionalComboViewer;
-
- private OrderingComposite orderByComposite;
-
- private CascadeComposite cascadeComposite;
-
- private JoinColumnComposite joinColumnComposite;
-
- public ManyToOneComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
-
- Control generalControl = buildGeneralComposite(composite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- generalControl.setLayoutData(gridData);
-
- }
-
- private Control buildGeneralComposite(Composite composite) {
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-
- Composite generalComposite = getWidgetFactory().createComposite(composite);
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- generalComposite.setLayout(layout);
-
- this.targetEntityChooser = CommonWidgets.buildTargetEntityChooser(generalComposite, commandStack, getWidgetFactory());
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalSpan = 2;
- this.targetEntityChooser.getControl().setLayoutData(gridData);
- helpSystem.setHelp(targetEntityChooser.getControl(), IJpaHelpContextIds.MAPPING_TARGET_ENTITY);
-
- CommonWidgets.buildFetchLabel(generalComposite, getWidgetFactory());
- this.fetchTypeComboViewer = CommonWidgets.buildFetchTypeComboViewer(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.fetchTypeComboViewer.getControl().setLayoutData(gridData);
- helpSystem.setHelp(fetchTypeComboViewer.getControl(), IJpaHelpContextIds.MAPPING_FETCH_TYPE);
-
- CommonWidgets.buildOptionalLabel(generalComposite, getWidgetFactory());
- this.optionalComboViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.optionalComboViewer.getControl().setLayoutData(gridData);
-
- this.cascadeComposite = new CascadeComposite(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalSpan = 3;
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.cascadeComposite.getControl().setLayoutData(gridData);
-
- this.joinColumnComposite = new JoinColumnComposite(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalSpan = 2;
- this.joinColumnComposite.getControl().setLayoutData(gridData);
-
- return generalComposite;
- }
-
- public void doPopulate(EObject obj) {
- this.manyToOne = (IManyToOne) obj;
- this.targetEntityChooser.populate(this.manyToOne);
- this.fetchTypeComboViewer.populate(CommonWidgets.buildSingleRelationshipMappingFetchEnumHolder(this.manyToOne));
- this.optionalComboViewer.populate(new OptionalHolder(this.manyToOne));
- this.cascadeComposite.populate(this.manyToOne);
- this.joinColumnComposite.populate(this.manyToOne);
- }
-
- public void doPopulate() {
- this.targetEntityChooser.populate();
- this.fetchTypeComboViewer.populate();
- this.optionalComboViewer.populate();
- this.cascadeComposite.populate();
- this.joinColumnComposite.populate();
- }
-
- protected void engageListeners() {
- }
-
- protected void disengageListeners() {
- }
-
- @Override
- public void dispose() {
- this.targetEntityChooser.dispose();
- this.fetchTypeComboViewer.dispose();
- this.optionalComboViewer.dispose();
- this.cascadeComposite.dispose();
- this.joinColumnComposite.dispose();
- super.dispose();
- }
-
- private class OptionalHolder extends EObjectImpl implements EnumHolder {
-
- private IManyToOne manyToOne;
-
- OptionalHolder(IManyToOne manyToOne) {
- super();
- this.manyToOne = manyToOne;
- }
-
- public Object get() {
- return this.manyToOne.getOptional();
- }
-
- public void set(Object enumSetting) {
- this.manyToOne.setOptional((DefaultTrueBoolean) enumSetting);
- }
-
- public Class featureClass() {
- return IManyToOne.class;
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.IMANY_TO_ONE__OPTIONAL;
- }
-
- public EObject wrappedObject() {
- return this.manyToOne;
- }
-
- public Object[] enumValues() {
- return DefaultTrueBoolean.VALUES.toArray();
- }
- public Object defaultValue() {
- return DefaultTrueBoolean.DEFAULT;
- }
-
- public String defaultString() {
- //TODO move this out of the UI into the model
- return "True";
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedByCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedByCombo.java
deleted file mode 100644
index b0993475ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedByCombo.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.INonOwningMapping;
-import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class MappedByCombo extends BaseJpaController
-{
- private INonOwningMapping nonOwningMapping;
- private Adapter nonOwningMappingListener;
-
- private CCombo combo;
-
- public MappedByCombo(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, commandStack, widgetFactory);
- this.nonOwningMappingListener = buildListener();
- }
-
- private Adapter buildListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- nonOwningMappingChanged(notification);
- }
- };
- }
- @Override
- protected void buildWidget(Composite parent) {
- this.combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(combo,IJpaHelpContextIds.MAPPING_MAPPED_BY);
- this.combo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String mappedBy = ((CCombo) e.getSource()).getText();
- if (mappedBy.equals("")) { //$NON-NLS-1$
- mappedBy = null;
- if (getNonOwningMapping().getMappedBy() == null || getNonOwningMapping().getMappedBy().equals("")) { //$NON-NLS-1$
- return;
- }
- }
- if (getNonOwningMapping().getMappedBy() == null || !getNonOwningMapping().getMappedBy().equals(mappedBy)) {
- getNonOwningMapping().setMappedBy(mappedBy);
- }
- }
- });
- }
-
- private INonOwningMapping getNonOwningMapping() {
- return this.nonOwningMapping;
- }
-
- @Override
- protected void doPopulate(EObject obj) {
- this.nonOwningMapping = (INonOwningMapping) obj;
-
- if (this.nonOwningMapping == null) {
- return;
- }
-
- populateCombo();
- }
-
- private void populateCombo() {
- populateChoices();
- populateMappedByText();
- }
-
- private void populateChoices() {
- if (this.combo.getItemCount() > 0) {
- this.combo.removeAll();
- }
- for (Iterator<String> i = this.nonOwningMapping.candidateMappedByAttributeNames(); i.hasNext(); ) {
- this.combo.add(i.next());
- }
- }
-
- private void populateMappedByText() {
- String mappedBy = this.nonOwningMapping.getMappedBy();
- if (mappedBy != null) {
- if (!this.combo.getText().equals(mappedBy)) {
- this.combo.setText(mappedBy);
- }
- }
- }
-
- @Override
- protected void doPopulate() {
- }
-
- @Override
- protected void engageListeners() {
- if (this.nonOwningMapping != null) {
- this.nonOwningMapping.eAdapters().add(this.nonOwningMappingListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.nonOwningMapping != null) {
- this.nonOwningMapping.eAdapters().remove(this.nonOwningMappingListener);
- }
- }
-
- protected void nonOwningMappingChanged(Notification notification) {
- if (notification.getFeatureID(INonOwningMapping.class) == JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateMappedByText();
- }
- });
- }
- else if (notification.getFeatureID(IRelationshipMapping.class) == JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateChoices();
- }
- });
- }
- }
-
- @Override
- public Control getControl() {
- return this.combo;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedSuperclassComposite.java
deleted file mode 100644
index 7d21ec76e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedSuperclassComposite.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class MappedSuperclassComposite extends BaseJpaComposite
-{
- private IMappedSuperclass mappedSuperclass;
- private Adapter mappedSuperclassListener;
-
- private CommandStack commandStack;
-
-
- public MappedSuperclassComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.mappedSuperclassListener = buildMappedSuperclassListener();
- }
-
- private Adapter buildMappedSuperclassListener() {
- return new AdapterImpl() {
- @Override
- public void notifyChanged(Notification notification) {
- mappedSuperclassChanged(notification);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- composite.setLayout(new FillLayout(SWT.VERTICAL));
-
-// Label accessTypeLabel = new Label(composite, SWT.LEFT);
-// accessTypeLabel.setText(DaliUiMessages.MappedSuperclassComposite_accessType);
-// this.accessTypeComboViewer = buildAccessTypeCombo(composite);
-// //eventually this will be enabled if editing xml instead of java
-// this.accessTypeComboViewer.getCombo().setEnabled(false);
-// GridData gridData = new GridData();
-// gridData.horizontalAlignment = GridData.FILL;
-// gridData.grabExcessHorizontalSpace = true;
-// this.accessTypeComboViewer.getCombo().setLayoutData(gridData);
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(this.accessTypeComboViewer.getCombo(), IDaliHelpContextIds.ENTITY_ACCESS_TYPE);
-
- }
-
-// private ComboViewer buildAccessTypeCombo(Composite parent) {
-// ComboViewer viewer = new ComboViewer(parent, SWT.READ_ONLY);
-// viewer.add(AccessType.VALUES.toArray());
-// viewer.addSelectionChangedListener(new ISelectionChangedListener() {
-// public void selectionChanged(SelectionChangedEvent event) {
-// if (populating) {
-// return;
-// }
-// if (event.getSelection() instanceof StructuredSelection) {
-// StructuredSelection selection = (StructuredSelection) event.getSelection();
-// editingDomain.getCommandStack().execute(SetCommand.create(editingDomain, persistentType, OrmPackage.eINSTANCE.getPersistentType_AccessType(), selection.getFirstElement()));
-// }
-// }
-// });
-// return viewer;
-// }
-
- @Override
- protected void doPopulate(EObject model) {
- this.mappedSuperclass = (IMappedSuperclass) model;
- }
-
- @Override
- protected void doPopulate() {
-
- }
-
-
- protected void engageListeners() {
-// this.persistentTypeItemProvider.addListener(getPersistentTypeListener());
-// this.persistentType.eAdapters().add(this.persistentTypeItemProvider);
- }
-
- protected void disengageListeners() {
-// if (this.persistentType != null){
-// this.persistentType.eAdapters().remove(this.persistentTypeItemProvider);
-// this.persistentTypeItemProvider.removeListener(getPersistentTypeListener());
-// }
- }
-
- private void mappedSuperclassChanged(Notification notification) {
-
- }
-
-// private INotifyChangedListener getPersistentTypeListener() {
-// if (this.persistentTypeListener == null) {
-// this.persistentTypeListener = new INotifyChangedListener() {
-// public void notifyChanged(Notification notification) {
-// if (notification.getFeatureID(PersistentType.class) == OrmPackage.PERSISTENT_TYPE__ACCESS_TYPE) {
-// final AccessType accessType = (AccessType) notification.getNewValue();
-// Display.getDefault().syncExec(new Runnable() {
-// public void run() {
-// if (((StructuredSelection) accessTypeComboViewer.getSelection()).getFirstElement() != accessType) {
-// accessTypeComboViewer.setSelection(new StructuredSelection(accessType));
-// }
-// }
-// });
-// }
-// }
-// };
-// }
-// return this.persistentTypeListener;
-// }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyComposite.java
deleted file mode 100644
index 113173f266..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyComposite.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.IOneToMany;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class OneToManyComposite extends BaseJpaComposite
-{
- private IOneToMany oneToMany;
-
- private EnumComboViewer fetchTypeComboViewer;
-
- private TargetEntityChooser targetEntityChooser;
-
- private MappedByCombo mappedByCombo;
-
- private CascadeComposite cascadeComposite;
-
- private OrderingComposite orderingComposite;
-
- private JoinTableComposite joinTableComposite;
-
- public OneToManyComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
-
- Control generalControl = buildGeneralControl(composite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- generalControl.setLayoutData(gridData);
-
- Control joinTableControl = buildJoinTableControl(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- joinTableControl.setLayoutData(gridData);
- }
-
- private Control buildGeneralControl(Composite composite) {
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-
- Composite generalComposite = getWidgetFactory().createComposite(composite);
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- generalComposite.setLayout(layout);
-
- GridData gridData;
-
- this.targetEntityChooser = CommonWidgets.buildTargetEntityChooser(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalSpan = 2;
- this.targetEntityChooser.getControl().setLayoutData(gridData);
-
- CommonWidgets.buildFetchLabel(generalComposite, getWidgetFactory());
- this.fetchTypeComboViewer = CommonWidgets.buildFetchTypeComboViewer(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.fetchTypeComboViewer.getControl().setLayoutData(gridData);
- helpSystem.setHelp(this.fetchTypeComboViewer.getControl(), IJpaHelpContextIds.MAPPING_FETCH_TYPE);
-
- CommonWidgets.buildMappedByLabel(generalComposite, getWidgetFactory());
- this.mappedByCombo = new MappedByCombo(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.mappedByCombo.getControl().setLayoutData(gridData);
- helpSystem.setHelp(this.mappedByCombo.getControl(), IJpaHelpContextIds.MAPPING_MAPPED_BY);
-
- this.cascadeComposite = new CascadeComposite(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalSpan = 3;
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.cascadeComposite.getControl().setLayoutData(gridData);
-
- this.orderingComposite = new OrderingComposite(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalSpan = 3;
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.orderingComposite.getControl().setLayoutData(gridData);
-
-
- return generalComposite;
- }
-
- private Control buildJoinTableControl(Composite composite) {
- Section section = getWidgetFactory().createSection(composite, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
- section.setText(JptUiMappingsMessages.MultiRelationshipMappingComposite_joinTable);
-
- Composite joinTableClient = getWidgetFactory().createComposite(section);
- section.setClient(joinTableClient);
-
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- joinTableClient.setLayout(layout);
-
- this.joinTableComposite = new JoinTableComposite(joinTableClient, this.commandStack, getWidgetFactory());
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- this.joinTableComposite.getControl().setLayoutData(gridData);
-
- return section;
- }
-
- public void doPopulate(EObject obj) {
- this.oneToMany = (IOneToMany) obj;
- this.fetchTypeComboViewer.populate(CommonWidgets.buildMultiRelationshipMappingFetchEnumHolder(this.oneToMany));
- this.targetEntityChooser.populate(this.oneToMany);
- this.mappedByCombo.populate(this.oneToMany);
- this.cascadeComposite.populate(this.oneToMany);
- if (this.oneToMany != null) {
- this.joinTableComposite.populate(this.oneToMany.getJoinTable());
- this.orderingComposite.populate(this.oneToMany);
- }
- else {
- this.joinTableComposite.populate(null);
- this.orderingComposite.populate(null);
- }
- }
-
- public void doPopulate() {
- this.fetchTypeComboViewer.populate();
- this.targetEntityChooser.populate();
- this.mappedByCombo.populate();
- this.cascadeComposite.populate();
- this.joinTableComposite.populate();
- this.orderingComposite.populate();
- }
-
- protected void engageListeners() {
- }
-
- protected void disengageListeners() {
- }
-
- @Override
- public void dispose() {
- this.fetchTypeComboViewer.dispose();
- this.targetEntityChooser.dispose();
- this.mappedByCombo.dispose();
- this.cascadeComposite.dispose();
- this.joinTableComposite.dispose();
- this.orderingComposite.dispose();
- super.dispose();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneComposite.java
deleted file mode 100644
index 73969770de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneComposite.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean;
-import org.eclipse.jpt.core.internal.mappings.IOneToOne;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class OneToOneComposite extends BaseJpaComposite
-{
- private IOneToOne oneToOne;
-
- private TargetEntityChooser targetEntityChooser;
-
- private EnumComboViewer fetchTypeComboViewer;
-
- private MappedByCombo mappedByCombo;
-
- private EnumComboViewer optionalComboViewer;
-
- private CascadeComposite cascadeComposite;
-
- private JoinColumnComposite joinColumnComposite;
-
- public OneToOneComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- }
-
- private IOneToOne getOneToOne() {
- return this.oneToOne;
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
-
- Control generalControl = buildGeneralComposite(composite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- generalControl.setLayoutData(gridData);
-
- }
-
- private Control buildGeneralComposite(Composite composite) {
-// IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-
- Composite generalComposite = getWidgetFactory().createComposite(composite);
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- generalComposite.setLayout(layout);
-
- this.targetEntityChooser = CommonWidgets.buildTargetEntityChooser(generalComposite, this.commandStack, getWidgetFactory());
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalSpan = 2;
- this.targetEntityChooser.getControl().setLayoutData(gridData);
-
-
- CommonWidgets.buildFetchLabel(generalComposite, getWidgetFactory());
- this.fetchTypeComboViewer = CommonWidgets.buildFetchTypeComboViewer(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.fetchTypeComboViewer.getControl().setLayoutData(gridData);
-
- CommonWidgets.buildMappedByLabel(generalComposite, getWidgetFactory());
- this.mappedByCombo = new MappedByCombo(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.mappedByCombo.getControl().setLayoutData(gridData);
-
- CommonWidgets.buildOptionalLabel(generalComposite, getWidgetFactory());
- this.optionalComboViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.optionalComboViewer.getControl().setLayoutData(gridData);
-
- this.cascadeComposite = new CascadeComposite(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalSpan = 3;
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.cascadeComposite.getControl().setLayoutData(gridData);
-
- this.joinColumnComposite = new JoinColumnComposite(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalSpan = 2;
- this.joinColumnComposite.getControl().setLayoutData(gridData);
-
- return generalComposite;
- }
-
- public void doPopulate(EObject obj) {
- this.oneToOne = (IOneToOne) obj;
- this.targetEntityChooser.populate(this.oneToOne);
- this.fetchTypeComboViewer.populate(CommonWidgets.buildSingleRelationshipMappingFetchEnumHolder(this.oneToOne));
- this.mappedByCombo.populate(this.oneToOne);
- this.optionalComboViewer.populate(new OptionalHolder(this.oneToOne));
- this.cascadeComposite.populate(this.oneToOne);
- this.joinColumnComposite.populate(this.oneToOne);
- }
-
- public void doPopulate() {
- this.targetEntityChooser.populate();
- this.fetchTypeComboViewer.populate();
- this.mappedByCombo.populate();
- this.optionalComboViewer.populate();
- this.cascadeComposite.populate();
- this.joinColumnComposite.populate();
- }
-
- protected void engageListeners() {
- }
-
- protected void disengageListeners() {
- }
-
- @Override
- public void dispose() {
- this.targetEntityChooser.dispose();
- this.fetchTypeComboViewer.dispose();
- this.mappedByCombo.dispose();
- this.optionalComboViewer.dispose();
- this.cascadeComposite.dispose();
- this.joinColumnComposite.dispose();
- super.dispose();
- }
-
- private class OptionalHolder extends EObjectImpl implements EnumHolder {
-
- private IOneToOne oneToOne;
-
- OptionalHolder(IOneToOne oneToOne) {
- super();
- this.oneToOne = oneToOne;
- }
-
- public Object get() {
- return this.oneToOne.getOptional();
- }
-
- public void set(Object enumSetting) {
- this.oneToOne.setOptional((DefaultTrueBoolean) enumSetting);
- }
-
- public Class featureClass() {
- return IOneToOne.class;
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.IONE_TO_ONE__OPTIONAL;
- }
-
- public EObject wrappedObject() {
- return this.oneToOne;
- }
-
- public Object[] enumValues() {
- return DefaultTrueBoolean.VALUES.toArray();
- }
-
- public Object defaultValue() {
- return DefaultTrueBoolean.DEFAULT;
- }
-
- public String defaultString() {
- //TODO move this out of the UI into the model
- return "True";
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OrderingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OrderingComposite.java
deleted file mode 100644
index 95b1bc6284..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OrderingComposite.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.ITextListener;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.TextEvent;
-import org.eclipse.jface.text.TextViewer;
-import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- *
- */
-public class OrderingComposite extends BaseJpaComposite {
-
- private IMultiRelationshipMapping mapping;
- private Adapter mappingListener;
-
- private Button noOrderingRadioButton;
- private Button primaryKeyOrderingRadioButton;
- private Button customOrderingRadioButton;
-
- private ITextViewer orderingTextViewer;
-
- // short circuit flag for user typing
- private boolean updatingCustomOrderBy = false;
-
-
- public OrderingComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, commandStack, widgetFactory);
- this.mappingListener = buildMappingListener();
- }
-
- private Adapter buildMappingListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- mappingChanged(notification);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- Group orderByGroup = getWidgetFactory().createGroup(composite, JptUiMappingsMessages.OrderByComposite_orderByGroup);
- orderByGroup.setLayout(new GridLayout(1, false));
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- orderByGroup.setLayoutData(gridData);
- helpSystem.setHelp(orderByGroup, IJpaHelpContextIds.MAPPING_ORDER_BY);
-
-
- this.noOrderingRadioButton = buildNoOrderingRadioButton(orderByGroup);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.noOrderingRadioButton.setLayoutData(gridData);
-// helpSystem().setHelp(this.noOrderingRadioButton, IJpaHelpContextIds.MAPPING_ORDER_BY_NO_ORDERING);
-
-
- this.primaryKeyOrderingRadioButton = buildPrimaryKeyOrderingRadioButton(orderByGroup);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.primaryKeyOrderingRadioButton.setLayoutData(gridData);
-// helpSystem().setHelp(this.primaryKeyOrderingRadioButton, IJpaHelpContextIds.MAPPING_ORDER_BY_PRIMARY_KEY_ORDERING);
-
- this.customOrderingRadioButton = buildCustomOrderingRadioButton(orderByGroup);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.customOrderingRadioButton.setLayoutData(gridData);
-// helpSystem().setHelp(this.customOrderingRadioButton, IJpaHelpContextIds.MAPPING_ORDER_BY_CUSTOM_ORDERING);
-
-
- this.orderingTextViewer = buildOrderByTestViewer(orderByGroup);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalIndent = 15;
- this.orderingTextViewer.getTextWidget().setLayoutData(gridData);
- helpSystem.setHelp(this.orderingTextViewer.getTextWidget(), IJpaHelpContextIds.MAPPING_ORDER_BY);
- }
-
- private Button buildNoOrderingRadioButton(Composite parent) {
- Button button = getWidgetFactory().createButton(
- parent,
- JptUiMappingsMessages.OrderByComposite_noOrdering,
- SWT.RADIO);
- button.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // ignore
- }
- public void widgetSelected(SelectionEvent e) {
- OrderingComposite.this.noOrderingRadioButtonSelected(e);
- }
- });
-
- return button;
- }
-
- void noOrderingRadioButtonSelected(SelectionEvent e) {
- if (!((Button) e.widget).getSelection()) {
- //ignore case where radio button is deselected
- return;
- }
- if (this.mapping.isNoOrdering()) {
- return;
- }
- this.mapping.setNoOrdering();
- }
-
- private Button buildPrimaryKeyOrderingRadioButton(Composite parent) {
- Button button = getWidgetFactory().createButton(
- parent,
- JptUiMappingsMessages.OrderByComposite_primaryKeyOrdering,
- SWT.RADIO);
- button.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // ignore
- }
- public void widgetSelected(SelectionEvent e) {
- OrderingComposite.this.primaryKeyOrderingRadioButtonSelected(e);
- }
- });
- return button;
- }
-
- void primaryKeyOrderingRadioButtonSelected(SelectionEvent e) {
- if (!((Button) e.widget).getSelection()) {
- //ignore case where radio button is deselected
- return;
- }
- if (! this.mapping.isOrderByPk()) {
- this.mapping.setOrderByPk();
- }
- setTextViewerEnabled(false);
- }
-
- private Button buildCustomOrderingRadioButton(Composite parent) {
- Button button = getWidgetFactory().createButton(
- parent,
- JptUiMappingsMessages.OrderByComposite_customOrdering,
- SWT.RADIO);
- button.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // ignore
- }
- public void widgetSelected(SelectionEvent e) {
- OrderingComposite.this.customOrderingRadioButtonSelected(e);
- }
- });
-
- return button;
- }
-
- void customOrderingRadioButtonSelected(SelectionEvent e) {
- if (!((Button) e.widget).getSelection()) {
- //ignore case where radio button is deselected
- return;
- }
- setTextViewerEnabled(true);
- }
-
- private ITextViewer buildOrderByTestViewer(Composite parent) {
- final TextViewer textViewer = new TextViewer(parent, SWT.SINGLE | SWT.BORDER);
- textViewer.setDocument(new Document());
- textViewer.addTextListener(new ITextListener() {
- public void textChanged(TextEvent event) {
- orderingTextViewerChanged();
- }
- });
- return textViewer;
- }
-
- private void orderingTextViewerChanged() {
- if (isPopulating()) {
- return;
- }
- String orderByValue = this.orderingTextViewer.getDocument().get();
- if (orderByValue.equals(this.mapping.getOrderBy())) {
- return;
- }
-
- this.updatingCustomOrderBy = true;
- this.mapping.setOrderBy(orderByValue);
- }
-
- private void setTextViewerEnabled(boolean enabled) {
- this.orderingTextViewer.setEditable(enabled);
- this.orderingTextViewer.getTextWidget().setEnabled(enabled);
- }
-
- private void mappingChanged(Notification notification) {
- if (notification.getFeatureID(IMultiRelationshipMapping.class) == JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- populate();
- }
- });
- }
- }
-
- @Override
- protected void doPopulate(EObject obj) {
- this.mapping = (IMultiRelationshipMapping) obj;
- if (this.mapping == null) {
- return;
- }
- populateOrderingRadioButtons();
- }
-
- @Override
- protected void doPopulate() {
- populateOrderingRadioButtons();
- }
-
- @Override
- protected void engageListeners() {
- if (this.mapping != null) {
- this.mapping.eAdapters().add(this.mappingListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.mapping != null) {
- this.mapping.eAdapters().remove(this.mappingListener);
- }
- }
-
- private void populateOrderingRadioButtons() {
- // short circuit if user is typing
- if (updatingCustomOrderBy) {
- updatingCustomOrderBy = false;
- return;
- }
-
- if (this.mapping.isNoOrdering()) {
- this.primaryKeyOrderingRadioButton.setSelection(false);
- this.customOrderingRadioButton.setSelection(false);
- this.noOrderingRadioButton.setSelection(true);
- if (! "".equals(this.orderingTextViewer.getDocument().get())) {
- this.orderingTextViewer.getDocument().set("");
- }
- }
- else if (this.mapping.isOrderByPk()) {
- this.customOrderingRadioButton.setSelection(false);
- this.noOrderingRadioButton.setSelection(false);
- this.primaryKeyOrderingRadioButton.setSelection(true);
-// String value = this.ordering.getValue();
-// if (value != null && !value.equals(this.orderingTextViewer.getDocument().get())) {
-// this.orderingTextViewer.getDocument().set(value);
-// }
-// else {
- if (!"".equals(this.orderingTextViewer.getDocument().get())) {
- this.orderingTextViewer.getDocument().set("");
- }
-// }
- }
- else if (this.mapping.isCustomOrdering()) {
- this.noOrderingRadioButton.setSelection(false);
- this.primaryKeyOrderingRadioButton.setSelection(false);
- this.customOrderingRadioButton.setSelection(true);
- String value = this.mapping.getOrderBy();
- if (value != null && !value.equals(this.orderingTextViewer.getDocument().get())) {
- this.orderingTextViewer.getDocument().set(value);
- }
- }
-
- setTextViewerEnabled(this.mapping.isCustomOrdering());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OverridesComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OverridesComposite.java
deleted file mode 100644
index 986aab26e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OverridesComposite.java
+++ /dev/null
@@ -1,501 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import java.util.List;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.core.internal.JpaEObject;
-import org.eclipse.jpt.core.internal.mappings.IAssociationOverride;
-import org.eclipse.jpt.core.internal.mappings.IAttributeOverride;
-import org.eclipse.jpt.core.internal.mappings.IEntity;
-import org.eclipse.jpt.core.internal.mappings.IJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.IOverride;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.JoinColumnsComposite.Owner;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class OverridesComposite extends BaseJpaComposite
-{
- private ListViewer listViewer;
-
- private IEntity entity;
- private Adapter entityListener;
-
- private IOverride selectedOverride;
- private Adapter overrideListener;
-
- protected PageBook overridePageBook;
-
- protected ColumnComposite columnComposite;
- protected JoinColumnsComposite joinColumnsComposite;
-
- private Button overrideDefaultButton;
-
- public OverridesComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.entityListener = buildEntityListener();
- this.overrideListener = buildOverrideListener();
- }
-
- private Adapter buildEntityListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- entityChanged(notification);
- }
- };
- }
-
- private Adapter buildOverrideListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- overrideChanged(notification);
- }
- };
- }
-
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- Group attributeOverridesGroup = getWidgetFactory().createGroup(
- composite, JptUiMappingsMessages.AttributeOverridesComposite_attributeOverrides);
- attributeOverridesGroup.setLayout(new GridLayout(2, true));
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace= true;
- attributeOverridesGroup.setLayoutData(gridData);
-
- this.listViewer = buildAttributeOverridesListViewer(attributeOverridesGroup);
- gridData = new GridData();
- gridData.verticalSpan = 2;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace= true;
- this.listViewer.getList().setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.listViewer.getList(), IJpaHelpContextIds.ENTITY_ATTRIBUTE_OVERRIDES);
-
- this.overrideDefaultButton =
- getWidgetFactory().createButton(
- attributeOverridesGroup,
- JptUiMappingsMessages.AttributeOverridesComposite_overridDefault,
- SWT.CHECK);
- this.overrideDefaultButton.addSelectionListener(buildOverrideDefaultSelectionListener());
- gridData = new GridData();
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.overrideDefaultButton.setLayoutData(gridData);
-
-
- this.overridePageBook = buildOverridePageBook(attributeOverridesGroup);
- gridData = new GridData();
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.overridePageBook.setLayoutData(gridData);
-
- this.joinColumnsComposite = new JoinColumnsComposite(this.overridePageBook, this.commandStack, getWidgetFactory(), JptUiMappingsMessages.OverridesComposite_joinColumn);
- this.columnComposite = new ColumnComposite(this.overridePageBook, this.commandStack, getWidgetFactory());
- this.overridePageBook.showPage(this.joinColumnsComposite.getControl());
- }
-
- protected PageBook buildOverridePageBook(Composite parent) {
- return new PageBook(parent, SWT.NONE);
- }
-
- private SelectionListener buildOverrideDefaultSelectionListener() {
- return new SelectionListener(){
-
- public void widgetSelected(SelectionEvent e) {
- overrideDefaultButtonSelected(e);
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- overrideDefaultButtonSelected(e);
- }
- };
- }
-
- private void overrideDefaultButtonSelected(SelectionEvent e) {
- boolean selection = this.overrideDefaultButton.getSelection();
- if (selection) {
- if (getSelectedOverride() instanceof IAttributeOverride) {
- int index = this.entity.getSpecifiedAttributeOverrides().size();
- IAttributeOverride attributeOverride = this.entity.createAttributeOverride(index);
- this.entity.getSpecifiedAttributeOverrides().add(attributeOverride);
- attributeOverride.setName(this.selectedOverride.getName());
- attributeOverride.getColumn().setSpecifiedName(((IAttributeOverride) this.selectedOverride).getColumn().getName());
- }
- else {
- int index = this.entity.getSpecifiedAssociationOverrides().size();
- IAssociationOverride associationOverride = this.entity.createAssociationOverride(index);
- String name = this.selectedOverride.getName();
- this.entity.getSpecifiedAssociationOverrides().add(associationOverride);
- associationOverride.setName(name);
- //attributeOverride.getColumn().setSpecifiedName(this.attributeOverride.getColumn().getName());
- }
- }
- else {
- if (getSelectedOverride() instanceof IAttributeOverride) {
- this.entity.getSpecifiedAttributeOverrides().remove(this.selectedOverride);
- }
- else {
- this.entity.getSpecifiedAssociationOverrides().remove(this.selectedOverride);
- }
- }
- }
-
-
- private ListViewer buildAttributeOverridesListViewer(Composite parent) {
- ListViewer listViewer = new ListViewer(parent, SWT.SINGLE | SWT.BORDER);
- listViewer.setLabelProvider(buildAttributeOverridesLabelProvider());
- listViewer.setContentProvider(buildAttributeOverridesContentProvider());
-
- listViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- overridesListSelectionChanged(event);
- }
- });
-
- return listViewer;
- }
-
- protected void overridesListSelectionChanged(SelectionChangedEvent event) {
- if (((StructuredSelection) event.getSelection()).isEmpty()) {
- this.columnComposite.populate(null);
- this.columnComposite.enableWidgets(false);
- this.overrideDefaultButton.setSelection(false);
- this.overrideDefaultButton.setEnabled(false);
- }
- else {
- this.selectedOverride = getSelectedOverride();
- if (this.selectedOverride instanceof IAttributeOverride) {
- boolean specifiedOverride = this.entity.getSpecifiedAttributeOverrides().contains(this.selectedOverride);
- this.overrideDefaultButton.setSelection(specifiedOverride);
- this.overridePageBook.showPage(this.columnComposite.getControl());
- this.columnComposite.populate(((IAttributeOverride) this.selectedOverride).getColumn());
- this.columnComposite.enableWidgets(specifiedOverride);
- this.overrideDefaultButton.setEnabled(true);
- }
- else {
- boolean specifiedOverride = this.entity.getSpecifiedAssociationOverrides().contains(this.selectedOverride);
- this.overrideDefaultButton.setSelection(specifiedOverride);
- this.overridePageBook.showPage(this.joinColumnsComposite.getControl());
- this.joinColumnsComposite.populate(new JoinColumnsOwner((IAssociationOverride) getSelectedOverride()));
- this.joinColumnsComposite.enableWidgets(specifiedOverride);
- this.overrideDefaultButton.setEnabled(true);
- }
- }
- }
-
- private ILabelProvider buildAttributeOverridesLabelProvider() {
- return new LabelProvider() {
- public String getText(Object element) {
- //TODO also display column name somehow
- return ((IOverride) element).getName();
- }
- };
- }
-
-
- private IContentProvider buildAttributeOverridesContentProvider() {
- return new IStructuredContentProvider() {
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- public void dispose() {
- }
-
- public Object[] getElements(Object inputElement) {
- IEntity entity = (IEntity) inputElement;
- return CollectionTools.addAll(
- entity.getAttributeOverrides().toArray(new IOverride[entity.getAttributeOverrides().size()]),
- entity.getAssociationOverrides());
- }
- };
- }
-
- private IOverride getSelectedOverride() {
- return (IOverride) ((StructuredSelection) this.listViewer.getSelection()).getFirstElement();
- }
-
-
- public void doPopulate(EObject obj) {
- this.entity = (IEntity) obj;
- if (this.entity == null) {
- this.selectedOverride = null;
- this.columnComposite.populate(null);
- this.joinColumnsComposite.populate(null);
- this.listViewer.setInput(null);
- return;
- }
-
- if (this.listViewer.getInput() != entity) {
- this.listViewer.setInput(entity);
- }
- if (!this.entity.getAttributeOverrides().isEmpty()) {
- if (this.listViewer.getSelection().isEmpty()) {
- IOverride override = this.entity.getAttributeOverrides().get(0);
- this.listViewer.setSelection(new StructuredSelection(override));
- }
- else {
- Object selection = ((StructuredSelection) this.listViewer.getSelection()).getFirstElement();
- if (selection instanceof IAttributeOverride) {
- this.overridePageBook.showPage(this.columnComposite.getControl());
- this.columnComposite.enableWidgets(true);
- this.columnComposite.populate(((IAttributeOverride) selection).getColumn());
- }
- else {
- this.overridePageBook.showPage(this.joinColumnsComposite.getControl());
- this.joinColumnsComposite.enableWidgets(true);
- this.joinColumnsComposite.populate(new JoinColumnsOwner((IAssociationOverride) selection));
- }
- }
- }
- else {
- this.columnComposite.populate(null);
- this.columnComposite.enableWidgets(false);
- }
- }
-
- @Override
- protected void doPopulate() {
- this.columnComposite.doPopulate();
- this.joinColumnsComposite.doPopulate();
- }
-
- @Override
- protected void engageListeners() {
- if (this.entity != null) {
- this.entity.eAdapters().add(this.entityListener);
- for (IOverride attributeOverride : this.entity.getAttributeOverrides()) {
- attributeOverride.eAdapters().add(this.overrideListener);
- }
- for (IOverride attributeOverride : this.entity.getAssociationOverrides()) {
- attributeOverride.eAdapters().add(this.overrideListener);
- }
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.entity != null) {
- this.entity.eAdapters().remove(this.entityListener);
- for (IOverride attributeOverride : this.entity.getAttributeOverrides()) {
- attributeOverride.eAdapters().remove(this.overrideListener);
- }
- for (IOverride attributeOverride : this.entity.getAssociationOverrides()) {
- attributeOverride.eAdapters().remove(this.overrideListener);
- }
- }
- }
-
-
- protected void entityChanged(Notification notification) {
- switch (notification.getFeatureID(IEntity.class)) {
- case JpaCoreMappingsPackage.IENTITY__SPECIFIED_ATTRIBUTE_OVERRIDES :
- case JpaCoreMappingsPackage.IENTITY__SPECIFIED_ASSOCIATION_OVERRIDES :
- case JpaCoreMappingsPackage.IENTITY__DEFAULT_ATTRIBUTE_OVERRIDES :
- case JpaCoreMappingsPackage.IENTITY__DEFAULT_ASSOCIATION_OVERRIDES :
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (listViewer.getList().isDisposed()) {
- return;
- }
- listViewer.refresh();
- }
- });
-
- if (notification.getEventType() == Notification.ADD) {
- ((IOverride) notification.getNewValue()).eAdapters().add(this.overrideListener);
- final Object newValue = notification.getNewValue();
- ((IOverride) newValue).eAdapters().add(this.overrideListener);
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (listViewer.getList().isDisposed()) {
- return;
- }
- listViewer.setSelection(new StructuredSelection(newValue));
- }
- });
- }
- else if (notification.getEventType() == Notification.ADD_MANY) {
- List<IOverride> addedList = (List<IOverride>) notification.getNewValue();
- for (IOverride override : addedList) {
- override.eAdapters().add(this.overrideListener);
- }
- }
- else if (notification.getEventType() == Notification.REMOVE) {
- ((IOverride) notification.getOldValue()).eAdapters().remove(this.overrideListener);
- }
- else if (notification.getEventType() == Notification.REMOVE_MANY) {
- List<IOverride> removedList = (List<IOverride>) notification.getOldValue();
- for (IOverride override : removedList) {
- override.eAdapters().remove(this.overrideListener);
- }
- }
- break;
- }
- }
-
- protected void overrideChanged(Notification notification) {
- switch (notification.getFeatureID(IOverride.class)) {
- case JpaCoreMappingsPackage.IOVERRIDE__NAME :
- final IOverride override = (IOverride) notification.getNotifier();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- OverridesComposite.this.listViewer.update(override, null);
- }
- });
- break;
- default :
- break;
- }
- }
-
- public void dispose() {
- this.columnComposite.dispose();
- this.joinColumnsComposite.dispose();
- super.dispose();
- }
-
-
- void addJoinColumn() {
- JoinColumnInAssociationOverrideDialog dialog = new JoinColumnInAssociationOverrideDialog(this.getControl().getShell(), (IAssociationOverride) getSelectedOverride());
- this.addJoinColumnFromDialog(dialog);
- }
-
- private void addJoinColumnFromDialog(JoinColumnInAssociationOverrideDialog dialog) {
- if (dialog.open() != Window.OK) {
- return;
- }
- int index = ((IAssociationOverride) getSelectedOverride()).getJoinColumns().size();
- IJoinColumn joinColumn = ((IAssociationOverride) getSelectedOverride()).createJoinColumn(index);
- ((IAssociationOverride) getSelectedOverride()).getSpecifiedJoinColumns().add(joinColumn);
- joinColumn.setSpecifiedName(dialog.getSelectedName());
- joinColumn.setSpecifiedReferencedColumnName(dialog.getReferencedColumnName());
- }
-
- void editJoinColumn(IJoinColumn joinColumn) {
- JoinColumnInAssociationOverrideDialog dialog = new JoinColumnInAssociationOverrideDialog(this.getControl().getShell(), joinColumn);
- editJoinColumnFromDialog(dialog, joinColumn);
- }
-
- private void editJoinColumnFromDialog(JoinColumnInAssociationOverrideDialog dialog, IJoinColumn joinColumn) {
- if (dialog.open() == Window.OK) {
- editJoinColumnDialogOkd(dialog, joinColumn);
- }
- }
-
- private void editJoinColumnDialogOkd(JoinColumnInAssociationOverrideDialog dialog, IJoinColumn joinColumn) {
- String name = dialog.getSelectedName();
- String referencedColumnName = dialog.getReferencedColumnName();
-
- if (dialog.isDefaultNameSelected()) {
- if (joinColumn.getSpecifiedName() != null) {
- joinColumn.setSpecifiedName(null);
- }
- }
- else if (joinColumn.getSpecifiedName() == null || !joinColumn.getSpecifiedName().equals(name)){
- joinColumn.setSpecifiedName(name);
- }
-
- if (dialog.isDefaultReferencedColumnNameSelected()) {
- if (joinColumn.getSpecifiedReferencedColumnName() != null) {
- joinColumn.setSpecifiedReferencedColumnName(null);
- }
- }
- else if (joinColumn.getSpecifiedReferencedColumnName() == null || !joinColumn.getSpecifiedReferencedColumnName().equals(referencedColumnName)){
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- }
- }
-
- private class JoinColumnsOwner extends JpaEObject implements Owner {
-
- IAssociationOverride associationOverride;
-
- public JoinColumnsOwner(IAssociationOverride associationOverride) {
- super();
- this.associationOverride = associationOverride;
- }
-
- public void addJoinColumn() {
- OverridesComposite.this.addJoinColumn();
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return this.associationOverride.containsSpecifiedJoinColumns();
- }
-
- public IJoinColumn createJoinColumn(int index) {
- return this.associationOverride.createJoinColumn(index);
- }
-
- public List<IJoinColumn> getJoinColumns() {
- return this.associationOverride.getJoinColumns();
- }
-
- public List<IJoinColumn> getSpecifiedJoinColumns() {
- return this.associationOverride.getSpecifiedJoinColumns();
- }
-
- public int specifiedJoinColumnsFeatureId() {
- return JpaCoreMappingsPackage.IASSOCIATION_OVERRIDE__SPECIFIED_JOIN_COLUMNS;
- }
-
- public Class owningFeatureClass() {
- return IAssociationOverride.class;
- }
-
- public void editJoinColumn(IJoinColumn joinColumn) {
- OverridesComposite.this.editJoinColumn(joinColumn);
- }
-
- public EObject getEObject() {
- return this.associationOverride;
- }
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialog.java
deleted file mode 100644
index f7aa9653e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialog.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import org.eclipse.jpt.core.internal.mappings.IEntity;
-import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.swt.widgets.Shell;
-
-public class PrimaryKeyJoinColumnDialog extends AbstractJoinColumnDialog<IPrimaryKeyJoinColumn> {
-
- private IEntity entity;
-
- PrimaryKeyJoinColumnDialog(Shell parent, IEntity entity) {
- super(parent);
- this.entity = entity;
- }
-
- PrimaryKeyJoinColumnDialog(Shell parent, IPrimaryKeyJoinColumn joinColumn) {
- super(parent, joinColumn);
- this.entity = (IEntity) joinColumn.eContainer();
- }
-
- protected Table getNameTable() {
- return this.entity.primaryDbTable();
- }
-
- protected Table getReferencedNameTable() {
- return this.entity.parentEntity().primaryDbTable();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java
deleted file mode 100644
index 51a220df88..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.ISecondaryTable;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.swt.widgets.Shell;
-
-public class PrimaryKeyJoinColumnInSecondaryTableDialog extends AbstractJoinColumnDialog<IPrimaryKeyJoinColumn> {
-
- private ISecondaryTable secondaryTable;
-
- PrimaryKeyJoinColumnInSecondaryTableDialog(Shell parent, ISecondaryTable secondaryTable) {
- super(parent);
- this.secondaryTable = secondaryTable;
- }
-
- PrimaryKeyJoinColumnInSecondaryTableDialog(Shell parent, IPrimaryKeyJoinColumn joinColumn) {
- super(parent, joinColumn);
- this.secondaryTable = (ISecondaryTable) joinColumn.eContainer();
- }
-
- protected Table getNameTable() {
- return this.secondaryTable.dbTable();
- }
-
- protected Table getReferencedNameTable() {
- return this.secondaryTable.typeMapping().primaryDbTable();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsComposite.java
deleted file mode 100644
index d7a75243b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsComposite.java
+++ /dev/null
@@ -1,399 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.IEntity;
-import org.eclipse.jpt.core.internal.mappings.INamedColumn;
-import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class PrimaryKeyJoinColumnsComposite extends BaseJpaComposite
-{
- private IEntity entity;
- private final Adapter entityListener;
- private final Adapter pkJoinColumnListener;
-
- ListViewer pkJoinColumnsListViewer;
-
- private Group pkJoinColumnsGroup;
- Button overrideDefaultJoinColumnsCheckBox;
- private Button pkJoinColumnsRemoveButton;
- private Button pkJoinColumnsEditButton;
-
-
- public PrimaryKeyJoinColumnsComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.entityListener = buildEntityListener();
- this.pkJoinColumnListener = buildPkJoinColumnListener();
- }
-
- private Adapter buildEntityListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- entityChanged(notification);
- }
- };
- }
-
- private Adapter buildPkJoinColumnListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- pkJoinColumnChanged(notification);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- GridData gridData = new GridData();
- this.overrideDefaultJoinColumnsCheckBox = getWidgetFactory().createButton(
- composite,
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns,
- SWT.CHECK);
- this.overrideDefaultJoinColumnsCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (PrimaryKeyJoinColumnsComposite.this.overrideDefaultJoinColumnsCheckBox.getSelection()) {
- IPrimaryKeyJoinColumn defaultJoinColumn = PrimaryKeyJoinColumnsComposite.this.entity.getDefaultPrimaryKeyJoinColumns().get(0);
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
-
- IPrimaryKeyJoinColumn pkJoinColumn = PrimaryKeyJoinColumnsComposite.this.entity.createPrimaryKeyJoinColumn(0);
- PrimaryKeyJoinColumnsComposite.this.entity.getSpecifiedPrimaryKeyJoinColumns().add(pkJoinColumn);
- pkJoinColumn.setSpecifiedName(columnName);
- pkJoinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- } else {
- PrimaryKeyJoinColumnsComposite.this.entity.getSpecifiedPrimaryKeyJoinColumns().clear();
- }
- }
- });
-
- this.pkJoinColumnsGroup =
- getWidgetFactory().createGroup(
- composite,
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_primaryKeyJoinColumn);
- this.pkJoinColumnsGroup.setLayout(new GridLayout(2, false));
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalSpan = 2;
- this.pkJoinColumnsGroup.setLayoutData(gridData);
-
- this.pkJoinColumnsListViewer = new ListViewer(this.pkJoinColumnsGroup, SWT.BORDER | SWT.MULTI);
- this.pkJoinColumnsListViewer.setContentProvider(buildJoinColumnsListContentProvider());
- this.pkJoinColumnsListViewer.setLabelProvider(buildJoinColumnsListLabelProvider());
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.verticalSpan = 3;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- this.pkJoinColumnsListViewer.getList().setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.pkJoinColumnsListViewer.getList(), IJpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS);
-
- Button addJoinColumnButton = new Button(this.pkJoinColumnsGroup, SWT.NONE);
- addJoinColumnButton.setText(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_add);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- addJoinColumnButton.setLayoutData(gridData);
- addJoinColumnButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- addPrimaryKeyJoinColumn();
- }
- });
-
- this.pkJoinColumnsEditButton = new Button(this.pkJoinColumnsGroup, SWT.NONE);
- this.pkJoinColumnsEditButton.setText(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_edit);
- this.pkJoinColumnsEditButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- editPrimaryKeyJoinColumn();
- }
- });
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- this.pkJoinColumnsEditButton.setLayoutData(gridData);
-
- this.pkJoinColumnsRemoveButton = new Button(this.pkJoinColumnsGroup, SWT.NONE);
- this.pkJoinColumnsRemoveButton.setText(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_remove);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- this.pkJoinColumnsRemoveButton.setLayoutData(gridData);
- this.pkJoinColumnsRemoveButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- removePrimaryKeyJoinColumn();
- }
- });
-
- this.pkJoinColumnsListViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updatePrimaryKeyJoinColumnsEnablement();
- }
- });
- }
-
- private IContentProvider buildJoinColumnsListContentProvider() {
- return new IStructuredContentProvider(){
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object inputElement) {
- return ((IEntity) inputElement).getPrimaryKeyJoinColumns().toArray();
- }
- };
- }
-
- private ILabelProvider buildJoinColumnsListLabelProvider() {
- return new LabelProvider() {
- public String getText(Object element) {
- IPrimaryKeyJoinColumn joinColumn = (IPrimaryKeyJoinColumn) element;
- return (PrimaryKeyJoinColumnsComposite.this.entity.containsSpecifiedPrimaryKeyJoinColumns()) ?
- buildJoinColumnLabel(joinColumn)
- :
- buildDefaultJoinColumnLabel(joinColumn);
- }
- };
- }
-
- String buildDefaultJoinColumnLabel(IPrimaryKeyJoinColumn joinColumn) {
- return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsDefault, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
-
- String buildJoinColumnLabel(IPrimaryKeyJoinColumn joinColumn) {
- if (joinColumn.getSpecifiedName() == null) {
- if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsBothDefault, joinColumn.getName(),joinColumn.getReferencedColumnName());
- }
- return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsFirstDefault, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
- else if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsSecDefault, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
- else {
- return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParams, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
- }
-
-
- void addPrimaryKeyJoinColumn() {
- PrimaryKeyJoinColumnDialog dialog = new PrimaryKeyJoinColumnDialog(this.getControl().getShell(), this.entity);
- addJoinColumnFromDialog(dialog);
- }
-
- private void addJoinColumnFromDialog(PrimaryKeyJoinColumnDialog dialog) {
- if (dialog.open() == Window.OK) {
- int index = this.entity.getSpecifiedPrimaryKeyJoinColumns().size();
- String name = dialog.getSelectedName();
- String referencedColumnName = dialog.getReferencedColumnName();
- IPrimaryKeyJoinColumn joinColumn = this.entity.createPrimaryKeyJoinColumn(index);
- this.entity.getSpecifiedPrimaryKeyJoinColumns().add(joinColumn);
- joinColumn.setSpecifiedName(name);
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- }
- }
-
- private IPrimaryKeyJoinColumn getSelectedJoinColumn() {
- return (IPrimaryKeyJoinColumn) ((StructuredSelection) this.pkJoinColumnsListViewer.getSelection()).getFirstElement();
- }
-
- void editPrimaryKeyJoinColumn() {
- IPrimaryKeyJoinColumn joinColumn = getSelectedJoinColumn();
- PrimaryKeyJoinColumnDialog dialog = new PrimaryKeyJoinColumnDialog(this.getControl().getShell(), joinColumn);
- editJoinColumnFromDialog(dialog, joinColumn);
- }
-
- private void editJoinColumnFromDialog(PrimaryKeyJoinColumnDialog dialog, IPrimaryKeyJoinColumn joinColumn) {
- if (dialog.open() == Window.OK) {
- editJoinColumnDialogOkd(dialog, joinColumn);
- }
- }
-
- private void editJoinColumnDialogOkd(PrimaryKeyJoinColumnDialog dialog, IPrimaryKeyJoinColumn joinColumn) {
- String name = dialog.getSelectedName();
- String referencedColumnName = dialog.getReferencedColumnName();
-
- if (dialog.isDefaultNameSelected()) {
- if (joinColumn.getSpecifiedName() != null) {
- joinColumn.setSpecifiedName(null);
- }
- }
- else if (joinColumn.getSpecifiedName() == null || !joinColumn.getSpecifiedName().equals(name)){
- joinColumn.setSpecifiedName(name);
- }
-
- if (dialog.isDefaultReferencedColumnNameSelected()) {
- if (joinColumn.getSpecifiedReferencedColumnName() != null) {
- joinColumn.setSpecifiedReferencedColumnName(null);
- }
- }
- else if (joinColumn.getSpecifiedReferencedColumnName() == null || !joinColumn.getSpecifiedReferencedColumnName().equals(referencedColumnName)){
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- }
- }
-
- void removePrimaryKeyJoinColumn() {
- ISelection selection = this.pkJoinColumnsListViewer.getSelection();
- if (selection instanceof StructuredSelection) {
- for (Iterator i = ((StructuredSelection) selection).iterator(); i.hasNext(); ) {
- this.entity.getPrimaryKeyJoinColumns().remove(i.next());
- }
- }
- }
-
- void updatePrimaryKeyJoinColumnsEnablement() {
- boolean groupEnabledState = this.entity.containsSpecifiedPrimaryKeyJoinColumns();
- enableGroup(this.pkJoinColumnsGroup, groupEnabledState);
-
- this.pkJoinColumnsRemoveButton.setEnabled(groupEnabledState && !((StructuredSelection) this.pkJoinColumnsListViewer.getSelection()).isEmpty());
- this.pkJoinColumnsEditButton.setEnabled(groupEnabledState && ((StructuredSelection) this.pkJoinColumnsListViewer.getSelection()).size() == 1);
- }
-
- private void enableGroup(Group group, boolean enabled) {
- group.setEnabled(enabled);
- for (int i = 0; i < group.getChildren().length; i++) {
- group.getChildren()[i].setEnabled(enabled);
- }
- }
-
-
- public void doPopulate(EObject obj) {
- this.entity = (IEntity) obj;
- if (this.entity == null) {
- this.pkJoinColumnsListViewer.setInput(null);
- return;
- }
-
- this.pkJoinColumnsListViewer.setInput(this.entity);
-
-
- updatePrimaryKeyJoinColumnsEnablement();
- this.overrideDefaultJoinColumnsCheckBox.setSelection(this.entity.containsSpecifiedPrimaryKeyJoinColumns());
- }
-
- @Override
- protected void doPopulate() {
- }
-
- protected void engageListeners() {
- if (this.entity != null) {
- this.entity.eAdapters().add(this.entityListener);
- for (IPrimaryKeyJoinColumn pkJoinColumn : this.entity.getPrimaryKeyJoinColumns()) {
- pkJoinColumn.eAdapters().add(this.pkJoinColumnListener);
- }
- //this.addConnectionListener();
- }
- }
-
- protected void disengageListeners() {
- if (this.entity != null) {
- //this.removeConnectionListener();
- for (IPrimaryKeyJoinColumn pkJoinColumn : this.entity.getPrimaryKeyJoinColumns()) {
- pkJoinColumn.eAdapters().remove(this.pkJoinColumnListener);
- }
- this.entity.eAdapters().remove(this.entityListener);
- }
- }
-
- protected void entityChanged(Notification notification) {
- if (notification.getFeatureID(IEntity.class) == JpaCoreMappingsPackage.IENTITY__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS) {
- if (notification.getEventType() == Notification.ADD) {
- ((IPrimaryKeyJoinColumn) notification.getNewValue()).eAdapters().add(this.pkJoinColumnListener);
- }
- else if (notification.getEventType() == Notification.REMOVE) {
- ((IPrimaryKeyJoinColumn) notification.getOldValue()).eAdapters().remove(this.pkJoinColumnListener);
- }
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- pkJoinColumnsListViewer.refresh();
- overrideDefaultJoinColumnsCheckBox.setSelection(entity.containsSpecifiedPrimaryKeyJoinColumns());
- updatePrimaryKeyJoinColumnsEnablement();
- }
- });
- }
- }
-
- protected void pkJoinColumnChanged(Notification notification) {
- if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME
- || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME
- || notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME
- || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- pkJoinColumnsListViewer.refresh();
- }
- });
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java
deleted file mode 100644
index 3afc54702d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.INamedColumn;
-import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.mappings.ISecondaryTable;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class PrimaryKeyJoinColumnsInSecondaryTableComposite extends BaseJpaComposite
-{
- private ISecondaryTable secondaryTable;
- private final Adapter secondaryTableListener;
- private final Adapter pkJoinColumnListener;
-
- ListViewer pkJoinColumnsListViewer;
-
- private Group pkJoinColumnsGroup;
- Button overrideDefaultJoinColumnsCheckBox;
- private Button pkJoinColumnsAddButton;
- private Button pkJoinColumnsRemoveButton;
- private Button pkJoinColumnsEditButton;
-
-
- public PrimaryKeyJoinColumnsInSecondaryTableComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.secondaryTableListener = buildSecondaryTableListener();
- this.pkJoinColumnListener = buildPkJoinColumnListener();
- }
-
- private Adapter buildSecondaryTableListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- secondaryTableChanged(notification);
- }
- };
- }
-
- private Adapter buildPkJoinColumnListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- pkJoinColumnChanged(notification);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- GridData gridData = new GridData();
- this.overrideDefaultJoinColumnsCheckBox = getWidgetFactory().createButton(
- composite,
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns,
- SWT.CHECK);
- this.overrideDefaultJoinColumnsCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (PrimaryKeyJoinColumnsInSecondaryTableComposite.this.overrideDefaultJoinColumnsCheckBox.getSelection()) {
- IPrimaryKeyJoinColumn defaultJoinColumn = PrimaryKeyJoinColumnsInSecondaryTableComposite.this.secondaryTable.getDefaultPrimaryKeyJoinColumns().get(0);
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
-
- IPrimaryKeyJoinColumn pkJoinColumn = PrimaryKeyJoinColumnsInSecondaryTableComposite.this.secondaryTable.createPrimaryKeyJoinColumn(0);
- PrimaryKeyJoinColumnsInSecondaryTableComposite.this.secondaryTable.getSpecifiedPrimaryKeyJoinColumns().add(pkJoinColumn);
- pkJoinColumn.setSpecifiedName(columnName);
- pkJoinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- } else {
- PrimaryKeyJoinColumnsInSecondaryTableComposite.this.secondaryTable.getSpecifiedPrimaryKeyJoinColumns().clear();
- }
- }
- });
-
- this.pkJoinColumnsGroup =
- getWidgetFactory().createGroup(
- composite,
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_primaryKeyJoinColumn);
- this.pkJoinColumnsGroup.setLayout(new GridLayout(2, false));
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalSpan = 2;
- this.pkJoinColumnsGroup.setLayoutData(gridData);
-
- this.pkJoinColumnsListViewer = new ListViewer(this.pkJoinColumnsGroup, SWT.BORDER | SWT.MULTI);
- this.pkJoinColumnsListViewer.setContentProvider(buildJoinColumnsListContentProvider());
- this.pkJoinColumnsListViewer.setLabelProvider(buildJoinColumnsListLabelProvider());
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.verticalSpan = 3;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- this.pkJoinColumnsListViewer.getList().setLayoutData(gridData);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.pkJoinColumnsListViewer.getList(), IJpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS);
-
- this.pkJoinColumnsAddButton = new Button(this.pkJoinColumnsGroup, SWT.NONE);
- this.pkJoinColumnsAddButton.setText(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_add);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- this.pkJoinColumnsAddButton.setLayoutData(gridData);
- this.pkJoinColumnsAddButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- addPrimaryKeyJoinColumn();
- }
- });
-
- this.pkJoinColumnsEditButton = new Button(this.pkJoinColumnsGroup, SWT.NONE);
- this.pkJoinColumnsEditButton.setText(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_edit);
- this.pkJoinColumnsEditButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- editPrimaryKeyJoinColumn();
- }
- });
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- this.pkJoinColumnsEditButton.setLayoutData(gridData);
-
- this.pkJoinColumnsRemoveButton = new Button(this.pkJoinColumnsGroup, SWT.NONE);
- this.pkJoinColumnsRemoveButton.setText(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_remove);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- this.pkJoinColumnsRemoveButton.setLayoutData(gridData);
- this.pkJoinColumnsRemoveButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- removePrimaryKeyJoinColumn();
- }
- });
-
- this.pkJoinColumnsListViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updatePrimaryKeyJoinColumnsEnablement();
- }
- });
- }
-
- private IContentProvider buildJoinColumnsListContentProvider() {
- return new IStructuredContentProvider(){
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object inputElement) {
- return ((ISecondaryTable) inputElement).getPrimaryKeyJoinColumns().toArray();
- }
- };
- }
-
- private ILabelProvider buildJoinColumnsListLabelProvider() {
- return new LabelProvider() {
- public String getText(Object element) {
- IPrimaryKeyJoinColumn joinColumn = (IPrimaryKeyJoinColumn) element;
- return (PrimaryKeyJoinColumnsInSecondaryTableComposite.this.secondaryTable.containsSpecifiedPrimaryKeyJoinColumns()) ?
- buildJoinColumnLabel(joinColumn)
- :
- buildDefaultJoinColumnLabel(joinColumn);
- }
- };
- }
-
- String buildDefaultJoinColumnLabel(IPrimaryKeyJoinColumn joinColumn) {
- return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsDefault, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
-
- String buildJoinColumnLabel(IPrimaryKeyJoinColumn joinColumn) {
- if (joinColumn.getSpecifiedName() == null) {
- if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsBothDefault, joinColumn.getName(),joinColumn.getReferencedColumnName());
- }
- return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsFirstDefault, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
- else if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsSecDefault, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
- else {
- return NLS.bind(JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParams, joinColumn.getName(), joinColumn.getReferencedColumnName());
- }
- }
-
-
- void addPrimaryKeyJoinColumn() {
- PrimaryKeyJoinColumnInSecondaryTableDialog dialog = new PrimaryKeyJoinColumnInSecondaryTableDialog(this.getControl().getShell(), this.secondaryTable);
- addJoinColumnFromDialog(dialog);
- }
-
- private void addJoinColumnFromDialog(PrimaryKeyJoinColumnInSecondaryTableDialog dialog) {
- if (dialog.open() == Window.OK) {
- int index = this.secondaryTable.getSpecifiedPrimaryKeyJoinColumns().size();
- String name = dialog.getSelectedName();
- String referencedColumnName = dialog.getReferencedColumnName();
- IPrimaryKeyJoinColumn joinColumn = this.secondaryTable.createPrimaryKeyJoinColumn(index);
- this.secondaryTable.getSpecifiedPrimaryKeyJoinColumns().add(joinColumn);
- joinColumn.setSpecifiedName(name);
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- }
- }
-
- private IPrimaryKeyJoinColumn getSelectedJoinColumn() {
- return (IPrimaryKeyJoinColumn) ((StructuredSelection) this.pkJoinColumnsListViewer.getSelection()).getFirstElement();
- }
-
- void editPrimaryKeyJoinColumn() {
- IPrimaryKeyJoinColumn joinColumn = getSelectedJoinColumn();
- PrimaryKeyJoinColumnInSecondaryTableDialog dialog = new PrimaryKeyJoinColumnInSecondaryTableDialog(this.getControl().getShell(), joinColumn);
- editJoinColumnFromDialog(dialog, joinColumn);
- }
-
- private void editJoinColumnFromDialog(PrimaryKeyJoinColumnInSecondaryTableDialog dialog, IPrimaryKeyJoinColumn joinColumn) {
- if (dialog.open() == Window.OK) {
- editJoinColumnDialogOkd(dialog, joinColumn);
- }
- }
-
- private void editJoinColumnDialogOkd(PrimaryKeyJoinColumnInSecondaryTableDialog dialog, IPrimaryKeyJoinColumn joinColumn) {
- String name = dialog.getSelectedName();
- String referencedColumnName = dialog.getReferencedColumnName();
-
- if (dialog.isDefaultNameSelected()) {
- if (joinColumn.getSpecifiedName() != null) {
- joinColumn.setSpecifiedName(null);
- }
- }
- else if (joinColumn.getSpecifiedName() == null || !joinColumn.getSpecifiedName().equals(name)){
- joinColumn.setSpecifiedName(name);
- }
-
- if (dialog.isDefaultReferencedColumnNameSelected()) {
- if (joinColumn.getSpecifiedReferencedColumnName() != null) {
- joinColumn.setSpecifiedReferencedColumnName(null);
- }
- }
- else if (joinColumn.getSpecifiedReferencedColumnName() == null || !joinColumn.getSpecifiedReferencedColumnName().equals(referencedColumnName)){
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- }
- }
-
- void removePrimaryKeyJoinColumn() {
- ISelection selection = this.pkJoinColumnsListViewer.getSelection();
- if (selection instanceof StructuredSelection) {
- for (Iterator i = ((StructuredSelection) selection).iterator(); i.hasNext(); ) {
- this.secondaryTable.getPrimaryKeyJoinColumns().remove(i.next());
- }
- }
- }
-
- void updatePrimaryKeyJoinColumnsEnablement() {
- boolean groupEnabledState = this.secondaryTable.containsSpecifiedPrimaryKeyJoinColumns();
- enableGroup(this.pkJoinColumnsGroup, groupEnabledState);
-
- this.pkJoinColumnsRemoveButton.setEnabled(groupEnabledState && !((StructuredSelection) this.pkJoinColumnsListViewer.getSelection()).isEmpty());
- this.pkJoinColumnsEditButton.setEnabled(groupEnabledState && ((StructuredSelection) this.pkJoinColumnsListViewer.getSelection()).size() == 1);
- }
-
- private void enableGroup(Group group, boolean enabled) {
- group.setEnabled(enabled);
- for (int i = 0; i < group.getChildren().length; i++) {
- group.getChildren()[i].setEnabled(enabled);
- }
- }
-
-
- public void doPopulate(EObject obj) {
- this.secondaryTable = (ISecondaryTable) obj;
- if (this.secondaryTable == null) {
- this.pkJoinColumnsListViewer.setInput(null);
- return;
- }
-
- this.pkJoinColumnsListViewer.setInput(this.secondaryTable);
-
-
- updatePrimaryKeyJoinColumnsEnablement();
- this.overrideDefaultJoinColumnsCheckBox.setSelection(this.secondaryTable.containsSpecifiedPrimaryKeyJoinColumns());
- }
-
- @Override
- protected void doPopulate() {
- }
-
- protected void engageListeners() {
- if (this.secondaryTable != null) {
- this.secondaryTable.eAdapters().add(this.secondaryTableListener);
- for (IPrimaryKeyJoinColumn pkJoinColumn : this.secondaryTable.getPrimaryKeyJoinColumns()) {
- pkJoinColumn.eAdapters().add(this.pkJoinColumnListener);
- }
- }
- }
-
- protected void disengageListeners() {
- if (this.secondaryTable != null) {
- for (IPrimaryKeyJoinColumn pkJoinColumn : this.secondaryTable.getPrimaryKeyJoinColumns()) {
- pkJoinColumn.eAdapters().remove(this.pkJoinColumnListener);
- }
- this.secondaryTable.eAdapters().remove(this.secondaryTableListener);
- }
- }
-
- protected void secondaryTableChanged(Notification notification) {
- if (notification.getFeatureID(ISecondaryTable.class) == JpaCoreMappingsPackage.ISECONDARY_TABLE__SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS) {
- if (notification.getEventType() == Notification.ADD) {
- ((IPrimaryKeyJoinColumn) notification.getNewValue()).eAdapters().add(this.pkJoinColumnListener);
- }
- else if (notification.getEventType() == Notification.REMOVE) {
- ((IPrimaryKeyJoinColumn) notification.getOldValue()).eAdapters().remove(this.pkJoinColumnListener);
- }
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- pkJoinColumnsListViewer.refresh();
- overrideDefaultJoinColumnsCheckBox.setSelection(secondaryTable.containsSpecifiedPrimaryKeyJoinColumns());
- updatePrimaryKeyJoinColumnsEnablement();
- }
- });
- }
- }
-
- protected void pkJoinColumnChanged(Notification notification) {
- if (notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__SPECIFIED_NAME
- || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__SPECIFIED_REFERENCED_COLUMN_NAME
- || notification.getFeatureID(INamedColumn.class) == JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME
- || notification.getFeatureID(IAbstractJoinColumn.class) == JpaCoreMappingsPackage.IABSTRACT_JOIN_COLUMN__DEFAULT_REFERENCED_COLUMN_NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- pkJoinColumnsListViewer.refresh();
- }
- });
- }
- }
-
- protected void enableWidgets(boolean enabled) {
- this.pkJoinColumnsListViewer.getControl().setEnabled(enabled);
- this.overrideDefaultJoinColumnsCheckBox.setEnabled(enabled);
- this.pkJoinColumnsEditButton.setEnabled(enabled);
- this.pkJoinColumnsRemoveButton.setEnabled(enabled);
- this.pkJoinColumnsAddButton.setEnabled(enabled);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SchemaCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SchemaCombo.java
deleted file mode 100644
index 9655c2202a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SchemaCombo.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.ITable;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.db.internal.Connection;
-import org.eclipse.jpt.db.internal.ConnectionListener;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.Database;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class SchemaCombo extends BaseJpaController
-{
- private ITable table;
-
- private Adapter listener;
-
- /**
- * Caching the connectionProfile so we can remove the listener. If the
- * cached table object has been removed from the model then we no longer
- * have access to the parent and cannot find the connectionProfile
- */
- private ConnectionProfile connectionProfile;
-
- private ConnectionListener connectionListener;
-
- private CCombo combo;
-
- public SchemaCombo(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- this.listener = this.buildTableListener();
- this.connectionListener = this.buildConnectionListener();
- }
-
- private Adapter buildTableListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- SchemaCombo.this.schemaChanged(notification);
- }
- };
- }
-
- private ConnectionListener buildConnectionListener() {
- return new ConnectionListener() {
- public void aboutToClose(Connection connection) {
- // not interested to this event.
- }
-
- public void closed(Connection connection) {
- getCombo().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- SchemaCombo.this.populateShemaCombo();
- }
- });
- }
-
- public void modified(Connection connection) {
- getCombo().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- SchemaCombo.this.populateShemaCombo();
- }
- });
- }
-
- public boolean okToClose(Connection connection) {
- // not interested to this event.
- return true;
- }
-
- public void opened(Connection connection) {
- getCombo().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- SchemaCombo.this.populateShemaCombo();
- }
- });
- }
-
- public void databaseChanged(Connection connection, final Database database) {
- getControl().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (database == SchemaCombo.this.getDatabase()) {
- if (!getControl().isDisposed()) {
- SchemaCombo.this.populateShemaCombo();
- }
- }
- }
- });
- }
-
- public void schemaChanged(Connection connection, final Schema schema) {
- getControl().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (schema == SchemaCombo.this.getTableSchema()) {
- if (!getControl().isDisposed()) {
- SchemaCombo.this.populateShemaCombo();
- }
- }
- }
- });
- }
-
- public void tableChanged(Connection connection, final Table table) {
- // not interested to this event.
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- this.combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- this.combo.add(JptUiMappingsMessages.TableComposite_defaultEmpty);
- this.combo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String schemaText = ((CCombo) e.getSource()).getText();
- if (schemaText.equals("")) { //$NON-NLS-1$
- schemaText = null;
- if (SchemaCombo.this.table.getSpecifiedSchema() == null || SchemaCombo.this.table.getSpecifiedSchema().equals("")) { //$NON-NLS-1$
- return;
- }
- }
- if (schemaText != null && combo.getItemCount() > 0 && schemaText.equals(combo.getItem(0))) {
- schemaText = null;
- }
- if (SchemaCombo.this.table.getSpecifiedSchema() == null && schemaText != null) {
- SchemaCombo.this.table.setSpecifiedSchema(schemaText);
- }
- if (SchemaCombo.this.table.getSpecifiedSchema() != null && !SchemaCombo.this.table.getSpecifiedSchema().equals(schemaText)) {
- SchemaCombo.this.table.setSpecifiedSchema(schemaText);
- }
- }
- });
- }
-
- protected void schemaChanged(Notification notification) {
- if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- SchemaCombo.this.populateSchemaName();
- }
- });
- }
- else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- SchemaCombo.this.populateDefaultSchemaName();
- }
- });
- }
- else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_CATALOG) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- SchemaCombo.this.populateShemaCombo();
- }
- });
- }
- else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_CATALOG) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- SchemaCombo.this.populateShemaCombo();
- }
- });
- }
- }
-
- public void doPopulate(EObject obj) {
- this.table = (ITable) obj;
- if (this.table != null) {
- this.populateShemaCombo();
- }
- else {
- this.connectionProfile = null;
- }
- }
-
- public void doPopulate() {
- this.populateShemaCombo();
- }
-
- protected Database getDatabase() {
- return this.getConnectionProfile().getDatabase();
- }
-
- private ConnectionProfile getConnectionProfile() {
- if (this.connectionProfile == null) {
- this.connectionProfile = this.table.getJpaProject().connectionProfile();
- }
- return this.connectionProfile;
- }
-
- private void populateShemaCombo() {
- if (this.table == null) {
- return;
- }
- this.populateDefaultSchemaName();
- if (this.getConnectionProfile().isConnected()) {
- this.combo.remove(1, this.combo.getItemCount() - 1);
- Database database = this.getDatabase();
- if (database != null) {
- Iterator<String> schemata = database.schemaNames();
- for (Iterator<String> stream = CollectionTools.sort(schemata); stream.hasNext();) {
- this.combo.add(stream.next());
- }
- }
- }
- else {
- this.combo.remove(1, this.combo.getItemCount() - 1);
- }
- this.populateSchemaName();
- }
-
- protected void populateDefaultSchemaName() {
- String defaultSchemaName = this.table.getDefaultSchema();
- int selectionIndex = combo.getSelectionIndex();
- combo.setItem(0, NLS.bind(JptUiMappingsMessages.TableComposite_defaultWithOneParam, defaultSchemaName));
- if (selectionIndex == 0) {
- combo.clearSelection();
- combo.select(0);
- }
- }
-
- protected void populateSchemaName() {
- if (this.table == null) {
- return;
- }
- String schemaName = this.table.getSpecifiedSchema();
- String defaultSchemaName = this.table.getDefaultSchema();
- if (!StringTools.stringIsEmpty(schemaName)) {
- if (!this.combo.getText().equals(schemaName)) {
- this.combo.setText(schemaName);
- }
- }
- else {
- if (!this.combo.getText().equals(NLS.bind(JptUiMappingsMessages.TableComposite_defaultWithOneParam, defaultSchemaName))) {
- this.combo.select(0);
- }
- }
- }
-
- public CCombo getCombo() {
- return this.combo;
- }
-
- @Override
- public Control getControl() {
- return getCombo();
- }
-
- protected Schema getTableSchema() {
- return this.getConnectionProfile().getDatabase().schemaNamed(table.getSchema());
- }
-
- @Override
- protected void disengageListeners() {
- if (this.table != null) {
- this.removeConnectionListener();
- this.table.eAdapters().remove(this.listener);
- }
- }
-
- @Override
- protected void engageListeners() {
- if (this.table != null) {
- this.table.eAdapters().add(this.listener);
- this.addConnectionListener();
- }
- }
-
- private void addConnectionListener() {
- this.getConnectionProfile().addConnectionListener(this.connectionListener);
- }
-
- private void removeConnectionListener() {
- this.getConnectionProfile().removeConnectionListener(this.connectionListener);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTableDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTableDialog.java
deleted file mode 100644
index 14be07b492..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTableDialog.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.core.internal.mappings.IEntity;
-import org.eclipse.jpt.core.internal.mappings.ISecondaryTable;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.Database;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-public class SecondaryTableDialog extends Dialog {
-
- //if creating a new JoinColumn, this will be null,
- //specify the JoinColumnOwner instead in the appropriate construtor
- private ISecondaryTable secondaryTable;
- private IEntity entity;
-
- protected Combo nameCombo;
- protected Combo catalogCombo;
- protected Combo schemaCombo;
-
- private String selectedName;
- private String selectedSchema;
- private String selectedCatalog;
-
- private boolean defaultSchemaSelected;
- private boolean defaultCatalogSelected;
-
- SecondaryTableDialog(Shell parent, IEntity entity) {
- super(parent);
- this.entity = entity;
- }
-
- SecondaryTableDialog(Shell parent, ISecondaryTable secondaryTable, IEntity entity) {
- super(parent);
- this.secondaryTable = secondaryTable;
- this.entity = entity;
- }
-
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(getTitle());
- }
-
- protected String getTitle() {
- return JptUiMappingsMessages.SecondaryTableDialog_editSecondaryTable;
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout gridLayout = (GridLayout) composite.getLayout();
- gridLayout.numColumns = 2;
-
- Label nameLabel = new Label(composite, SWT.LEFT);
- nameLabel.setText(JptUiMappingsMessages.SecondaryTableDialog_name);
- GridData gridData = new GridData();
- nameLabel.setLayoutData(gridData);
-
- this.nameCombo = new Combo(composite, SWT.LEFT);
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.nameCombo.setLayoutData(gridData);
- populateNameCombo();
-
- Label catalogLabel = new Label(composite, SWT.LEFT);
- catalogLabel.setText(JptUiMappingsMessages.SecondaryTableDialog_catalog);
- gridData = new GridData();
- catalogLabel.setLayoutData(gridData);
-
- this.catalogCombo = new Combo(composite, SWT.LEFT);
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.catalogCombo.setLayoutData(gridData);
- populateCatalogCombo();
-
- Label schemaLabel = new Label(composite, SWT.LEFT);
- schemaLabel.setText(JptUiMappingsMessages.SecondaryTableDialog_schema);
- gridData = new GridData();
- schemaLabel.setLayoutData(gridData);
-
- this.schemaCombo = new Combo(composite, SWT.LEFT);
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.schemaCombo.setLayoutData(gridData);
- populateSchemaCombo();
-
- return composite;
- }
-
- protected Database getDatabase() {
- return this.getConnectionProfile().getDatabase();
- }
-
- private ConnectionProfile getConnectionProfile() {
- IJpaProject project = (this.secondaryTable == null) ? this.entity.getJpaProject() : this.secondaryTable.getJpaProject();
- return project.connectionProfile();
- }
-
- protected Schema getTableSchema() {
- Database database = this.getDatabase();
- if (database != null) {
- if (this.secondaryTable != null) {
- return database.schemaNamed(this.secondaryTable.getSchema());
- }
- return database.schemaNamed(this.entity.getTable().getSchema());
- }
- return null;
- }
-
- protected void populateNameCombo() {
- Schema schema = this.getTableSchema();
- if (schema != null) {
- Iterator<String> tables = schema.tableNames();
- for (Iterator<String> stream = CollectionTools.sort( tables); stream.hasNext(); ) {
- this.nameCombo.add(stream.next());
- }
- }
-
- if (getSecondaryTable() != null) {
- if (getSecondaryTable().getSpecifiedName() != null) {
- this.nameCombo.setText(getSecondaryTable().getSpecifiedName());
- }
- }
- }
-
- protected void populateSchemaCombo() {
- if (getSecondaryTable() != null) {
- this.schemaCombo.add(NLS.bind(JptUiMappingsMessages.SecondaryTableDialog_defaultSchema, getSecondaryTable().getDefaultSchema()));
- }
-
- Database database = this.getDatabase();
-
- if (database != null) {
- Iterator<String> schemata = database.schemaNames();
- for (Iterator<String> stream = CollectionTools.sort(schemata); stream.hasNext(); ) {
- this.schemaCombo.add(stream.next());
- }
- }
-
- if (getSecondaryTable() != null) {
- if (getSecondaryTable().getSpecifiedSchema() != null) {
- this.schemaCombo.setText(getSecondaryTable().getSpecifiedSchema());
- }
- else {
- this.schemaCombo.select(0);
- }
- }
- }
-
- protected void populateCatalogCombo() {
- if (getSecondaryTable() != null) {
- this.catalogCombo.add(NLS.bind(JptUiMappingsMessages.SecondaryTableDialog_defaultCatalog, getSecondaryTable().getDefaultCatalog()));
- }
- Database database = this.getDatabase();
-
- if (database != null) {
- Iterator<String> catalogs = database.catalogNames();
- for (Iterator<String> stream = CollectionTools.sort(catalogs); stream.hasNext(); ) {
- this.catalogCombo.add(stream.next());
- }
- }
-
- if (getSecondaryTable() != null) {
- if (getSecondaryTable().getSpecifiedCatalog() != null) {
- this.catalogCombo.setText(getSecondaryTable().getSpecifiedCatalog());
- }
- else {
- this.catalogCombo.select(0);
- }
- }
- }
-
- protected Combo getNameCombo() {
- return this.nameCombo;
- }
-
- protected Combo getSchemaCombo() {
- return this.schemaCombo;
- }
-
- protected Combo getCatalogCombo() {
- return this.catalogCombo;
- }
-
- protected ISecondaryTable getSecondaryTable() {
- return this.secondaryTable;
- }
-
-
- protected String getSelectedName() {
- return this.selectedName;
- }
-
- protected String getSelectedCatalog() {
- return this.selectedCatalog;
- }
-
- protected String getSelectedSchema() {
- return this.selectedSchema;
- }
-
- protected boolean isDefaultSchemaSelected() {
- return this.defaultSchemaSelected;
- }
-
- protected boolean isDefaultCatalogSelected() {
- return this.defaultCatalogSelected;
- }
-
- public boolean close() {
- this.selectedName = this.nameCombo.getText();
- this.selectedSchema = this.schemaCombo.getText();
- if (this.selectedSchema.equals("")) {
- this.selectedSchema = null;
- }
- this.selectedCatalog = this.catalogCombo.getText();
- if (this.selectedCatalog.equals("")) {
- this.selectedCatalog = null;
- }
- this.defaultSchemaSelected = this.schemaCombo.getSelectionIndex() == 0;
- this.defaultCatalogSelected = this.catalogCombo.getSelectionIndex() == 0;
- return super.close();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTablesComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTablesComposite.java
deleted file mode 100644
index 2ff149d987..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTablesComposite.java
+++ /dev/null
@@ -1,382 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.core.internal.mappings.IEntity;
-import org.eclipse.jpt.core.internal.mappings.ISecondaryTable;
-import org.eclipse.jpt.core.internal.mappings.ITable;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-//TODO handle xml, how to handle virtual secondaryTables, adding them to xml, are they overriden, etc??
-public class SecondaryTablesComposite extends BaseJpaComposite
-{
- private IEntity entity;
- private final Adapter entityListener;
- private final Adapter secondaryTableListener;
-
- ListViewer secondaryTablesListViewer;
-
- private Button addButton;
- private Button editButton;
- private Button removeButton;
-
- private PrimaryKeyJoinColumnsInSecondaryTableComposite pkJoinColumnsComposite;
-
- public SecondaryTablesComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- this.entityListener = buildEntityListener();
- this.secondaryTableListener = buildSecondaryTableListener();
- }
-
- private Adapter buildEntityListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- entityChanged(notification);
- }
- };
- }
-
- private Adapter buildSecondaryTableListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- seoncaryTableChanged(notification);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- GridData gridData = new GridData();
-
- Composite secondaryTablesComposite = new Composite(composite, SWT.NONE);
- layout = new GridLayout(3, false);
- layout.marginWidth = 0;
- secondaryTablesComposite.setLayout(layout);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- secondaryTablesComposite.setLayoutData(gridData);
-
- this.secondaryTablesListViewer = buildSecondaryTablesListViewer(secondaryTablesComposite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.horizontalSpan = 3;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- this.secondaryTablesListViewer.getList().setLayoutData(gridData);
- //PlatformUI.getWorkbench().getHelpSystem().setHelp(this.secondaryTablesListViewer.getList(), IJpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS);
-
- Composite buttonsComposite = new Composite(secondaryTablesComposite, SWT.NONE);
- layout = new GridLayout(3, false);
- layout.marginWidth = 0;
- buttonsComposite.setLayout(layout);
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.END;
- buttonsComposite.setLayoutData(gridData);
-
- this.addButton = new Button(buttonsComposite, SWT.NONE);
- this.addButton.setText(JptUiMappingsMessages.SecondaryTablesComposite_add);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- this.addButton.setLayoutData(gridData);
- this.addButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- addSecondaryTable();
- }
- });
-
- this.editButton = new Button(buttonsComposite, SWT.NONE);
- this.editButton.setText(JptUiMappingsMessages.SecondaryTablesComposite_edit);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- this.editButton.setLayoutData(gridData);
- this.editButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- editSecondaryTable();
- }
- });
-
- this.removeButton = new Button(buttonsComposite, SWT.NONE);
- this.removeButton.setText(JptUiMappingsMessages.SecondaryTablesComposite_remove);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- this.removeButton.setLayoutData(gridData);
- this.removeButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- removeSecondaryTable();
- }
- });
-
- this.pkJoinColumnsComposite = new PrimaryKeyJoinColumnsInSecondaryTableComposite(composite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- this.pkJoinColumnsComposite.getControl().setLayoutData(gridData);
- }
-
- private ListViewer buildSecondaryTablesListViewer(Composite parent) {
- ListViewer listViewer = new ListViewer(parent, SWT.SINGLE | SWT.BORDER);
- listViewer.setLabelProvider(buildSecondaryTablesListLabelProvider());
- listViewer.setContentProvider(buildSecondaryTablesListContentProvider());
-
- listViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateEnablement();
- secondaryTablesListSelectionChanged(event);
- }
- });
-
- return listViewer;
- }
-
- protected void secondaryTablesListSelectionChanged(SelectionChangedEvent event) {
- if (((StructuredSelection) event.getSelection()).isEmpty()) {
- this.pkJoinColumnsComposite.populate(null);
- this.pkJoinColumnsComposite.enableWidgets(false);
- }
- else {
- ISecondaryTable selectedSecondaryTable = getSelectedSecondaryTable();
- this.pkJoinColumnsComposite.populate(selectedSecondaryTable);
- this.pkJoinColumnsComposite.enableWidgets(true);
- }
- }
-
- private IContentProvider buildSecondaryTablesListContentProvider() {
- return new IStructuredContentProvider(){
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object inputElement) {
- return ((IEntity) inputElement).getSecondaryTables().toArray();
- }
- };
- }
-
- private ILabelProvider buildSecondaryTablesListLabelProvider() {
- return new LabelProvider() {
- public String getText(Object element) {
- //TODO display a qualified name instead
- ISecondaryTable secondaryTable = (ISecondaryTable) element;
- return secondaryTable.getName();
- }
- };
- }
-
- void addSecondaryTable() {
- SecondaryTableDialog dialog = new SecondaryTableDialog(this.getControl().getShell(), this.entity);
- addSecondaryTableFromDialog(dialog);
- }
-
- private void addSecondaryTableFromDialog(SecondaryTableDialog dialog) {
- if (dialog.open() == Window.OK) {
- int index = this.entity.getSpecifiedSecondaryTables().size();
- String name = dialog.getSelectedName();
- String catalog = dialog.getSelectedCatalog();
- String schema = dialog.getSelectedSchema();
- ISecondaryTable secondaryTable = this.entity.createSecondaryTable(index);
- this.entity.getSpecifiedSecondaryTables().add(secondaryTable);
- secondaryTable.setSpecifiedName(name);
- secondaryTable.setSpecifiedCatalog(catalog);
- secondaryTable.setSpecifiedSchema(schema);
-
- this.secondaryTablesListViewer.setSelection(new StructuredSelection(secondaryTable));
- }
- }
-
- void editSecondaryTable() {
- ISecondaryTable secondaryTable = getSelectedSecondaryTable();
- SecondaryTableDialog dialog = new SecondaryTableDialog(this.getControl().getShell(), secondaryTable, this.entity);
- editSecondaryTableFromDialog(dialog, secondaryTable);
- }
-
- private void editSecondaryTableFromDialog(SecondaryTableDialog dialog, ISecondaryTable secondaryTable) {
- if (dialog.open() == Window.OK) {
- editSecondaryTableDialogOkd(dialog, secondaryTable);
- }
- }
-
- private void editSecondaryTableDialogOkd(SecondaryTableDialog dialog, ISecondaryTable secondaryTable) {
- String name = dialog.getSelectedName();
- String catalog = dialog.getSelectedCatalog();
- String schema = dialog.getSelectedSchema();
-
- if (secondaryTable.getSpecifiedName() == null || !secondaryTable.getSpecifiedName().equals(name)){
- secondaryTable.setSpecifiedName(name);
- }
-
- if (dialog.isDefaultCatalogSelected()) {
- if (secondaryTable.getSpecifiedCatalog() != null) {
- secondaryTable.setSpecifiedCatalog(null);
- }
- }
- else if (secondaryTable.getSpecifiedCatalog() == null || !secondaryTable.getSpecifiedCatalog().equals(catalog)){
- secondaryTable.setSpecifiedCatalog(catalog);
- }
-
- if (dialog.isDefaultSchemaSelected()) {
- if (secondaryTable.getSpecifiedSchema() != null) {
- secondaryTable.setSpecifiedSchema(null);
- }
- }
- else if (secondaryTable.getSpecifiedSchema() == null || !secondaryTable.getSpecifiedSchema().equals(schema)){
- secondaryTable.setSpecifiedSchema(schema);
- }
- }
-
- private ISecondaryTable getSelectedSecondaryTable() {
- return (ISecondaryTable) ((StructuredSelection) this.secondaryTablesListViewer.getSelection()).getFirstElement();
- }
-
-
- void removeSecondaryTable() {
- ISelection selection = this.secondaryTablesListViewer.getSelection();
- if (selection instanceof StructuredSelection) {
- for (Iterator<ISecondaryTable> i = ((StructuredSelection) selection).iterator(); i.hasNext(); ) {
- this.entity.getSpecifiedSecondaryTables().remove(i.next());
- }
- }
- }
-
- void updateEnablement() {
- this.editButton.setEnabled(!((StructuredSelection) this.secondaryTablesListViewer.getSelection()).isEmpty());
- this.removeButton.setEnabled(!((StructuredSelection) this.secondaryTablesListViewer.getSelection()).isEmpty());
- }
-
- public void doPopulate(EObject obj) {
- this.entity = (IEntity) obj;
- if (this.entity == null) {
- this.secondaryTablesListViewer.setInput(null);
- return;
- }
-
- this.secondaryTablesListViewer.setInput(this.entity);
- if (!this.entity.getSecondaryTables().isEmpty()) {
- this.secondaryTablesListViewer.setSelection(new StructuredSelection(this.entity.getSecondaryTables().get(0)));
- }
- else {
- this.secondaryTablesListViewer.setSelection(null);
- }
- updateEnablement();
- }
-
- @Override
- protected void doPopulate() {
- }
-
- protected void engageListeners() {
- if (this.entity != null) {
- this.entity.eAdapters().add(this.entityListener);
- for (ISecondaryTable secondaryTable : this.entity.getSecondaryTables()) {
- secondaryTable.eAdapters().add(this.secondaryTableListener);
- }
- }
- }
-
- protected void disengageListeners() {
- if (this.entity != null) {
- for (ISecondaryTable secondaryTable : this.entity.getSecondaryTables()) {
- secondaryTable.eAdapters().remove(this.secondaryTableListener);
- }
- this.entity.eAdapters().remove(this.entityListener);
- }
- }
-
- protected void entityChanged(Notification notification) {
- if (notification.getFeatureID(IEntity.class) == JpaCoreMappingsPackage.IENTITY__SPECIFIED_SECONDARY_TABLES) {
- if (notification.getEventType() == Notification.ADD) {
- ((ISecondaryTable) notification.getNewValue()).eAdapters().add(this.secondaryTableListener);
- }
- else if (notification.getEventType() == Notification.REMOVE) {
- ((ISecondaryTable) notification.getOldValue()).eAdapters().remove(this.secondaryTableListener);
- }
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- secondaryTablesListViewer.refresh();
- updateEnablement();
- }
- });
- }
- }
-
- protected void seoncaryTableChanged(Notification notification) {
- if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_NAME
- || notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_CATALOG
- || notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA
- || notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_CATALOG
- || notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- secondaryTablesListViewer.refresh();
- }
- });
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SequenceGeneratorComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SequenceGeneratorComposite.java
deleted file mode 100644
index 9be54c3668..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SequenceGeneratorComposite.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.core.internal.mappings.IId;
-import org.eclipse.jpt.core.internal.mappings.ISequenceGenerator;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * SequenceGeneratorComposite
- */
-public class SequenceGeneratorComposite extends GeneratorComposite<ISequenceGenerator>
-{
- private CCombo sequenceNameCombo;
-
- private ModifyListener sequenceNameComboListener;
-
- private ConnectionProfile connectionProfile;
-
- public SequenceGeneratorComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, commandStack, widgetFactory);
- }
-
- protected ISequenceGenerator createGenerator() {
- ISequenceGenerator sequenceGenerator = idMapping().createSequenceGenerator();
- idMapping().setSequenceGenerator(sequenceGenerator);
- return sequenceGenerator;
- }
-
- protected ISequenceGenerator generator(IId idMapping) {
- return idMapping.getSequenceGenerator();
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-
- GridLayout layout = new GridLayout(2, false);
- composite.setLayout(layout);
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.SequenceGeneratorComposite_name);
-
- this.nameTextWidget = buildNameText(composite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.nameTextWidget.setLayoutData(gridData);
- helpSystem.setHelp(this.nameTextWidget, IJpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_NAME);
-
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.SequenceGeneratorComposite_sequence);
-
- this.sequenceNameCombo = buildSequenceNameCombo(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.sequenceNameCombo.setLayoutData(gridData);
- helpSystem.setHelp(sequenceNameCombo, IJpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_SEQUENCE);
- }
-
- private CCombo buildSequenceNameCombo(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- combo.add(""); //$NON-NLS-1$
- combo.select(0);
- combo.addModifyListener(getSequenceNameListener());
- return combo;
- }
-
- private ModifyListener getSequenceNameListener() {
- if (this.sequenceNameComboListener == null) {
- this.sequenceNameComboListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String text = ((CCombo) e.getSource()).getText();
- if (text != null && sequenceNameCombo.getItemCount() > 0 && text.equals(sequenceNameCombo.getItem(0))) {
- text = null;
- }
- ISequenceGenerator generator = getGenerator();
- if (generator == null) {
- generator = createGenerator();
- }
- generator.setSpecifiedSequenceName(text);
- }
- };
- }
- return this.sequenceNameComboListener;
- }
-
- protected void generatorChanged(Notification notification) {
- super.generatorChanged(notification);
- if (notification.getFeatureID(ISequenceGenerator.class) == JpaCoreMappingsPackage.ISEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- String sequenceName = getGenerator().getSpecifiedSequenceName();
- if (sequenceName == null) {
- sequenceNameCombo.select(0);
- }
- else if (!sequenceNameCombo.getText().equals(sequenceName)) {
- sequenceNameCombo.setText(sequenceName);
- }
- }
- });
- }
- }
-
- @Override
- protected void doPopulate(EObject obj) {
- super.doPopulate(obj);
- if (obj == null) {
- return;
- }
- populateSequenceNameCombo();
- }
-
- @Override
- protected void doPopulate() {
- populateSequenceNameCombo();
- }
-
- private ConnectionProfile getConnectionProfile() {
- if(this.connectionProfile == null) {
- IJpaProject jpaProject = getGenerator().getJpaProject();
- this.connectionProfile = jpaProject.connectionProfile();
- }
- return this.connectionProfile;
- }
-
- private void populateSequenceNameCombo() {
- if (this.getGenerator() == null) {
- return;
- }
- this.sequenceNameCombo.setItem(0, JptUiMappingsMessages.SequenceGeneratorComposite_default);
- if (this.getConnectionProfile().isConnected()) {
-// this.sequenceNameCombo.remove(1, this.sequenceNameCombo.getItemCount() - 1);
-// Schema schema = getConnectionProfile().getDatabase().schemaNamed(getGenerator().getJpaProject().getSchemaName());
-// if (schema != null) {
-// for (Iterator stream = CollectionTools.sort(schema.sequenceNames()); stream.hasNext();) {
-// this.sequenceNameCombo.add((String) stream.next());
-// }
-// }
- }
- String sequenceName = this.getGenerator().getSpecifiedSequenceName();
- if (sequenceName != null) {
- if (!this.sequenceNameCombo.getText().equals(sequenceName)) {
- this.sequenceNameCombo.setText(sequenceName);
- }
- }
- else {
- this.sequenceNameCombo.select(0);
- }
- }
-
- protected void clear() {
- super.clear();
- this.sequenceNameCombo.select(0);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/StringWithDefaultChooser.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/StringWithDefaultChooser.java
deleted file mode 100644
index 57c7624201..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/StringWithDefaultChooser.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.widgets.CComboViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class StringWithDefaultChooser extends BaseJpaController
-{
- private StringHolder stringHolder;
- private Adapter stringHolderListener;
-
- private CComboViewer comboViewer;
-
- private static final String DEFAULT = "default";
-
-
- public StringWithDefaultChooser(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- buildStringHolderListener();
- }
-
-
- private void buildStringHolderListener() {
- this.stringHolderListener = new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- stringHolderChanged(notification);
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- this.comboViewer = new CComboViewer(combo);
- this.comboViewer.setContentProvider(buildContentProvider());
- this.comboViewer.setLabelProvider(buildLabelProvider());
-
- this.comboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- StringWithDefaultChooser.this.selectionChanged(event.getSelection());
- }
- });
-
- combo.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- comboModified(e);
- }
- });
- }
-
- private IContentProvider buildContentProvider() {
- return new IStructuredContentProvider(){
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- public void dispose() {
- }
-
- public Object[] getElements(Object inputElement) {
- return new String[] {DEFAULT};
- }
- };
- }
-
-
- private IBaseLabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- if (element == DEFAULT && stringHolder.wrappedObject() != null) {
- return stringHolder.defaultItem();
- }
- return super.getText(element);
- }
- };
- }
- void selectionChanged(ISelection sel) {
- if (isPopulating()) {
- return;
- }
-
- if (sel instanceof IStructuredSelection) {
- String selection = (String) ((IStructuredSelection) sel).getFirstElement();
- if (this.comboViewer.getCombo().getSelectionIndex() == 0) {
- selection = null;
- }
- if (this.stringHolder.getString() == null) {
- if (selection != null) {
- this.stringHolder.setString(selection);
- }
- }
- else if (!this.stringHolder.getString().equals(selection)) {
- this.stringHolder.setString(selection);
- }
- }
- }
-
- private void comboModified(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- CCombo combo = (CCombo) e.getSource();
- combo.getSelectionIndex();
- String text = combo.getText();
-
- if (text != null && combo.getItemCount() > 0 && text.equals(combo.getItem(0))) {
- text = null;
- }
- if (this.stringHolder.getString() != text) {
- this.stringHolder.setString(text);
- }
- }
-
- private void stringHolderChanged(Notification notification) {
- if (notification.getFeatureID(this.stringHolder.featureClass()) ==
- this.stringHolder.featureId()) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- if (getCombo().isDisposed()) {
- return;
- }
- populate();
- }
- });
- }
- else if (this.stringHolder.supportsDefault()) {
- if (notification.getFeatureID(this.stringHolder.featureClass()) ==
- this.stringHolder.defaultFeatureId()) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- if (getCombo().isDisposed()) {
- return;
- }
- populate();
- }
- });
-
- }
- }
- }
-
- @Override
- protected void engageListeners() {
- if (this.stringHolder != null && this.stringHolder.wrappedObject() != null) {
- this.stringHolder.wrappedObject().eAdapters().add(this.stringHolderListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.stringHolder != null && this.stringHolder.wrappedObject() != null) {
- this.stringHolder.wrappedObject().eAdapters().remove(this.stringHolderListener);
- }
- }
-
- @Override
- public void doPopulate(EObject obj) {
- this.stringHolder = (StringHolder) obj;
- this.comboViewer.setInput(this.stringHolder);
- populateCombo();
- }
-
- @Override
- protected void doPopulate() {
- populateCombo();
- }
-
- private void populateCombo() {
- if (this.stringHolder.wrappedObject() == null) {
- this.comboViewer.setSelection(StructuredSelection.EMPTY);
- return;
- }
- this.comboViewer.update(this.comboViewer.getElementAt(0), null);
-
- String string = this.stringHolder.getString();
- if (string == null) {
- if (((StructuredSelection) this.comboViewer.getSelection()).getFirstElement() == DEFAULT) {
- this.comboViewer.refresh();
- }
- else {
- this.comboViewer.setSelection(new StructuredSelection(DEFAULT));
- }
- }
- else {
- if (!this.comboViewer.getCombo().getText().equals(string)) {
- this.comboViewer.getCombo().setText(string);
- }
- }
- }
-
- public CCombo getCombo() {
- return this.comboViewer.getCombo();
- }
-
- @Override
- public Control getControl() {
- return getCombo();
- }
- /**
- * An interface to wrap an object that supports a string with a default setting
- * An object of this type must be passed in to populate(EObject)
- */
- public static interface StringHolder extends EObject {
- /**
- * Return the string setting from the wrapped object
- * @return
- */
- String getString();
-
- /**
- * Set the string setting on the wrapped object
- * @param string
- */
- void setString(String string);
-
- /**
- * Return the Class of the wrapped object
- * @return
- */
- Class featureClass();
-
- /**
- * Return the feature id of string setting on the wrapped object
- * @return
- */
- int featureId();
-
- boolean supportsDefault();
-
- int defaultFeatureId();
-
- /**
- * The wrapped EObject that the enum setting is stored on
- * @return
- */
- EObject wrappedObject();
-
- String defaultItem();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableCombo.java
deleted file mode 100644
index 3304743c00..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableCombo.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.ITable;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.db.internal.Connection;
-import org.eclipse.jpt.db.internal.ConnectionListener;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.Database;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class TableCombo extends BaseJpaController
-{
- private ITable table;
-
- private Adapter listener;
-
- /**
- * Caching the connectionProfile so we can remove the listener. If the
- * cached table object has been removed from the model then we no longer
- * have access to parent and cannot find the connectionProfile
- */
- private ConnectionProfile connectionProfile;
-
- private ConnectionListener connectionListener;
-
- private CCombo combo;
-
- public TableCombo(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- this.listener = buildTableListener();
- this.connectionListener = buildConnectionListener();
- }
-
- private Adapter buildTableListener() {
- return new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- tableChanged(notification);
- }
- };
- }
-
- private ConnectionListener buildConnectionListener() {
- return new ConnectionListener() {
- public void aboutToClose(Connection connection) {
- // not interested to this event.
- }
-
- public void closed(Connection connection) {
- getCombo().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- TableCombo.this.populateTableCombo();
- }
- });
- }
-
- public void modified(Connection connection) {
- getCombo().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- TableCombo.this.populateTableCombo();
- }
- });
- }
-
- public boolean okToClose(Connection connection) {
- // not interested to this event.
- return true;
- }
-
- public void opened(Connection connection) {
- getCombo().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- TableCombo.this.populateTableCombo();
- }
- });
- }
-
- public void databaseChanged(Connection connection, final Database database) {
- getControl().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (database == TableCombo.this.getDatabase()) {
- if (!getControl().isDisposed()) {
- TableCombo.this.populateTableCombo();
- }
- }
- }
- });
- }
-
- public void schemaChanged(Connection connection, final Schema schema) {
- getControl().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (schema == TableCombo.this.getTableSchema()) {
- if (!getControl().isDisposed()) {
- TableCombo.this.populateTableCombo();
- }
- }
- }
- });
- }
-
- public void tableChanged(Connection connection, final Table table) {
- // not interested to this event.
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- this.combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- this.combo.add(JptUiMappingsMessages.TableComposite_defaultEmpty);
- this.combo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String tableText = ((CCombo) e.getSource()).getText();
- if (tableText.equals("")) { //$NON-NLS-1$
- tableText = null;
- if (table.getSpecifiedName() == null || table.getSpecifiedName().equals("")) { //$NON-NLS-1$
- return;
- }
- }
- if (tableText != null && combo.getItemCount() > 0 && tableText.equals(combo.getItem(0))) {
- tableText = null;
- }
- if (table.getSpecifiedName() == null && tableText != null) {
- table.setSpecifiedName(tableText);
- }
- if (table.getSpecifiedName() != null && !table.getSpecifiedName().equals(tableText)) {
- table.setSpecifiedName(tableText);
- }
- }
- });
- }
-
- protected void tableChanged(Notification notification) {
- if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateTableName();
- }
- });
- }
- else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateDefaultTableName();
- }
- });
- }
- else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateTableCombo();
- }
- });
- }
- else if (notification.getFeatureID(ITable.class) == JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateTableCombo();
- }
- });
- }
- }
-
- public void doPopulate(EObject obj) {
- this.table = (ITable) obj;
- if (this.table != null) {
- populateTableCombo();
- }
- else {
- this.connectionProfile = null;
- }
- }
-
- public void doPopulate() {
- if (this.table != null) {
- populateTableCombo();
- }
- }
-
- protected Database getDatabase() {
- return getConnectionProfile().getDatabase();
- }
-
- protected Schema getTableSchema() {
- return getConnectionProfile().getDatabase().schemaNamed(table.getSchema());
- }
-
- private ConnectionProfile getConnectionProfile() {
- if (this.connectionProfile == null) {
- this.connectionProfile = this.table.getJpaProject().connectionProfile();
- }
- return this.connectionProfile;
- }
-
- private void populateTableCombo() {
- if (this.table == null) {
- return;
- }
- // TODO don't do instanceof check here - check on Table, or isRoot check
- // on Entity
- // this.tableCombo.setEnabled(!(this.table instanceof
- // SingleTableInheritanceChildTableImpl));
- populateDefaultTableName();
- if (getConnectionProfile().isConnected()) {
- this.combo.remove(1, this.combo.getItemCount() - 1);
- Schema schema = this.getTableSchema();
- if (schema != null) {
- Iterator<String> tables = schema.tableNames();
- for (Iterator<String> stream = CollectionTools.sort(tables); stream.hasNext();) {
- this.combo.add(stream.next());
- }
- }
- }
- else {
- this.combo.remove(1, this.combo.getItemCount() - 1);
- }
- populateTableName();
- }
-
- protected void populateDefaultTableName() {
- if (this.table == null) {
- return;
- }
- String defaultTableName = table.getDefaultName();
- int selectionIndex = combo.getSelectionIndex();
- combo.setItem(0, NLS.bind(JptUiMappingsMessages.TableComposite_defaultWithOneParam, defaultTableName));
- if (selectionIndex == 0) {
- // combo text does not update when switching between 2 mappings of
- // the same type
- // that both have a default column name. clear the selection and
- // then set it again
- combo.clearSelection();
- combo.select(0);
- }
- }
-
- protected void populateTableName() {
- if (this.table == null) {
- return;
- }
- String tableName = this.table.getSpecifiedName();
- String defaultTableName = this.table.getDefaultName();
- if (tableName != null) {
- if (!this.combo.getText().equals(tableName)) {
- this.combo.setText(tableName);
- }
- }
- else {
- if (!this.combo.getText().equals(NLS.bind(JptUiMappingsMessages.TableComposite_defaultWithOneParam, defaultTableName))) {
- this.combo.select(0);
- }
- }
- }
-
- public CCombo getCombo() {
- return this.combo;
- }
-
- @Override
- public Control getControl() {
- return getCombo();
- }
-
- @Override
- protected void disengageListeners() {
- if (this.table != null) {
- this.removeConnectionListener();
- this.table.eAdapters().remove(this.listener);
- }
- }
-
- @Override
- protected void engageListeners() {
- if (this.table != null) {
- this.table.eAdapters().add(this.listener);
- this.addConnectionListener();
- }
- }
-
- private void addConnectionListener() {
- this.getConnectionProfile().addConnectionListener(this.connectionListener);
- }
-
- private void removeConnectionListener() {
- this.getConnectionProfile().removeConnectionListener(this.connectionListener);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableComposite.java
deleted file mode 100644
index cc6f99ae00..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableComposite.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.mappings.ITable;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-//TODO repopulate this panel based on the Entity table changing
-public class TableComposite extends BaseJpaComposite
-{
- private ITable table;
-
- protected TableCombo tableCombo;
-
- protected CatalogCombo catalogCombo;
- protected SchemaCombo schemaCombo;
-
- public TableComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- Group columnGroup = getWidgetFactory().createGroup(composite, JptUiMappingsMessages.TableComposite_tableSection);
- layout = new GridLayout();
- layout.marginHeight = 0;
- columnGroup.setLayout(layout);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace= true;
- columnGroup.setLayoutData(gridData);
-
- //created this composite because combos as direct children of a Group do not have a border, no clue why
- Composite intermediaryComposite = getWidgetFactory().createComposite(columnGroup);
- layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- intermediaryComposite.setLayout(layout);
-
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace= true;
- intermediaryComposite.setLayoutData(gridData);
-
- CommonWidgets.buildTableLabel(intermediaryComposite, getWidgetFactory());
-
- this.tableCombo = new TableCombo(intermediaryComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.tableCombo.getCombo().setLayoutData(gridData);
- helpSystem.setHelp(tableCombo.getCombo(), IJpaHelpContextIds.ENTITY_TABLE);
-
- CommonWidgets.buildCatalogLabel(intermediaryComposite, getWidgetFactory());
- this.catalogCombo = new CatalogCombo(intermediaryComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.catalogCombo.getCombo().setLayoutData(gridData);
- helpSystem.setHelp(catalogCombo.getCombo(), IJpaHelpContextIds.ENTITY_CATALOG);
-
- CommonWidgets.buildSchemaLabel(intermediaryComposite, getWidgetFactory());
- this.schemaCombo = new SchemaCombo(intermediaryComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.schemaCombo.getCombo().setLayoutData(gridData);
- helpSystem.setHelp(schemaCombo.getCombo(), IJpaHelpContextIds.ENTITY_SCHEMA);
- }
-
- @Override
- protected void engageListeners() {
- }
-
- @Override
- protected void disengageListeners() {
- }
-
- public void doPopulate(EObject obj) {
- this.table = (ITable) obj;
- this.tableCombo.populate(this.table);
- this.catalogCombo.populate(this.table);
- this.schemaCombo.populate(this.table);
- }
-
- public void doPopulate() {
- this.tableCombo.populate();
- this.catalogCombo.populate();
- this.schemaCombo.populate();
- }
-
- @Override
- public void dispose() {
- this.catalogCombo.dispose();
- this.schemaCombo.dispose();
- this.tableCombo.dispose();
- super.dispose();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableGeneratorComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableGeneratorComposite.java
deleted file mode 100644
index 4c2f937535..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableGeneratorComposite.java
+++ /dev/null
@@ -1,535 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.core.internal.mappings.IId;
-import org.eclipse.jpt.core.internal.mappings.ITableGenerator;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.db.internal.Connection;
-import org.eclipse.jpt.db.internal.ConnectionListener;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.Database;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class TableGeneratorComposite extends GeneratorComposite<ITableGenerator>
-{
- private CCombo tableNameCombo;
- private CCombo pkColumnNameCombo;
- private CCombo valueColumnNameCombo;
- private CCombo pkColumnValueCombo;
-
- private ConnectionListener connectionListener;
-
- private ConnectionProfile connectionProfile;
-
- public TableGeneratorComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, commandStack, widgetFactory);
- this.connectionListener = this.buildConnectionListener();
- }
-
- protected ITableGenerator createGenerator() {
- ITableGenerator tableGenerator = idMapping().createTableGenerator();
- idMapping().setTableGenerator(tableGenerator);
- return tableGenerator;
- }
-
- protected ITableGenerator generator(IId idMapping) {
- return idMapping.getTableGenerator();
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout(2, false);
- composite.setLayout(layout);
-
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.TableGeneratorComposite_name);
-
- this.nameTextWidget = buildNameText(composite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.nameTextWidget.setLayoutData(gridData);
- helpSystem.setHelp(this.nameTextWidget, IJpaHelpContextIds.MAPPING_TABLE_GENERATOR_NAME);
-
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.TableGeneratorComposite_table);
-
- this.tableNameCombo = buildTableNameCombo(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.tableNameCombo.setLayoutData(gridData);
- helpSystem.setHelp(this.tableNameCombo, IJpaHelpContextIds.MAPPING_TABLE_GENERATOR_TABLE);
-
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.TableGeneratorComposite_pkColumn);
-
- this.pkColumnNameCombo = buildPkColumnNameCombo(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.pkColumnNameCombo.setLayoutData(gridData);
- helpSystem.setHelp(this.pkColumnNameCombo, IJpaHelpContextIds.MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN);
-
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.TableGeneratorComposite_valueColumn);
-
- this.valueColumnNameCombo = buildValueColumnNameCombo(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.valueColumnNameCombo.setLayoutData(gridData);
- helpSystem.setHelp(this.valueColumnNameCombo, IJpaHelpContextIds.MAPPING_TABLE_GENERATOR_VALUE_COLUMN);
-
- getWidgetFactory().createLabel(composite, JptUiMappingsMessages.TableGeneratorComposite_pkColumnValue);
-
- this.pkColumnValueCombo = buildPkColumnValueCombo(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.pkColumnValueCombo.setLayoutData(gridData);
- helpSystem.setHelp(this.pkColumnValueCombo, IJpaHelpContextIds.MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN_VALUE);
- }
-
- private CCombo buildTableNameCombo(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- combo.add(JptUiMappingsMessages.TableGeneratorComposite_default);
- combo.select(0);
- combo.addModifyListener(buildTableNameListener());
- return combo;
- }
-
- private CCombo buildPkColumnNameCombo(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- combo.add(JptUiMappingsMessages.TableGeneratorComposite_default);
- combo.select(0);
- combo.addModifyListener(buildPkColumnNameListener());
- return combo;
- }
-
- private CCombo buildValueColumnNameCombo(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- combo.add(JptUiMappingsMessages.TableGeneratorComposite_default);
- combo.select(0);
- combo.addModifyListener(buildValueColumnNameListener());
- return combo;
- }
-
- private CCombo buildPkColumnValueCombo(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- combo.add(JptUiMappingsMessages.TableGeneratorComposite_default);
- combo.select(0);
- combo.addModifyListener(buildPkColumnValueListener());
- return combo;
- }
-
- private ModifyListener buildTableNameListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String text = ((CCombo) e.getSource()).getText();
- if (text != null && tableNameCombo.getItemCount() > 0 && text.equals(tableNameCombo.getItem(0))) {
- text = null;
- }
- ITableGenerator generator = getGenerator();
- if (generator == null) {
- generator = createGenerator();
- }
- generator.setSpecifiedTable(text);
- }
- };
- }
-
- private ModifyListener buildPkColumnNameListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String text = ((CCombo) e.getSource()).getText();
- if (text != null && pkColumnNameCombo.getItemCount() > 0 && text.equals(pkColumnNameCombo.getItem(0))) {
- text = null;
- }
- ITableGenerator generator = getGenerator();
- if (generator == null) {
- generator = createGenerator();
- }
- generator.setSpecifiedPkColumnName(text);
- }
- };
- }
-
- private ModifyListener buildValueColumnNameListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String text = ((CCombo) e.getSource()).getText();
- if (text != null && valueColumnNameCombo.getItemCount() > 0 && text.equals(valueColumnNameCombo.getItem(0))) {
- text = null;
- }
- ITableGenerator generator = getGenerator();
- if (generator == null) {
- generator = createGenerator();
- }
- generator.setSpecifiedValueColumnName(text);
- }
- };
- }
-
- private ModifyListener buildPkColumnValueListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String text = ((CCombo) e.getSource()).getText();
- if (text != null && pkColumnValueCombo.getItemCount() > 0 && text.equals(pkColumnValueCombo.getItem(0))) {
- text = null;
- }
- ITableGenerator generator = getGenerator();
- if (generator == null) {
- generator = createGenerator();
- }
- generator.setSpecifiedPkColumnValue(text);
- }
- };
- }
-
- protected void generatorChanged(Notification notification) {
- super.generatorChanged(notification);
- if (notification.getFeatureID(ITableGenerator.class) == JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_TABLE) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- String tableName = getGenerator().getSpecifiedTable();
- if (tableName == null) {
- tableNameCombo.select(0);
- }
- else if (!tableNameCombo.getText().equals(tableName)) {
- tableNameCombo.setText(tableName);
- }
- populatePkColumnNameCombo();
- populateValueColumnNameCombo();
- }
- });
- }
- else if (notification.getFeatureID(ITableGenerator.class) == JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populatePkColumnName();
-
- }
- });
- }
- else if (notification.getFeatureID(ITableGenerator.class) == JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_VALUE_COLUMN_NAME) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- String columnName = getGenerator().getSpecifiedValueColumnName();
- if (columnName == null) {
- valueColumnNameCombo.select(0);
- }
- else if (!valueColumnNameCombo.getText().equals(columnName)) {
- valueColumnNameCombo.setText(columnName);
- }
- }
- });
- }
- else if (notification.getFeatureID(ITableGenerator.class) == JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- String columnValue = getGenerator().getSpecifiedPkColumnValue();
- if (columnValue == null) {
- pkColumnValueCombo.select(0);
- }
- else if (!pkColumnValueCombo.getText().equals(columnValue)) {
- pkColumnValueCombo.setText(columnValue);
- }
- }
- });
- }
- }
-
- @Override
- protected void doPopulate(EObject obj) {
- super.doPopulate(obj);
- if (obj == null) {
- this.connectionProfile = null;
- return;
- }
- populateTableNameCombo();
- populatePkColumnNameCombo();
- populateValueColumnNameCombo();
- populatePkColumnValueCombo();
- }
-
- @Override
- protected void doPopulate() {
- super.doPopulate();
- populateTableNameCombo();
- populatePkColumnNameCombo();
- populateValueColumnNameCombo();
- populatePkColumnValueCombo();
- }
-
- @Override
- protected void engageListeners() {
- super.engageListeners();
- if (getGenerator() != null) {
- addConnectionListener();
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (getGenerator() != null) {
- removeConnectionListener();
- }
- super.disengageListeners();
- }
-
- private ConnectionProfile getConnectionProfile() {
- if(this.connectionProfile == null) {
- IJpaProject jpaProject = idMapping().getJpaProject();
- this.connectionProfile = jpaProject.connectionProfile();
- }
- return this.connectionProfile;
- }
-
-
- private void addConnectionListener() {
- this.getConnectionProfile().addConnectionListener(this.connectionListener);
- }
-
- private void removeConnectionListener() {
- this.getConnectionProfile().removeConnectionListener(this.connectionListener);
- }
-
- protected Schema getSchema() {
- if (getGenerator() != null) {
- return this.getConnectionProfile().getDatabase().schemaNamed(getGenerator().getSchema());
- }
- return null;
- }
- private void populateTableNameCombo() {
- if (this.getGenerator() == null) {
- return;
- }
- if (this.getConnectionProfile().isConnected()) {
- this.tableNameCombo.remove(1, this.tableNameCombo.getItemCount()-1);
- Schema schema = this.getSchema();
- if (schema != null) {
- Iterator<String> tables = schema.tableNames();
- for (Iterator<String> stream = CollectionTools.sort(tables); stream.hasNext(); ) {
- this.tableNameCombo.add(stream.next());
- }
- }
- }
- String tableName = this.getGenerator().getSpecifiedTable();
- if (tableName != null) {
- if (!this.tableNameCombo.getText().equals(tableName)) {
- this.tableNameCombo.setText(tableName);
- }
- }
- else {
- this.tableNameCombo.select(0);
- }
- }
-
- private void populatePkColumnNameCombo() {
- if (this.getGenerator() == null) {
- return;
- }
- populatePkColumnChoices();
- populatePkColumnName();
- }
- private void populatePkColumnChoices() {
- this.pkColumnNameCombo.remove(1, this.pkColumnNameCombo.getItemCount() - 1);
-
- if (this.getConnectionProfile().isConnected()) {
- if (!this.tableNameCombo.getText().equals(JptUiMappingsMessages.TableGeneratorComposite_default)) { // hmm,
- // if
- // they
- // actually
- // set
- // the
- // table
- // to
- // Default??
- String tableName = this.tableNameCombo.getText();
- Schema schema = getSchema();
- if (schema != null) {
- Table table = schema.tableNamed(tableName);
- if (table != null) {
- for (Iterator<String> stream = CollectionTools.sort(table.columnNames()); stream.hasNext();) {
- this.pkColumnNameCombo.add(stream.next());
- }
- }
- }
- }
- }
- }
-
- private void populatePkColumnName() {
- String pkColumnName = this.getGenerator().getSpecifiedPkColumnName();
- if (pkColumnName != null) {
- if (!this.pkColumnNameCombo.getText().equals(pkColumnName)) {
- this.pkColumnNameCombo.setText(pkColumnName);
- }
- }
- else {
- this.pkColumnNameCombo.select(0);
- }
- }
-
- private void populateValueColumnNameCombo() {
- if (this.getGenerator() == null) {
- return;
- }
- if (this.getConnectionProfile().isConnected()) {
- this.valueColumnNameCombo.remove(1, this.valueColumnNameCombo.getItemCount() - 1);
- if (!this.tableNameCombo.getText().equals(JptUiMappingsMessages.TableGeneratorComposite_default)) { // hmm,
- // if
- // they
- // actually
- // set
- // the
- // table
- // to
- // Default??
- String tableName = this.tableNameCombo.getText();
- Schema schema = getSchema();
- if (schema != null) {
- Table table = schema.tableNamed(tableName);
- if (table != null) {
- for (Iterator<String> stream = CollectionTools.sort(table.columnNames()); stream.hasNext();) {
- this.valueColumnNameCombo.add(stream.next());
- }
- }
- }
- }
- }
- String valueColumnName = this.getGenerator().getSpecifiedValueColumnName();
- if (valueColumnName != null) {
- if (!this.valueColumnNameCombo.getText().equals(valueColumnName)) {
- this.valueColumnNameCombo.setText(valueColumnName);
- }
- }
- else {
- this.valueColumnNameCombo.select(0);
- }
- }
-
- private void populatePkColumnValueCombo() {
- if (this.getGenerator() == null) {
- return;
- }
- String pkColumnValue = this.getGenerator().getSpecifiedPkColumnValue();
- if (pkColumnValue != null) {
- if (!this.pkColumnValueCombo.getText().equals(pkColumnValue)) {
- this.pkColumnValueCombo.setText(pkColumnValue);
- }
- }
- else {
- this.pkColumnValueCombo.select(0);
- }
- }
-
- protected void clear() {
- super.clear();
- this.tableNameCombo.select(0);
- this.pkColumnNameCombo.select(0);
- this.pkColumnValueCombo.select(0);
- this.valueColumnNameCombo.select(0);
- }
-
- private ConnectionListener buildConnectionListener() {
- return new ConnectionListener() {
- public void closed(Connection connection) {
- populate();
- }
-
- public void modified(Connection connection) {
- populate();
- }
-
- public void opened(Connection connection) {
- populate();
- }
-
- public void databaseChanged(Connection connection, final Database database) {
- populate();
- }
-
- public void schemaChanged(Connection connection, final Schema schema) {
- populate();
- }
-
- private void populate() {
- getControl().getDisplay().asyncExec( new Runnable() {
- public void run() {
- if (getControl().isDisposed()) {
- return;
- }
- populateTableNameCombo();
- populatePkColumnChoices();
- populateValueColumnNameCombo();
- }
- });
- }
-
- public void aboutToClose(Connection connection) {
- // not interested to this event.
- }
-
- public boolean okToClose(Connection connection) {
- // not interested to this event.
- return true;
- }
-
- public void tableChanged(Connection connection, final Table table) {
- // not interested to this event.
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TargetEntityChooser.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TargetEntityChooser.java
deleted file mode 100644
index dd5e76a6ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TargetEntityChooser.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class TargetEntityChooser extends BaseJpaController
-{
- private IRelationshipMapping relationshipMapping;
- private Adapter relationshipMappingListener;
-
- protected CCombo targetEntityCombo;
-
-
- private Composite composite;
-
- public TargetEntityChooser(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- buildRelationshipMappingListener();
- }
-
-
- private void buildRelationshipMappingListener() {
- relationshipMappingListener = new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- relationshipMappingChanged(notification);
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- this.composite = getWidgetFactory().createComposite(parent);
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- gridLayout.numColumns = 3;
- this.composite.setLayout(gridLayout);
-
- CommonWidgets.buildTargetEntityLabel(this.composite, getWidgetFactory());
-
- this.targetEntityCombo = buildTargetEntityCombo(this.composite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- this.targetEntityCombo.setLayoutData(gridData);
-
- buildTargetEntitySelectionButton(this.composite);
-
- }
-
- protected CCombo buildTargetEntityCombo(Composite parent) {
- final CCombo combo = getWidgetFactory().createCCombo(parent, SWT.FLAT);
- combo.add(JptUiMappingsMessages.TargetEntityChooser_defaultEmpty);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(combo, IJpaHelpContextIds.MAPPING_TARGET_ENTITY);
- combo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
- String targetEntityName = ((CCombo) e.getSource()).getText();
- if (targetEntityName.equals(combo.getItem(0)) || targetEntityName.equals("")) { //$NON-NLS-1$
- targetEntityName = null;
- }
- else if (!relationshipMapping.targetEntityIsValid(targetEntityName)) {
- return;
- }
- relationshipMapping.setSpecifiedTargetEntity(targetEntityName);
- }
- });
- return combo;
- }
-
-
- private void relationshipMappingChanged(Notification notification) {
- if (notification.getFeatureID(IRelationshipMapping.class) ==
- JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- }
- else if (notification.getFeatureID(IRelationshipMapping.class) ==
- JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- }
- }
-
- @Override
- protected void engageListeners() {
- if (relationshipMapping != null) {
- relationshipMapping.eAdapters().add(relationshipMappingListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.relationshipMapping != null) {
- this.relationshipMapping.eAdapters().remove(relationshipMappingListener);
- }
- }
-
- @Override
- public void doPopulate(EObject obj) {
- this.relationshipMapping = (IRelationshipMapping) obj;
- populateCombo();
- }
-
- @Override
- protected void doPopulate() {
- populateCombo();
- }
-
- private void populateCombo() {
- if (relationshipMapping == null) {
- targetEntityCombo.clearSelection();
- return;
- }
- String targetEntity = this.relationshipMapping.getSpecifiedTargetEntity();
- this.targetEntityCombo.setItem(0, NLS.bind(JptUiMappingsMessages.TargetEntityChooser_defaultWithOneParam, this.relationshipMapping.getDefaultTargetEntity()));
- if (targetEntity != null) {
- if (!this.targetEntityCombo.getText().equals(targetEntity)) {
- this.targetEntityCombo.setText(targetEntity);
- }
- }
- else {
- if (this.targetEntityCombo.getSelectionIndex() != 0) {
- this.targetEntityCombo.select(0);
- }
- }
- }
-
- @Override
- public Control getControl() {
- return this.composite;
- }
-
- //see org.eclipse.pde.internal.ui.editor.plugin.rows.ClassAttributeRow
- //for example of the hyperlink opening a resource
- protected Button buildTargetEntitySelectionButton(Composite parent) {
- Button button = new Button(parent, SWT.PUSH);
- button.setText(JptUiMappingsMessages.TargetEntityChooser_browse);
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- browse();
- }
- });
- return button;
- }
-
- protected void browse() {
- BusyIndicator.showWhile(this.targetEntityCombo.getDisplay(), new Runnable() {
- public void run() {
- doOpenSelectionDialog();
- }
- });
- }
-
- private void doOpenSelectionDialog() {
- SelectionDialog dialog;
- try {
- dialog = JavaUI.createTypeDialog(getControl().getShell(),
- PlatformUI.getWorkbench().getProgressService(),
- SearchEngine.createWorkspaceScope(),
- IJavaElementSearchConstants.CONSIDER_ALL_TYPES,
- false,
- ""); //$NON-NLS-1$
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- dialog.setTitle("Select Type"); //$NON-NLS-1$
- if (dialog.open() == Window.OK) {
- IType type = (IType) dialog.getResult()[0];
- this.targetEntityCombo.setText(type.getFullyQualifiedName('$'));
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TransientComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TransientComposite.java
deleted file mode 100644
index 3871e8ac4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TransientComposite.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class TransientComposite extends BaseJpaComposite
-{
- public TransientComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
-
- }
-
-
- public void doPopulate(EObject obj) {
- }
-
- public void doPopulate() {
- }
-
- protected void engageListeners() {
- }
-
- protected void disengageListeners() {
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/VersionComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/VersionComposite.java
deleted file mode 100644
index fe7fb65ac2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/VersionComposite.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.mappings.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jpt.core.internal.mappings.IBasic;
-import org.eclipse.jpt.core.internal.mappings.IVersion;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.core.internal.mappings.TemporalType;
-import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class VersionComposite extends BaseJpaComposite
-{
- private IVersion version;
-
- private ColumnComposite columnComposite;
-
- private EnumComboViewer temporalTypeViewer;
-
-
- public VersionComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, SWT.NULL, commandStack, widgetFactory);
- }
- @Override
- protected void initializeLayout(Composite composite) {
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
-
- Control generalControl = buildGeneralComposite(composite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- generalControl.setLayoutData(gridData);
-
- }
-
- private Control buildGeneralComposite(Composite composite) {
-// IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
-
- Composite generalComposite = getWidgetFactory().createComposite(composite);
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 0;
- generalComposite.setLayout(layout);
-
- this.columnComposite = new ColumnComposite(generalComposite, this.commandStack, getWidgetFactory());
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalSpan = 2;
- this.columnComposite.getControl().setLayoutData(gridData);
-
- CommonWidgets.buildTemporalLabel(generalComposite, getWidgetFactory());
- this.temporalTypeViewer = CommonWidgets.buildEnumComboViewer(generalComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.temporalTypeViewer.getControl().setLayoutData(gridData);
-
- return generalComposite;
- }
-
- public void doPopulate(EObject obj) {
- this.version = (IVersion) obj;
- if (this.version != null) {
- this.columnComposite.populate(this.version.getColumn());
- }
- else {
- this.columnComposite.populate(null);
- }
- this.temporalTypeViewer.populate(new TemporalTypeHolder(this.version));
- }
-
- public void doPopulate() {
- this.columnComposite.populate();
- this.temporalTypeViewer.populate();
- }
-
- protected void engageListeners() {
- }
-
- protected void disengageListeners() {
- }
-
- @Override
- public void dispose() {
- this.columnComposite.dispose();
- this.temporalTypeViewer.dispose();
- super.dispose();
- }
-
- protected IVersion getVersion() {
- return this.version;
- }
-
-
-
-
- private class TemporalTypeHolder extends EObjectImpl implements EnumHolder {
-
- private IVersion version;
-
- TemporalTypeHolder(IVersion version) {
- super();
- this.version = version;
- }
-
- public Object get() {
- return this.version.getTemporal();
- }
-
- public void set(Object enumSetting) {
- this.version.setTemporal((TemporalType) enumSetting);
- }
-
- public Class featureClass() {
- return IBasic.class;
- }
-
- public int featureId() {
- return JpaCoreMappingsPackage.IVERSION__TEMPORAL;
- }
-
- public EObject wrappedObject() {
- return this.version;
- }
-
- public Object[] enumValues() {
- return TemporalType.VALUES.toArray();
- }
-
- /**
- * TemporalType has no Default, return null
- */
- public Object defaultValue() {
- return null;
- }
-
- /**
- * TemporalType has no Default, return null
- */
- public String defaultString() {
- return null;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/perspective/JpaPerspectiveFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/perspective/JpaPerspectiveFactory.java
deleted file mode 100644
index 7d3f6ff463..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/perspective/JpaPerspectiveFactory.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.perspective;
-
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-import org.eclipse.ui.progress.IProgressConstants;
-
-public class JpaPerspectiveFactory implements IPerspectiveFactory {
-
- public void createInitialLayout(IPageLayout layout) {
- String editorArea = layout.getEditorArea();
-
- //Package area
- IFolderLayout folder = layout.createFolder(
- "left", IPageLayout.LEFT, (float) 0.25, editorArea); //$NON-NLS-1$
- folder.addView(JavaUI.ID_PACKAGES);
- folder.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY);
- folder.addPlaceholder(IPageLayout.ID_RES_NAV);
-
- //Database Explorer area
- layout.addView("org.eclipse.datatools.connectivity.DataSourceExplorerNavigator", //$NON-NLS-1$
- IPageLayout.BOTTOM, (float) 0.60, JavaUI.ID_PACKAGES);
-
- //Problems/Console area
- IFolderLayout outputFolder = layout.createFolder(
- "bottom", IPageLayout.BOTTOM, (float) 0.60, editorArea); //$NON-NLS-1$
- outputFolder.addView(IPageLayout.ID_PROBLEM_VIEW);
- outputFolder.addView("org.eclipse.pde.runtime.LogView"); //$NON-NLS-1$
- outputFolder.addPlaceholder(IPageLayout.ID_BOOKMARKS);
- outputFolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
-
- //JPA Details (Split with Problems/Console area)
- layout.addView("org.eclipse.jpt.ui.jpaDetailsView",
- IPageLayout.RIGHT, (float) .60, "bottom");
-
- //JPA Structure area
- IFolderLayout outlineFolder = layout.createFolder(
- "right", IPageLayout.RIGHT, (float) 0.75, editorArea); //$NON-NLS-1$
- outlineFolder.addView("org.eclipse.jpt.ui.jpaStructureView");
- outlineFolder.addView(IPageLayout.ID_OUTLINE);
-
- layout.addActionSet(JavaUI.ID_ACTION_SET);
- layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET);
- layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
-
- // views - java
- layout.addShowViewShortcut(JavaUI.ID_PACKAGES);
- layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY);
- layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW);
- layout.addShowViewShortcut(JavaUI.ID_JAVADOC_VIEW);
-
- // views - standard workbench
- layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
- layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
- layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
-
- // new actions - Java project creation wizard
- layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); //$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); //$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewEnumCreationWizard"); //$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard"); //$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); //$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard"); //$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/prefs/JpaPreferencePage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/prefs/JpaPreferencePage.java
deleted file mode 100644
index 77fa10c9cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/prefs/JpaPreferencePage.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.prefs;
-
-import java.io.IOException;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.internal.ui.preferences.UserLibraryPreferencePage;
-import org.eclipse.jface.preference.IPersistentPreferenceStore;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jpt.core.internal.JptCorePlugin;
-import org.eclipse.jpt.core.internal.prefs.JpaPreferenceConstants;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import org.eclipse.ui.preferences.ScopedPreferenceStore;
-
-public class JpaPreferencePage extends PreferencePage
- implements IWorkbenchPreferencePage
-{
- public static final String ID = "org.eclipse.jpt.ui.jpaPreferencePage";
-
-
- private IPersistentPreferenceStore preferences;
-
- private IPreferenceStore userLibPreferences;
-
- private Label jpaLibLabel;
-
- private Combo jpaLibCombo;
-
- private Link userLibsLink;
-
-
- public JpaPreferencePage() {
- super();
- preferences =
- new ScopedPreferenceStore(
- new InstanceScope(),
- JptCorePlugin.getPlugin().getBundle().getSymbolicName());
- userLibPreferences =
- new ScopedPreferenceStore(
- new InstanceScope(),
- JavaCore.getPlugin().getBundle().getSymbolicName());
- }
-
- public void init(IWorkbench workbench) {}
-
- public Control createContents(Composite parent) {
- Composite container = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- container.setLayout(layout);
-
- jpaLibLabel = createLabel(container, 1, JptUiMessages.JpaPreferencePage_defaultJpaLib);
-
- jpaLibCombo = createCombo(container, true);
-
- userLibsLink = new Link(container, SWT.NONE);
- GridData data = new GridData(GridData.END, GridData.CENTER, false, false);
- data.horizontalSpan = 2;
- userLibsLink.setLayoutData(data);
- userLibsLink.setText(JptUiMessages.JpaPreferencePage_userLibsLink);
- userLibsLink.addSelectionListener(
- new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- ((IWorkbenchPreferenceContainer) getContainer())
- .openPage(UserLibraryPreferencePage.ID, null);
- }
- }
- );
-
- performDefaults();
- return container;
- }
-
- private Label createLabel(Composite container, int span, String text) {
- Label label = new Label(container, SWT.NONE);
- label.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- label.setLayoutData(gd);
- return label;
- }
-
- private Combo createCombo(Composite container, boolean fillHorizontal) {
- Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
- if (fillHorizontal) {
- combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- }
- else {
- combo.setLayoutData(new GridData());
- }
- return combo;
- }
-
- private void fillJpaLibs() {
- int index = jpaLibCombo.getSelectionIndex();
- String selectedJpaLib = null;
- if (index >= 0) {
- selectedJpaLib = jpaLibCombo.getItem(jpaLibCombo.getSelectionIndex());
- }
-
- jpaLibCombo.clearSelection();
- jpaLibCombo.setItems(JavaCore.getUserLibraryNames());
-
- if (selectedJpaLib != null) {
- int newIndex = CollectionTools.indexOf(jpaLibCombo.getItems(), selectedJpaLib);
- if (newIndex >= 0) {
- jpaLibCombo.select(newIndex);
- }
- }
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible) {
- fillJpaLibs();
- }
- }
-
- public void performDefaults() {
- fillJpaLibs();
- String defaultLib = preferences.getString(JpaPreferenceConstants.PREF_DEFAULT_JPA_LIB);
- int index = -1;
- if (! StringTools.stringIsEmpty(defaultLib)) {
- index = CollectionTools.indexOf(jpaLibCombo.getItems(), defaultLib);
- }
- if (index >= 0) {
- jpaLibCombo.select(index);
- }
-
- super.performDefaults();
- }
-
- public boolean performOk() {
- int index = jpaLibCombo.getSelectionIndex();
- String defaultLib = (index >= 0) ? jpaLibCombo.getItem(index) : null;
- if (! StringTools.stringIsEmpty(defaultLib)) {
- preferences.setValue(JpaPreferenceConstants.PREF_DEFAULT_JPA_LIB, defaultLib);
- }
- try {
- preferences.save();
- }
- catch (IOException ioe) {
- JptCorePlugin.log(ioe);
- }
- return true;
- }
-
- public void dispose() {
- // null pointer check - bug 168337
- if (jpaLibLabel != null) jpaLibLabel.dispose();
- if (jpaLibCombo != null) jpaLibCombo.dispose();
- super.dispose();
- }
-
-
-
-// private boolean libContainsJpaClasses() {
-// return true;
-// String jarLocation = getStringValue();
-// String errorMessage = JptUiMessages.JpaPreferencePage_invalidJpaLib;
-// boolean hasError = false;
-//
-// try {
-// JarFile jarFile = new JarFile(jarLocation);
-// hasError = jarFile.getEntry("javax/persistence/EntityManager.class") == null;
-// }
-// catch (IOException ioe) {
-// hasError = true;
-// }
-//
-// if (hasError) {
-// showErrorMessage(errorMessage);
-// }
-// else {
-// clearErrorMessage();
-// }
-//
-// return ! hasError;
-// }
-// }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/DataModelPropertyPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/DataModelPropertyPage.java
deleted file mode 100644
index cc0b64d8f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/DataModelPropertyPage.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.properties;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelSynchHelper;
-import org.eclipse.wst.common.frameworks.internal.ui.ValidationStatus;
-
-public abstract class DataModelPropertyPage
- extends PropertyPage
- implements Listener, IDataModelListener
-{
- protected IDataModel model;
-
- private ValidationStatus status = new ValidationStatus();
- private Map validationMap;
- private String[] validationPropertyNames;
- private boolean isValidating = false;
-
- protected DataModelSynchHelper synchHelper;
-
- private String infopopID;
-
-
- protected DataModelPropertyPage(IDataModel model) {
- super();
- this.model = model;
- model.addListener(this);
- synchHelper = initializeSynchHelper(model);
- }
-
-
- /**
- * @return
- */
- public DataModelSynchHelper initializeSynchHelper(IDataModel dm) {
- return new DataModelSynchHelper(dm);
- }
-
-
- @Override
- protected Control createContents(Composite parent) {
- Composite top = createTopLevelComposite(parent);
- setupInfopop(top);
- setDefaults();
- addListeners();
- initializeValidationProperties();
- return top;
- }
-
- private void initializeValidationProperties() {
- validationPropertyNames = getValidationPropertyNames();
- if (validationPropertyNames == null || validationPropertyNames.length == 0)
- validationMap = Collections.EMPTY_MAP;
- else {
- validationMap = new HashMap(validationPropertyNames.length);
- for (int i = 0; i < validationPropertyNames.length; i++)
- validationMap.put(validationPropertyNames[i], new Integer(i));
- }
- }
-
- /**
- * Subclass should return the model property names that need to be validated on this page in the
- * order that they should present their messages.
- *
- * @return
- */
- protected abstract String[] getValidationPropertyNames();
-
- /**
- * Return the top level Composite for this page.
- */
- protected abstract Composite createTopLevelComposite(Composite parent);
-
- /**
- * Set up info pop hooks if set.
- */
- protected void setupInfopop(Control parent) {
- if (getInfopopID() != null)
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, getInfopopID());
- }
-
- /**
- * Setup the default values for this page. Subclasses should override to provide appropriate
- * defaults.
- */
- protected void setDefaults() {
- restoreDefaultSettings();
- }
-
- /**
- * Subclasses should implement this method if they have default settings that have been stored
- * and need to be restored.
- *
- * @see storeDefaultSettings()
- */
- protected void restoreDefaultSettings() {
- }
-
- /**
- * Add Listeners to controls at this point to avoid unnecessary events. Subclasses should
- * override to add listeners to its controls.
- */
- protected void addListeners() {
- }
-
- /**
- * Exiting the page. Subclasses may extend.
- */
- protected void exit() {
- }
-
- protected boolean getStatus(Integer key) {
- return status.hasError(key);
- }
-
- /**
- * Sent when an event that the receiver has registered for occurs. If a subclass overrides this
- * method, it must call super.
- *
- * @param event
- * the event which occurred
- */
- public void handleEvent(org.eclipse.swt.widgets.Event event) {
- }
-
- /**
- * Set the error message for this page based on the last error in the ValidationStatus.
- */
- protected void setErrorMessage() {
- String error = status.getLastErrMsg();
- if (error == null) {
- if (getErrorMessage() != null)
- setErrorMessage((String) null);
- String warning = status.getLastWarningMsg();
- if (warning == null) {
- if (getMessage() != null && getMessageType() == IMessageProvider.WARNING)
- setMessage(null, IMessageProvider.WARNING);
- else {
- String info = status.getLastInfoMsg();
- if (info == null) {
- if (getMessage() != null && getMessageType() == IMessageProvider.INFORMATION)
- setMessage(null, IMessageProvider.INFORMATION);
- } else if (!info.equals(getMessage())) {
- setMessage(info, IMessageProvider.INFORMATION);
- }
- }
- } else if (!warning.equals(getMessage()))
- setMessage(warning, IMessageProvider.WARNING);
- } else if (!error.equals(getErrorMessage()))
- setErrorMessage(error);
- }
-
- protected void setErrorStatus(Integer key, String errorMessage) {
- status.setErrorStatus(key, errorMessage);
- }
-
- protected void setWarningStatus(Integer key, String warningMessage) {
- status.setWarningStatus(key, warningMessage);
- }
-
- protected void setInfoStatus(Integer key, String infoMessage) {
- status.setInfoStatus(key, infoMessage);
- }
-
- protected void setOKStatus(Integer key) {
- status.setOKStatus(key);
- }
-
- /**
- * This should be called by the Wizard just prior to running the performFinish operation.
- * Subclasses should override to store their default settings.
- */
- public void storeDefaultSettings() {
- }
-
- /**
- * The page is now being validated. At this time, each control is validated and then the
- * controls are updated based on the results in the ValidationStatus which was updated during
- * <code>validateControls()</code>. Finally, it will display the last error message and it
- * will set the page complete. Subclasses will not typically override this method.
- */
- protected void validatePage() {
- if (!isValidating) {
- isValidating = true;
- try {
- validateControlsBase();
- updateControls();
- setErrorMessage();
- setValid(status.getLastErrMsg() == null);
- }
- finally {
- isValidating = false;
- }
- }
- }
-
- /**
- * Validate individual controls. Use validation keys to keep track of errors.
- *
- * @see setOKStatus(Integer) and setErrorMessage(Integer, String)
- */
- protected final String validateControlsBase() {
- if (!validationMap.isEmpty()) {
- String propName;
- for (int i = 0; i < validationPropertyNames.length; i++) {
- propName = validationPropertyNames[i];
- Integer valKey = (Integer) validationMap.get(propName);
- if (valKey != null)
- validateProperty(propName, valKey);
- if (!getStatus(valKey))
- return propName;
- }
- }
- return null;
- }
-
- /**
- * @param propertyName
- * @param validationkey
- */
- private void validateProperty(String propertyName, Integer validationKey) {
- setOKStatus(validationKey);
- IStatus status1 = model.validateProperty(propertyName);
- if (!status1.isOK()) {
- String message = status1.isMultiStatus() ? status1.getChildren()[0].getMessage() : status1.getMessage();
- switch (status1.getSeverity()) {
- case IStatus.ERROR :
- setErrorStatus(validationKey, message);
- break;
- case IStatus.WARNING :
- setWarningStatus(validationKey, message);
- break;
- case IStatus.INFO :
- setInfoStatus(validationKey, message);
- break;
- }
- }
- }
-
- /**
- * Update the enablement of controls after validation. Sublcasses should check the status of
- * validation keys to determine enablement.
- */
- protected void updateControls() {
- }
-
-
- /*
- * If a property changes that we want to validate, force validation on this page.
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModelListener#propertyChanged(java.lang.String,
- * java.lang.Object, java.lang.Object)
- */
- public void propertyChanged(DataModelEvent event) {
- String propertyName = event.getPropertyName();
- if (validationPropertyNames != null && (event.getFlag() == DataModelEvent.VALUE_CHG || (!isValid() && event.getFlag() == DataModelEvent.VALID_VALUES_CHG))) {
- for (int i = 0; i < validationPropertyNames.length; i++) {
- if (validationPropertyNames[i].equals(propertyName)) {
- validatePage();
- break;
- }
- }
- }
- }
-
- /**
- * @return Returns the model.
- */
- protected IDataModel getDataModel() {
- return model;
- }
-
- public void dispose() {
- super.dispose();
- if (synchHelper != null) {
- synchHelper.dispose();
- synchHelper = null;
- }
- }
-
- protected String getInfopopID() {
- return infopopID;
- }
-
- public void setInfopopID(String infopopID) {
- this.infopopID = infopopID;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/JpaProjectPropertiesPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/JpaProjectPropertiesPage.java
deleted file mode 100644
index 0089adfd1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/JpaProjectPropertiesPage.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.properties;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Iterator;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.core.internal.JpaPlatformRegistry;
-import org.eclipse.jpt.core.internal.JpaProject;
-import org.eclipse.jpt.core.internal.facet.IJpaFacetDataModelProperties;
-import org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProvider;
-import org.eclipse.jpt.core.internal.facet.JpaFacetUtils;
-import org.eclipse.jpt.db.internal.ConnectionProfileRepository;
-import org.eclipse.jpt.db.ui.internal.DTPUiTools;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.JptUiPlugin;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-
-public class JpaProjectPropertiesPage
- extends DataModelPropertyPage
- implements IJpaFacetDataModelProperties
-{
- private PlatformGroup platformGroup;
-
- private ConnectionGroup connectionGroup;
-
- private PersistentClassManagementGroup persistentClassManagementGroup;
-
-
- /**
- * Constructor for SamplePropertyPage.
- */
- public JpaProjectPropertiesPage() {
- super(DataModelFactory.createDataModel(new JpaFacetDataModelProvider()));
- }
-
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
-
- platformGroup = new PlatformGroup(composite);
- connectionGroup = new ConnectionGroup(composite);
- persistentClassManagementGroup = new PersistentClassManagementGroup(composite);
-
- setRuntime();
-
- Dialog.applyDialogFont(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJpaHelpContextIds.PROPERTIES_JAVA_PERSISTENCE);
-
- return composite;
- }
-
- private void setRuntime() {
- IFacetedProject facetedProject = null;
- try {
- facetedProject = ProjectFacetsManager.create(getJpaProject().getProject());
- }
- catch (CoreException ce) {
- JptUiPlugin.log(ce);
- return;
- }
- IRuntime runtime = facetedProject.getPrimaryRuntime();
- model.setProperty(IJpaFacetDataModelProperties.RUNTIME, runtime);
- }
-
- @Override
- protected String[] getValidationPropertyNames() {
- return new String[] {
- IJpaFacetDataModelProperties.PLATFORM_ID,
- IJpaFacetDataModelProperties.CONNECTION,
- IJpaFacetDataModelProperties.DISCOVER_ANNOTATED_CLASSES
- };
- }
-
- protected JpaProject getJpaProject() {
- return (JpaProject) getElement().getAdapter(IJpaProject.class);
- }
-
- private Combo createCombo(Composite container, boolean fillHorizontal) {
- Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
- if (fillHorizontal) {
- combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- }
- else {
- combo.setLayoutData(new GridData());
- }
- return combo;
- }
-
- private Button createButton(Composite container, int span, String text, int style) {
- Button button = new Button(container, SWT.NONE | style);
- button.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- button.setLayoutData(gd);
- return button;
- }
-
- protected void performDefaults() {
- platformGroup.performDefaults();
- connectionGroup.performDefaults();
- persistentClassManagementGroup.performDefaults();
- }
-
- public boolean performOk() {
- JpaProject jpaProject = getJpaProject();
-
- // the facet has been uninstalled during our trip to the properties ...
- if (jpaProject == null) {
- return true;
- }
-
- try {
- JpaFacetUtils.setPlatform(jpaProject.getProject(), model.getStringProperty(IJpaFacetDataModelProperties.PLATFORM_ID));
- JpaFacetUtils.setConnectionName(jpaProject.getProject(), model.getStringProperty(IJpaFacetDataModelProperties.CONNECTION));
- JpaFacetUtils.setDiscoverAnnotatedClasses(jpaProject.getProject(), model.getBooleanProperty(IJpaFacetDataModelProperties.DISCOVER_ANNOTATED_CLASSES));
- }
- catch (CoreException ce) {
- return false;
- }
-
- buildProject();
-
- return true;
- }
-
- private void buildProject() {
- IRunnableWithProgress r= new IRunnableWithProgress() {
- public void run(IProgressMonitor pm) throws InvocationTargetException {
- try {
- getJpaProject().getProject().build(IncrementalProjectBuilder.FULL_BUILD, pm);
- }
- catch (CoreException ce) {
- JptUiPlugin.log(ce);
- }
- }
- };
- try {
- PlatformUI.getWorkbench().getProgressService().run(true, false, r);
- }
- catch (InterruptedException ie) { /* nothing to do */ }
- catch (InvocationTargetException ie) { /* nothing to do */ }
- }
-
-
- private final class PlatformGroup
- {
- private final ComboViewer platformCombo;
-
-
- public PlatformGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_platformLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // TODO
- // PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IDaliHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE);
-
- platformCombo = new ComboViewer(createCombo(group, true));
- platformCombo.setContentProvider(
- new IStructuredContentProvider() {
- public Object[] getElements(Object inputElement) {
- return CollectionTools.array(JpaPlatformRegistry.INSTANCE.allJpaPlatformIds());
- }
-
- public void dispose() {}
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- }
- );
- platformCombo.setLabelProvider(
- new ILabelProvider() {
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return JpaPlatformRegistry.INSTANCE.getJpaPlatformLabel((String) element);
- }
-
- public void addListener(ILabelProviderListener listener) {}
-
- public void removeListener(ILabelProviderListener listener) {}
-
- public void dispose() {}
-
- public boolean isLabelProperty(Object element, String property) {
- return true;
- }
- }
- );
- platformCombo.addSelectionChangedListener(
- new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- model.setProperty(PLATFORM_ID, ((StructuredSelection) platformCombo.getSelection()).getFirstElement());
- }
- }
- );
- // we need some input here, even if it means absolutely nothing
- platformCombo.setInput("null input");
- performDefaults();
- }
-
- private void performDefaults() {
- String platformId = getJpaProject().getPlatform().getId();
- model.setProperty(PLATFORM_ID, platformId);
- platformCombo.setSelection(new StructuredSelection(platformId));
- }
- }
-
-
- private final class ConnectionGroup
- {
- private final Combo connectionCombo;
-
- private Link connectionLink;
-
-
- public ConnectionGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_connectionLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- connectionCombo = createCombo(group, true);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IJpaHelpContextIds.PROPERTIES_JAVA_PERSISTENCE_CONNECTION);
- connectionCombo.addSelectionListener(
- new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- model.setProperty(CONNECTION, connectionCombo.getItem(connectionCombo.getSelectionIndex()));
- }
- }
- );
- fillConnections();
-
- connectionLink = new Link(group, SWT.NONE);
- GridData data = new GridData(GridData.END, GridData.CENTER, false, false);
- data.horizontalSpan = 2;
- connectionLink.setLayoutData(data);
- connectionLink.setText(JptUiMessages.JpaFacetWizardPage_connectionLink);
- connectionLink.addSelectionListener(
- new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- openNewConnectionWizard();
- }
- }
- );
- performDefaults();
- }
-
- private void fillConnections() {
- //clear out connection entries from previous login.
- connectionCombo.removeAll();
-
- for (Iterator<String> stream = ConnectionProfileRepository.instance().profileNames(); stream.hasNext(); ) {
- connectionCombo.add(stream.next());
- }
- }
-
- private void performDefaults() {
- String connectionName = getJpaProject().getDataSource().getConnectionProfileName();
- model.setProperty(CONNECTION, connectionName);
- if (connectionName == null) {
- connectionCombo.clearSelection();
- }
- else {
- connectionCombo.setText(connectionName);
- }
- }
-
- private void openNewConnectionWizard() {
- String connectionName = DTPUiTools.createNewProfile();
- if (connectionName != null) {
- fillConnections();
- model.setProperty(CONNECTION, connectionName);
- connectionCombo.select(connectionCombo.indexOf(connectionName));
- }
- }
- }
-
-
- private final class PersistentClassManagementGroup
- {
- private final Button discoverClassesButton;
-
- private final Button listClassesButton;
-
-
- public PersistentClassManagementGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_persistentClassManagementLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IJpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH);
-
- discoverClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_discoverClassesButton, SWT.RADIO);
- discoverClassesButton.addSelectionListener(
- new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- model.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, true);
- }
- }
- );
-
- listClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_listClassesButton, SWT.RADIO);
- listClassesButton.addSelectionListener(
- new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- model.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, false);
- }
- }
- );
-
- model.addListener(
- new IDataModelListener() {
- public void propertyChanged(DataModelEvent event) {
- if (DISCOVER_ANNOTATED_CLASSES.equals(event.getPropertyName())) {
- boolean discoverClasses = (Boolean) event.getProperty();
- discoverClassesButton.setSelection(discoverClasses);
- listClassesButton.setSelection(! discoverClasses);
- }
- }
- }
- );
-
- performDefaults();
- }
-
- private void performDefaults() {
- boolean discoverClasses = getJpaProject().isDiscoverAnnotatedClasses();
- model.setProperty(DISCOVER_ANNOTATED_CLASSES, discoverClasses);
- discoverClassesButton.setSelection(discoverClasses);
- listClassesButton.setSelection(! discoverClasses);
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/AbstractSelectionParticipant.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/AbstractSelectionParticipant.java
deleted file mode 100644
index 52408ef2bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/AbstractSelectionParticipant.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.selection;
-
-public abstract class AbstractSelectionParticipant
- implements ISelectionParticipant
-{
- protected ISelectionManager selectionManager;
-
-
- protected AbstractSelectionParticipant(ISelectionManager theSelectionManager) {
- selectionManager = theSelectionManager;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionManager.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionManager.java
deleted file mode 100644
index df7fd63dbf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionManager.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.selection;
-
-import org.eclipse.ui.IWorkbenchPart;
-
-public interface ISelectionManager
-{
- /**
- * Return the current selection.
- * This will never be null, but it may be <code>Selection.NULL_SELECTION</code>.
- */
- public Selection getCurrentSelection();
-
- /**
- * Not to be called lightly, this will affect the selection for all interested
- * objects in a window.
- * The newSelection will be selected.
- */
- public void select(Selection newSelection);
-
- /**
- * Not to be called lightly, this will affect the selection for all interested
- * objects in a window.
- * The oldSelection will be deselected, iff it matches the current selection.
- */
- public void deselect(Selection oldSelection);
-
- /**
- * This may be used to register a part with the selection manager if the part
- * is known to need access to the selection manager before it is ever activated
- * or in the case it may be activated prior to the selection manager being
- * created.
- *
- * It should not be necessary to deregister a part, as that happens when the
- * part is closed.
- */
- public void register(IWorkbenchPart part);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionParticipant.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionParticipant.java
deleted file mode 100644
index 7657d002b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/ISelectionParticipant.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.selection;
-
-public interface ISelectionParticipant
-{
- /**
- * Return the current selection of the participant
- */
- Selection getSelection();
-
- /**
- * The selection has changed in the central selection manager.
- * Update this participant accordingly.
- */
- void selectionChanged(SelectionEvent evt);
-
- /**
- * Return whether this selection participant should disconnect itself from
- * its part when its part is hidden from view.
- * <b>Typically</b> editor participants will return true and view participants will
- * return false.
- */
- boolean disposeOnHide();
-
- /**
- * This participant is no longer needed (most likely because its part has
- * closed). Dispose of it.
- */
- void dispose();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaDetailsSelectionParticipant.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaDetailsSelectionParticipant.java
deleted file mode 100644
index 9e84ab43b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaDetailsSelectionParticipant.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.selection;
-
-import org.eclipse.jpt.ui.internal.views.JpaDetailsView;
-
-
-public class JpaDetailsSelectionParticipant extends AbstractSelectionParticipant
-{
- private JpaDetailsView detailsView;
-
-
- public JpaDetailsSelectionParticipant(
- ISelectionManager theSelectionManager, JpaDetailsView view) {
- super(theSelectionManager);
- detailsView = view;
- }
-
-
- public Selection getSelection() {
- return detailsView.getSelection();
- }
-
- public void selectionChanged(SelectionEvent evt) {
- detailsView.select(evt.getSelection());
- }
-
- public boolean disposeOnHide() {
- return false;
- }
-
- public void dispose() {
- // no op
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaStructureSelectionParticipant.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaStructureSelectionParticipant.java
deleted file mode 100644
index bfa9499d1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaStructureSelectionParticipant.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.selection;
-
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jpt.ui.internal.views.JpaStructureView;
-
-public class JpaStructureSelectionParticipant
- extends AbstractSelectionParticipant
-{
- private JpaStructureView structureView;
-
- private ISelectionChangedListener structureViewListener;
-
-
- public JpaStructureSelectionParticipant(
- ISelectionManager theSelectionManager, JpaStructureView theOutlineView) {
- super(theSelectionManager);
- structureView = theOutlineView;
- structureViewListener = new StructureViewSelectionListener();
- structureView.addSelectionChangedListener(structureViewListener);
- }
-
-
- public Selection getSelection() {
- return structureView.getSelection();
- }
-
- public void selectionChanged(SelectionEvent evt) {
- structureView.select(evt.getSelection());
- }
-
- public boolean disposeOnHide() {
- return false;
- }
-
- public void dispose() {
- // no op
- }
-
-
- private class StructureViewSelectionListener
- implements ISelectionChangedListener
- {
- public void selectionChanged(SelectionChangedEvent event) {
- selectionManager.select(structureView.getSelection());
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/Selection.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/Selection.java
deleted file mode 100644
index c02d684210..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/Selection.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.selection;
-
-import org.eclipse.jpt.core.internal.IJpaContentNode;
-
-
-public class Selection
-{
- public static Selection NULL_SELECTION = new Selection();
-
- private IJpaContentNode selectedNode;
-
-
- /* Used internally - only for NULL_SELECTION */
- private Selection() {}
-
- public Selection(IJpaContentNode node) {
- if (node == null) {
- throw new IllegalArgumentException("Must have non-null node. Use NULL_SELECTION otherwise.");
- }
-
- selectedNode = node;
- }
-
- public IJpaContentNode getSelectedNode() {
- return selectedNode;
- }
-
- public boolean equals(Object obj) {
- if (! (obj instanceof Selection)) {
- return false;
- }
-
- if (this == NULL_SELECTION && obj == NULL_SELECTION) {
- return true;
- }
-
- if (this == NULL_SELECTION || obj == NULL_SELECTION) {
- return false;
- }
-
- return this.selectedNode.equals(((Selection) obj).selectedNode);
- }
-
- public int hashCode() {
- if (this == NULL_SELECTION) {
- return super.hashCode();
- }
- else {
- return this.selectedNode.hashCode();
- }
- }
-
- public String toString() {
- if (this == NULL_SELECTION) {
- return "NULL_SELECTION";
- }
- else {
- return selectedNode.toString();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionEvent.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionEvent.java
deleted file mode 100644
index 1020ef3ec1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionEvent.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.selection;
-
-import java.util.EventObject;
-
-public class SelectionEvent extends EventObject
-{
- /**
- * Serializable uid
- * @since 0.5
- */
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Indicates that the selection object is now selected
- */
- public static int SELECTION = 1;
-
- /**
- * Indicates that the selection object has now been deselected
- */
- public static int DESELECTION = 2;
-
-
- /**
- * The selection object whose selection status has changed
- */
- private Selection selection;
-
- /**
- * The type of the selection event, either a SELECTION or a DESELECTION
- */
- private int type;
-
-
- public SelectionEvent(Selection theSelection, int theType, Object source) {
- super(source);
- selection = theSelection;
- type = theType;
- }
-
- /**
- * Return the selection object whose selection status has changed
- */
- public Selection getSelection() {
- return selection;
- }
-
- /**
- * Return the type of selection event, either a SELECTION or a DESELECTION
- */
- public int getType() {
- return type;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManager.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManager.java
deleted file mode 100644
index e9af08d358..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManager.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.selection;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPageListener;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * A <code>SelectionManager</code> stores the current <code>Selection</code> and
- * notifies <code>ISelectionListener</code>s when the selection changes.
- */
-public class SelectionManager
- implements ISelectionManager
-{
- /* The set of pages for which this object is managing selections */
- private Set pages;
-
- /* The map of <code>ISelectionParticipant</code>s (keyed by part) this object
- is using to manage selections */
- private Map selectionParticipants;
-
- private IPageListener pageListener;
-
- private IPartListener2 partListener;
-
- /* The window for which this object manages selections */
- private IWorkbenchWindow window;
-
- private Selection currentSelection;
-
-
- public SelectionManager() {
- super();
- pages = Collections.synchronizedSet(new HashSet());
- selectionParticipants = Collections.synchronizedMap(new HashMap());
- pageListener = new PageListener();
- partListener = new PartListener();
- currentSelection = Selection.NULL_SELECTION;
- }
-
- public void init(IWorkbenchWindow aWindow) {
- window = aWindow;
- aWindow.addPageListener(pageListener);
- initPage(aWindow.getActivePage());
- }
-
- private void initPage(IWorkbenchPage page) {
- if ((page != null) && (! pages.contains(page))) {
- page.addPartListener(partListener);
- pages.add(page);
- IEditorPart activeEditor = page.getActiveEditor();
- initPart(activeEditor);
- selectPart(activeEditor);
- }
- }
-
- private void disposePage(IWorkbenchPage page) {
- if ((page != null) && (pages.contains(page))) {
- page.removePartListener(partListener);
- pages.remove(page);
- }
- }
-
- private void initPart(IWorkbenchPart part) {
- if (part != null) {
- if (selectionParticipants.get(part) == null) {
- ISelectionParticipant selectionParticipant =
- (ISelectionParticipant) part.getAdapter(ISelectionParticipant.class);
- if (selectionParticipant != null) {
- selectionParticipants.put(part, selectionParticipant);
- }
- }
- }
- }
-
- private void selectPart(IWorkbenchPart part) {
- ISelectionParticipant selectionParticipant = getSelectionParticipant(part);
- if (selectionParticipant != null) {
- select(selectionParticipant.getSelection());
- }
- }
-
- private void hidePart(IWorkbenchPart part) {
- ISelectionParticipant selectionParticipant = getSelectionParticipant(part);
- if ((selectionParticipant != null) && (selectionParticipant.disposeOnHide())) {
- closePart(part);
- }
- }
-
- private void closePart(IWorkbenchPart part) {
- ISelectionParticipant selectionParticipant = getSelectionParticipant(part);
- if (selectionParticipant != null) {
- disposePart(part);
- checkForNoEditors();
- }
- }
-
- private void disposePart(IWorkbenchPart part) {
- if ((part != null) && (selectionParticipants.containsKey(part))) {
- ISelectionParticipant selectionParticipant =
- (ISelectionParticipant) selectionParticipants.remove(part);
- selectionParticipant.dispose();
- }
- }
-
- private void checkForNoEditors() {
- IWorkbenchPage activePage = window.getActivePage();
- if ((activePage == null)
- || (activePage.getActiveEditor() == null)) {
- select(Selection.NULL_SELECTION);
- }
- }
-
- /**
- * This may be used to register a part with the selection manager if the part
- * is known to need access to the selection manager before it is ever activated
- * or in the case it may be activated prior to the selection manager being
- * created.
- *
- * It should not be necessary to deregister a part, as that happens when the
- * part is closed.
- */
- public void register(IWorkbenchPart part) {
- initPart(part);
- }
-
- /**
- * Not to be called lightly, this will affect the selection for all interested
- * objects in a window.
- * The newSelection will be selected.
- */
- public void select(Selection newSelection) {
- if (currentSelection.equals(newSelection)) {
- return;
- }
-
- currentSelection = newSelection;
- fireSelectionChange(
- new SelectionEvent(newSelection, SelectionEvent.SELECTION, this)
- );
- }
-
- /**
- * Not to be called lightly, this will affect the selection for all interested
- * objects in a window.
- * The oldSelection will be deselected, iff it matches the current selection.
- */
- public void deselect(Selection oldSelection) {
- if (currentSelection.equals(oldSelection)) {
- currentSelection = Selection.NULL_SELECTION;
- fireSelectionChange(
- new SelectionEvent(oldSelection, SelectionEvent.DESELECTION, this)
- );
- }
- }
-
- private void fireSelectionChange(SelectionEvent event) {
- for (Iterator stream = selectionParticipants.values().iterator(); stream.hasNext(); ) {
- ((ISelectionParticipant) stream.next()).selectionChanged(event);
- }
- }
-
- private ISelectionParticipant getSelectionParticipant(IWorkbenchPart part) {
- return (ISelectionParticipant) selectionParticipants.get(part);
- }
-
- public Selection getCurrentSelection() {
- return currentSelection;
- }
-
- public void dispose() {
- window.removePageListener(pageListener);
- selectionParticipants.clear();
-
- for (Iterator stream = new CloneIterator(pages); stream.hasNext(); ) {
- disposePage((IWorkbenchPage) stream.next());
- }
-
- for (Iterator stream = new CloneIterator(selectionParticipants.keySet()); stream.hasNext(); ) {
- disposePart((IWorkbenchPart) stream.next());
- }
- }
-
-
- private class PageListener implements IPageListener
- {
- public void pageActivated(IWorkbenchPage page) {}
-
- public void pageClosed(IWorkbenchPage page) {
- disposePage(page);
- }
-
- public void pageOpened(IWorkbenchPage page) {
- initPage(page);
- }
- }
-
-
- private class PartListener implements IPartListener2
- {
- public void partActivated(IWorkbenchPartReference partRef) {
- IWorkbenchPart part = partRef.getPart(false);
- if (part != null) {
- initPart(part);
- selectPart(part);
- }
- }
-
- public void partBroughtToTop(IWorkbenchPartReference partRef) {}
-
- public void partClosed(IWorkbenchPartReference partRef) {
- IWorkbenchPart part = partRef.getPart(false);
- if (part != null) {
- closePart(part);
- disposePart(part);
- checkForNoEditors();
- }
- }
-
- public void partDeactivated(IWorkbenchPartReference partRef) {}
-
- public void partHidden(IWorkbenchPartReference partRef) {
- IWorkbenchPart part = partRef.getPart(false);
- if (part != null) {
- hidePart(part);
- }
- }
-
- public void partInputChanged(IWorkbenchPartReference partRef) {}
-
- public void partOpened(IWorkbenchPartReference partRef) {
- IWorkbenchPart part = partRef.getPart(false);
- if (part != null) {
- initPart(part);
- }
- }
-
- public void partVisible(IWorkbenchPartReference partRef) {
- IWorkbenchPart part = partRef.getPart(false);
- if (part != null) {
- initPart(part);
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java
deleted file mode 100644
index 1cfe6e6bb0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.selection;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-public class SelectionManagerFactory
-{
- private static SelectionManagerFactory INSTANCE;
-
- private static Object MUTEX = new Object();
-
-
- /**
- * Each <code>IWorkbenchWindow</code> has its own <code>SelectionManager</code>
- * to track the selection events in the <code>IWorkbenchWindow</code>. All
- * <code>ISelectionListener</code>s in the same <code>IWorkbenchWindow</code>
- * share the same <code>SelectionManager</code>.
- *
- * @return The <code>SelectionManager</code> associated with the current
- * <code>IWorkbenchWindow</code>
- */
- public static ISelectionManager getSelectionManager(IWorkbenchWindow window) {
- if (INSTANCE == null) {
- // this is thread safe for now. you never know whats comming
- synchronized (MUTEX) {
- if(INSTANCE == null) {
- INSTANCE = new SelectionManagerFactory();
- // if we do the init inside the constructor we end up in a loop
- // because the addWindowListener(this) does a callback to us
- INSTANCE.init();
- }
- }
- }
- return INSTANCE.internalGetSelectionManager(window);
- }
-
-
- private Map managers;
-
- private WindowListener windowListener;
-
-
- private SelectionManagerFactory() {
- managers = new HashMap();
- windowListener = new WindowListener();
- }
-
- private void init() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- workbench.addWindowListener(windowListener);
- }
-
- /**
- * Returns the SelectionManager for the IWorkbenchWindow.
- * Creates a new one if none exists yet.
- */
- private SelectionManager internalGetSelectionManager(IWorkbenchWindow window) {
- if (window == null) {
- throw new IllegalArgumentException(window.toString());
- }
-
- if (! managers.containsKey(window)) {
- SelectionManager manager = new SelectionManager();
- this.managers.put(window, manager);
- manager.init(window);
- }
-
- return (SelectionManager) managers.get(window);
- }
-
-
- private class WindowListener implements IWindowListener
- {
- /* @see IWindowListener#windowOpened(IWorkbenchWindow) */
- public void windowOpened(IWorkbenchWindow aWindow) {}
-
- /* @see IWindowListener#windowClosed(IWorkbenchWindow) */
- public void windowClosed(IWorkbenchWindow aWindow) {
- SelectionManager manager = internalGetSelectionManager(aWindow);
- manager.dispose();
- managers.remove(aWindow);
- }
-
- /* @see IWindowListener#windowActivated(IWorkbenchWindow) */
- public void windowActivated(IWorkbenchWindow aWindow) {}
-
- /* @see IWindowListener#windowDeactivated(IWorkbenchWindow) */
- public void windowDeactivated(IWorkbenchWindow aWindow) {}
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionParticipantFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionParticipantFactory.java
deleted file mode 100644
index 2c90739e61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionParticipantFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.selection;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.ui.internal.views.JpaDetailsView;
-import org.eclipse.jpt.ui.internal.views.JpaStructureView;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-public class SelectionParticipantFactory
- implements IAdapterFactory
-{
- /* @see IAdapterFactory#getAdapter(Object, Class) */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (! (adaptableObject instanceof IWorkbenchPart)) {
- return null;
- }
-
- ISelectionManager selectionManager =
- SelectionManagerFactory.getSelectionManager(((IWorkbenchPart) adaptableObject).getSite().getWorkbenchWindow());
- // TODO - turn this into extension point
- if (adaptableObject instanceof ITextEditor) {
- return new TextEditorSelectionParticipant(
- selectionManager, (ITextEditor) adaptableObject);
- }
- else if (adaptableObject instanceof JpaStructureView) {
- return new JpaStructureSelectionParticipant(
- selectionManager, (JpaStructureView) adaptableObject);
- }
- else if (adaptableObject instanceof JpaDetailsView) {
- return new JpaDetailsSelectionParticipant(
- selectionManager, (JpaDetailsView) adaptableObject);
- }
- else {
- return null;
- }
- }
-
- /* @see IAdapterFactory#getAdapterList() */
- public Class[] getAdapterList() {
- return new Class[] { ISelectionParticipant.class };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/TextEditorSelectionParticipant.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/TextEditorSelectionParticipant.java
deleted file mode 100644
index 0c137773f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/TextEditorSelectionParticipant.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.selection;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jpt.core.internal.IJpaContentNode;
-import org.eclipse.jpt.core.internal.IJpaFile;
-import org.eclipse.jpt.core.internal.ITextRange;
-import org.eclipse.jpt.core.internal.JptCorePlugin;
-import org.eclipse.jpt.ui.internal.views.AbstractJpaView;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-public class TextEditorSelectionParticipant
- extends AbstractSelectionParticipant
-{
- private ITextEditor editor;
-
- private IPropertyListener editorInputListener;
-
- private ISelectionChangedListener editorSelectionListener;
-
- private Selection currentSelection;
-
- private boolean suppressNotification = false;
-
-
- public TextEditorSelectionParticipant(ISelectionManager theSelectionManager, ITextEditor theEditor) {
- super(theSelectionManager);
- editor = theEditor;
- editorInputListener = new EditorInputListener();
- editor.addPropertyListener(editorInputListener);
- editorSelectionListener = new EditorSelectionListener();
- ((IPostSelectionProvider) editor.getSelectionProvider()).addPostSelectionChangedListener(editorSelectionListener);
- currentSelection = calculateSelection();
- }
-
- private void editorInputChanged() {
- Selection newSelection = calculateSelection();
-
- if (! newSelection.equals(currentSelection)) {
- currentSelection = newSelection;
-
- if (! suppressNotification) {
- selectionManager.select(newSelection);
- }
- }
- }
-
- private void editorSelectionChanged(SelectionChangedEvent event) {
- Selection newSelection = calculateSelection();
-
- if (! newSelection.equals(currentSelection)) {
- currentSelection = newSelection;
-
- // bug 188344 - won't actively change selection manager selection if
- // a "JPA" view is the active (and presumably selecting) view
- if (editor.getEditorSite().getPage().getActivePart() instanceof AbstractJpaView) {
- return;
- }
-
- if (! suppressNotification) {
- selectionManager.select(newSelection);
- }
- }
- }
-
- private Selection calculateSelection() {
- if (editor == null) {
- return Selection.NULL_SELECTION;
- }
-
- ISelection selection = editor.getSelectionProvider().getSelection();
- IJpaFile persistenceFile = persistenceFileFor(editor.getEditorInput());
-
- if ((persistenceFile == null)
- || (! (selection instanceof ITextSelection))) {
- return Selection.NULL_SELECTION;
- }
-
- IJpaContentNode selectedNode = persistenceFile.getContentNode(((ITextSelection) selection).getOffset());
- if (selectedNode == null) {
- return Selection.NULL_SELECTION;
- }
- return new Selection(selectedNode);
- }
-
- public Selection getSelection() {
- return currentSelection;
- }
-
- public IJpaFile persistenceFileFor(IEditorInput input) {
- IFile file = null;
- if (input instanceof IFileEditorInput) {
- IFileEditorInput fileInput = (IFileEditorInput) input;
- file = fileInput.getFile();
- }
- if (file == null) {
- return null;
- }
- return JptCorePlugin.getJpaFile(file);
- }
-
- public void selectionChanged(SelectionEvent evt) {
- Selection newSelection = evt.getSelection();
-
- if ((getSelection().equals(newSelection))
- || (newSelection == Selection.NULL_SELECTION)) {
- return;
- }
-
- suppressNotification = true;
- IJpaContentNode selectedNode = newSelection.getSelectedNode();
-
- ITextRange textRange = selectedNode.selectionTextRange();
- if (textRange != null) {
- this.editor.selectAndReveal(textRange.getOffset(), textRange.getLength());
- }
- suppressNotification = false;
- }
-
- public boolean disposeOnHide() {
- return true;
- }
-
- public void dispose() {
- this.editor.removePropertyListener(this.editorInputListener);
- ((IPostSelectionProvider) this.editor.getSelectionProvider()).removePostSelectionChangedListener(editorSelectionListener);
- }
-
-
- private class EditorInputListener
- implements IPropertyListener
- {
- public void propertyChanged(Object source, int propId) {
- if ((editor == source) && (propId == IEditorPart.PROP_INPUT)) {
- editorInputChanged();
- }
- }
- }
-
-
- private class EditorSelectionListener
- implements ISelectionChangedListener
- {
- public void selectionChanged(SelectionChangedEvent event) {
- editorSelectionChanged(event);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/IJpaStructureProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/IJpaStructureProvider.java
deleted file mode 100644
index 90899cac54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/IJpaStructureProvider.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.structure;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-
-public interface IJpaStructureProvider
-{
-
- String fileContentType();
-
- /**
- * Build an outline content provider.
- */
- ITreeContentProvider buildContentProvider();
-
- /**
- * Build an outline label provider.
- */
- ILabelProvider buildLabelProvider();
-
- void dispose();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java
deleted file mode 100644
index 1f14002888..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.ui.internal.util;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.widgets.Table;
-
-//copied from jdt.internal.ui.util
-public class SWTUtil {
-
- public static int getTableHeightHint(Table table, int rows) {
- if (table.getFont().equals(JFaceResources.getDefaultFont()))
- table.setFont(JFaceResources.getDialogFont());
- int result= table.getItemHeight() * rows + table.getHeaderHeight();
- if (table.getLinesVisible())
- result+= table.getGridLineWidth() * (rows - 1);
- return result;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/TableLayoutComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/TableLayoutComposite.java
deleted file mode 100644
index cd51349405..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/TableLayoutComposite.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-
-import org.eclipse.jface.viewers.ColumnLayoutData;
-import org.eclipse.jface.viewers.ColumnPixelData;
-import org.eclipse.jface.viewers.ColumnWeightData;
-
-/**
- * A special composite to layout columns inside a table. The composite is needed since we have
- * to layout the columns "before" the actual table gets layouted. Hence we can't use a normal
- * layout manager.
- *
- * copied from jdt.internal.ui.util
- */
-public class TableLayoutComposite extends Composite {
-
- /**
- * The number of extra pixels taken as horizontal trim by the table column.
- * To ensure there are N pixels available for the content of the column,
- * assign N+COLUMN_TRIM for the column width.
- *
- * @since 3.1
- */
- private static int COLUMN_TRIM = "carbon".equals(SWT.getPlatform()) ? 24 : 3; //$NON-NLS-1$
-
- private List columns= new ArrayList();
-
- /**
- * Creates a new <code>TableLayoutComposite</code>.
- */
- public TableLayoutComposite(Composite parent, int style) {
- super(parent, style);
- addControlListener(new ControlAdapter() {
- public void controlResized(ControlEvent e) {
- Rectangle area= getClientArea();
- Table table= (Table)getChildren()[0];
- Point preferredSize= computeTableSize(table);
- int width= area.width - 2 * table.getBorderWidth();
- if (preferredSize.y > area.height) {
- // Subtract the scrollbar width from the total column width
- // if a vertical scrollbar will be required
- Point vBarSize = table.getVerticalBar().getSize();
- width -= vBarSize.x;
- }
- layoutTable(table, width, area, table.getSize().x < area.width);
- }
- });
- }
-
- /**
- * Adds a new column of data to this table layout.
- *
- * @param data the column layout data
- */
- public void addColumnData(ColumnLayoutData data) {
- columns.add(data);
- }
-
- //---- Helpers -------------------------------------------------------------------------------------
-
- private Point computeTableSize(Table table) {
- Point result= table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- int width= 0;
- int size= columns.size();
- for (int i= 0; i < size; ++i) {
- ColumnLayoutData layoutData= (ColumnLayoutData) columns.get(i);
- if (layoutData instanceof ColumnPixelData) {
- ColumnPixelData col= (ColumnPixelData) layoutData;
- width += col.width;
- if (col.addTrim) {
- width += COLUMN_TRIM;
- }
- } else if (layoutData instanceof ColumnWeightData) {
- ColumnWeightData col= (ColumnWeightData) layoutData;
- width += col.minimumWidth;
- } else {
- Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
- }
- }
- if (width > result.x)
- result.x= width;
- return result;
- }
-
- private void layoutTable(Table table, int width, Rectangle area, boolean increase) {
- // XXX: Layout is being called with an invalid value the first time
- // it is being called on Linux. This method resets the
- // Layout to null so we make sure we run it only when
- // the value is OK.
- if (width <= 1)
- return;
-
- TableColumn[] tableColumns= table.getColumns();
- int size= Math.min(columns.size(), tableColumns.length);
- int[] widths= new int[size];
- int fixedWidth= 0;
- int numberOfWeightColumns= 0;
- int totalWeight= 0;
-
- // First calc space occupied by fixed columns
- for (int i= 0; i < size; i++) {
- ColumnLayoutData col= (ColumnLayoutData) columns.get(i);
- if (col instanceof ColumnPixelData) {
- ColumnPixelData cpd= (ColumnPixelData) col;
- int pixels= cpd.width;
- if (cpd.addTrim) {
- pixels += COLUMN_TRIM;
- }
- widths[i]= pixels;
- fixedWidth += pixels;
- } else if (col instanceof ColumnWeightData) {
- ColumnWeightData cw= (ColumnWeightData) col;
- numberOfWeightColumns++;
- // first time, use the weight specified by the column data, otherwise use the actual width as the weight
- // int weight = firstTime ? cw.weight : tableColumns[i].getWidth();
- int weight= cw.weight;
- totalWeight += weight;
- } else {
- Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
- }
- }
-
- // Do we have columns that have a weight
- if (numberOfWeightColumns > 0) {
- // Now distribute the rest to the columns with weight.
- int rest= width - fixedWidth;
- int totalDistributed= 0;
- for (int i= 0; i < size; ++i) {
- ColumnLayoutData col= (ColumnLayoutData) columns.get(i);
- if (col instanceof ColumnWeightData) {
- ColumnWeightData cw= (ColumnWeightData) col;
- // calculate weight as above
- // int weight = firstTime ? cw.weight : tableColumns[i].getWidth();
- int weight= cw.weight;
- int pixels= totalWeight == 0 ? 0 : weight * rest / totalWeight;
- if (pixels < cw.minimumWidth)
- pixels= cw.minimumWidth;
- totalDistributed += pixels;
- widths[i]= pixels;
- }
- }
-
- // Distribute any remaining pixels to columns with weight.
- int diff= rest - totalDistributed;
- for (int i= 0; diff > 0; ++i) {
- if (i == size)
- i= 0;
- ColumnLayoutData col= (ColumnLayoutData) columns.get(i);
- if (col instanceof ColumnWeightData) {
- ++widths[i];
- --diff;
- }
- }
- }
-
- if (increase) {
- table.setSize(area.width, area.height);
- }
- for (int i= 0; i < size; i++) {
- tableColumns[i].setWidth(widths[i]);
- }
- if (!increase) {
- table.setSize(area.width, area.height);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/AbstractJpaView.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/AbstractJpaView.java
deleted file mode 100644
index e5d7cfc697..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/AbstractJpaView.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2006, 2007 Versant. 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: Versant and Others. - initial API and implementation
- ********************************************************************************/
-package org.eclipse.jpt.ui.internal.views;
-
-import org.eclipse.jpt.ui.internal.selection.ISelectionManager;
-import org.eclipse.jpt.ui.internal.selection.Selection;
-import org.eclipse.jpt.ui.internal.selection.SelectionManagerFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public abstract class AbstractJpaView extends ViewPart
-{
- protected PageBook pageBook;
-
- protected Composite defaultComposite;
-
-
- /**
- * The string to display when there is no view content
- */
- private String defaultLabel;
-
- private TabbedPropertySheetWidgetFactory widgetFactory;
-
-
- public AbstractJpaView(String aDefaultLabel) {
- super();
- defaultLabel = aDefaultLabel;
- this.widgetFactory = new TabbedPropertySheetWidgetFactory();
- }
-
- /* @see IWorkbenchPart#createPartControl(Composite) */
- public final void createPartControl(Composite parent) {
- pageBook = new PageBook(parent, SWT.NONE);
- defaultComposite = buildDefaultComposite();
- pageBook.showPage(defaultComposite);
-
- subcreatePartControl(parent);
-
- ISelectionManager selectionManager =
- SelectionManagerFactory.getSelectionManager(getViewSite().getWorkbenchWindow());
- selectionManager.register(this);
- select(selectionManager.getCurrentSelection());
- }
-
- protected void subcreatePartControl(Composite parent) {
- // no op - for subclasses to override if wished
- }
-
- private Composite buildDefaultComposite() {
- Composite composite = getWidgetFactory().createComposite(pageBook, SWT.NONE);
- composite.setLayout(new FillLayout(SWT.VERTICAL));
- Label label = getWidgetFactory().createLabel(composite, defaultLabel);
- return composite;
- }
-
- public abstract void select(Selection aSelection);
-
- protected void showDefaultPage() {
- pageBook.showPage(defaultComposite);
- }
-
- /* @see IWorkbenchPart#setFocus() */
- public void setFocus() {
- pageBook.setFocus();
- }
-
- public TabbedPropertySheetWidgetFactory getWidgetFactory() {
- return this.widgetFactory;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaDetailsView.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaDetailsView.java
deleted file mode 100644
index d4654f079f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaDetailsView.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.views;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import org.eclipse.jpt.core.internal.IJpaContentNode;
-import org.eclipse.jpt.ui.internal.IJpaPlatformUi;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.PlatformRegistry;
-import org.eclipse.jpt.ui.internal.details.IJpaDetailsPage;
-import org.eclipse.jpt.ui.internal.details.IJpaDetailsProvider;
-import org.eclipse.jpt.ui.internal.selection.Selection;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-
-public class JpaDetailsView extends AbstractJpaView
-{
- private Selection currentSelection;
-
- private IJpaDetailsPage currentPage;
-
- /* key: String file content id, value: IJpaDetailsProvider */
- private Map<String, IJpaDetailsProvider> detailsProviders;
-
- /* key: Object content node id, value: Composite page */
- private Map<Object, IJpaDetailsPage> detailsPages;
-
- public JpaDetailsView() {
- super(JptUiMessages.JpaDetailsView_viewNotAvailable);
- this.currentSelection = Selection.NULL_SELECTION;
- this.detailsProviders = new HashMap<String, IJpaDetailsProvider>();
- this.detailsPages = new HashMap<Object, IJpaDetailsPage>();
- }
-
-
- public Selection getSelection() {
- return currentSelection;
- }
-
- public void select(Selection newSelection) {
- if (newSelection.equals(currentSelection)) {
- return;
- }
-
- currentSelection = newSelection;
-
- if (newSelection != Selection.NULL_SELECTION) {
- IJpaContentNode newNode = newSelection.getSelectedNode();
- IJpaDetailsPage newPage = getDetailsPage(newNode);
- setCurrentPage(newPage);
- }
- else if (currentSelection != Selection.NULL_SELECTION) {
- setCurrentPage(null);
- }
- }
-
- private IJpaDetailsPage getDetailsPage(IJpaContentNode contentNode) {
- if (detailsPages.containsKey(contentNode.getId())) {
- IJpaDetailsPage page = detailsPages.get(contentNode.getId());
-
- if ((page != null) &&
- (page.getControl().isDisposed())) {
- detailsPages.remove(contentNode.getId());
- }
- else {
- return page;
- }
- }
-
- return buildDetailsPage(contentNode);
- }
-
- private IJpaDetailsPage buildDetailsPage(IJpaContentNode contentNode) {
- IJpaDetailsProvider detailsProvider =
- getDetailsProvider(contentNode);
-
- if (detailsProvider == null) {
- return null;
- }
- Composite parentComposite = getWidgetFactory().createComposite(pageBook, SWT.NONE);
- parentComposite.setLayout(new FillLayout(SWT.VERTICAL));
- IJpaDetailsPage page =
- detailsProvider.buildDetailsPage(parentComposite, contentNode.getId(), getWidgetFactory());
-
- if (page != null) {
- detailsPages.put(contentNode.getId(), page);
- }
-
- return page;
- }
-
- private IJpaDetailsProvider getDetailsProvider(IJpaContentNode contentNode) {
- String contentId = contentNode.getJpaFile().getContentId();
- IJpaDetailsProvider provider = detailsProviders.get(contentId);
-
- if (provider == null) {
- String platformId = contentNode.getJpaProject().getPlatform().getId();
- IJpaPlatformUi jpaPlatformUI = PlatformRegistry.INSTANCE.getJpaPlatform(platformId);
- for (IJpaDetailsProvider p : jpaPlatformUI.detailsProviders()) {
- if (p.fileContentType().equals(contentId)) {
- provider = p;
- break;
- }
- }
-
- //TODO this view and the detailsProviders Map is not created on a per project basis.
- //the detailsProviders and their fileContentTypes could overlap across project, this would cause problems with storing this map.
-
- if (provider != null) {
- detailsProviders.put(contentId, provider);
- }
- }
-
- return provider;
- }
-
- private void setCurrentPage(IJpaDetailsPage newPage) {
- // depopulate old page
- if ((currentPage != null) && (currentPage != newPage)) {
- currentPage.populate(null);
- }
-
- // populate new page
- if (newPage != null) {
- newPage.populate(currentSelection.getSelectedNode());
- }
-
- currentPage = newPage;
-
- // show new page
- if (newPage == null) {
- showDefaultPage();
- }
- else {
- pageBook.showPage(newPage.getControl().getParent());
- }
- }
-
- public void dispose() {
- for (Iterator<String> stream = new CloneIterator<String>(detailsProviders.keySet()); stream.hasNext(); ) {
- String key = stream.next();
- IJpaDetailsProvider provider = detailsProviders.remove(key);
- provider.dispose();
- }
-
- for (Iterator<Object> stream = new CloneIterator<Object>(detailsPages.keySet()); stream.hasNext(); ) {
- Object key = stream.next();
- IJpaDetailsPage detailsPage = detailsPages.remove(key);
- detailsPage.dispose();
- }
-
- currentSelection = Selection.NULL_SELECTION;
- currentPage = null;
-
- super.dispose();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaStructureView.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaStructureView.java
deleted file mode 100644
index 154ada0ab3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaStructureView.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.views;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jpt.core.internal.IJpaContentNode;
-import org.eclipse.jpt.core.internal.IJpaFile;
-import org.eclipse.jpt.ui.internal.IJpaPlatformUi;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.PlatformRegistry;
-import org.eclipse.jpt.ui.internal.jface.NullLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.NullTreeContentProvider;
-import org.eclipse.jpt.ui.internal.selection.Selection;
-import org.eclipse.jpt.ui.internal.structure.IJpaStructureProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IWorkbenchActionConstants;
-
-public class JpaStructureView extends AbstractJpaView
-{
- private StructureComposite structureComposite;
-
-
- public JpaStructureView() {
- super(JptUiMessages.JpaStructureView_viewNotAvailable);
- }
-
-
- @Override
- public void subcreatePartControl(Composite parent) {
- structureComposite =
- new StructureComposite(pageBook, SWT.NULL);
- }
-
- public Selection getSelection() {
- if (structureComposite.isVisible()) {
- return structureComposite.getSelection();
- }
- else {
- return Selection.NULL_SELECTION;
- }
- }
-
- @Override
- public void select(Selection newSelection) {
- Selection currentSelection = getSelection();
-
- if (newSelection.equals(currentSelection)) {
- return;
- }
-
- if (newSelection == Selection.NULL_SELECTION) {
- showDefaultPage();
- }
- else {
- pageBook.showPage(structureComposite);
- }
-
- structureComposite.select(newSelection);
- }
-
-
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- structureComposite.viewer.addSelectionChangedListener(listener);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- structureComposite.viewer.removeSelectionChangedListener(listener);
- }
-
-
- private class StructureComposite extends Composite
- {
- /* key: String file content id, value: IJpaStructureProvider */
- private Map structureProviders;
-
- private TreeViewer viewer;
-
- private StructureComposite(Composite parent, int style) {
- super(parent, style);
-
- structureProviders = new HashMap();
-
- this.setLayout(new FillLayout());
-
- viewer = new TreeViewer(this, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- viewer.setAutoExpandLevel(2);
- initContextMenu();
- }
-
- protected void initContextMenu() {
- // Create dynamic menu mgr. Dynamic is currently required to
- // support action contributions.
- MenuManager mgr = new MenuManager();
- mgr.setRemoveAllWhenShown(true);
- mgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fillContextMenu(mgr);
- }
- });
- Menu menu = mgr.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- getSite().registerContextMenu(mgr, viewer);
-
- }
-
- /**
- * Called when the context menu is about to open.
- * Delegates to the action group using the viewer's selection as the action context.
- * @since 2.0
- */
- protected void fillContextMenu(IMenuManager manager) {
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- private Selection getSelection() {
- ITreeSelection viewerSelection = (ITreeSelection) viewer.getSelection();
-
- if (viewerSelection.isEmpty() || viewerSelection.size() > 1) {
- if (viewer.getInput() == null) {
- return Selection.NULL_SELECTION;
- }
- else {
- return new Selection((IJpaContentNode) viewer.getInput());
- }
- }
-
- else {
- return new Selection((IJpaContentNode) viewerSelection.getFirstElement());
- }
-
- }
-
- private void select(Selection selection) {
- // note: checks for null and equals() selection have already been performed
-
- if (selection.equals(Selection.NULL_SELECTION)) {
- clearViewer();
- return;
- }
-
- Selection currentSelection = getSelection();
- IJpaContentNode newNode = selection.getSelectedNode();
- IJpaFile newFile = newNode.getJpaFile();
- IJpaContentNode currentNode =
- (currentSelection == Selection.NULL_SELECTION) ?
- null : getSelection().getSelectedNode();
- IJpaFile currentFile =
- (currentNode == null) ?
- null : currentNode.getJpaFile();
-
- if (newFile.equals(currentFile)) {
- viewer.setSelection(new StructuredSelection(newNode), true);
- }
- else if (currentFile != null && newFile.getContentId().equals(currentFile.getContentId())) {
- viewer.setInput(newFile.getContent());
- viewer.setSelection(new StructuredSelection(newNode), true);
- }
- else {
- // new content type
- // replace composite and set selection of tree
- IJpaStructureProvider provider = getStructureProvider(newNode);
-
- if (provider == null) {
- clearViewer();
- }
- else {
- viewer.setContentProvider(provider.buildContentProvider());
- viewer.setLabelProvider(provider.buildLabelProvider());
- viewer.setInput(newFile.getContent());
- }
- }
- }
-
- private void clearViewer() {
- viewer.setContentProvider(NullTreeContentProvider.INSTANCE);
- viewer.setLabelProvider(NullLabelProvider.INSTANCE);
- viewer.setInput(null);
- }
-
- private IJpaStructureProvider getStructureProvider(IJpaContentNode contentNode) {
- String contentId = contentNode.getJpaFile().getContentId();
- IJpaStructureProvider provider =
- (IJpaStructureProvider) structureProviders.get(contentId);
-
- if (provider == null) {
- String vendorId = contentNode.getJpaProject().getPlatform().getId();
- IJpaPlatformUi jpaPlatformUI = PlatformRegistry.INSTANCE.getJpaPlatform(vendorId);
- for (IJpaStructureProvider p : jpaPlatformUI.structureProviders()) {
- if (p.fileContentType().equals(contentId)) {
- provider = p;
- break;
- }
- }
-
- //TODO this view and the detailsProviders Map is not created on a per project basis.
- //the detailsProviders and their fileContentTypes could overlap across project, this would cause problems with storing this map.
- if (provider != null) {
- structureProviders.put(contentId, provider);
- }
- }
-
- return provider;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/CComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/CComboViewer.java
deleted file mode 100644
index f4dadd0c4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/CComboViewer.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.widgets;
-import org.eclipse.jface.viewers.AbstractListViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-//bug #69254 is why i created this class, it is a copy of ComboViwer but using a CCombo
-
-/**
- * A concrete viewer based on an SWT <code>Combo</code> control. This class is intended
- * as an alternative to the JFace <code>ListViewer</code>, which displays its content
- * in a combo box rather than a list. Wherever possible, this class attempts to behave
- * like ListViewer. <p>
- *
- * This class is designed to be instantiated with a pre-existing SWT combo control
- * and configured with a domain-specific content provider, label provider, element
- * filter (optional), and element sorter (optional).
- * </p>
- *
- * @see org.eclipse.jface.viewers.ListViewer
- * @since 3.0
- */
-public final class CComboViewer extends AbstractListViewer {
-
- /**
- * This viewer's list control.
- */
- private CCombo combo;
-
- /**
- * Creates a combo viewer on a newly-created combo control under the given parent.
- * The viewer has no input, no content provider, a default label provider,
- * no sorter, and no filters.
- *
- * @param parent the parent control
- */
- public CComboViewer(Composite parent) {
- this(parent, SWT.READ_ONLY | SWT.BORDER);
- }
-
- /**
- * Creates a combo viewer on a newly-created combo control under the given parent.
- * The combo control is created using the given SWT style bits.
- * The viewer has no input, no content provider, a default label provider,
- * no sorter, and no filters.
- *
- * @param parent the parent control
- * @param style the SWT style bits
- */
- public CComboViewer(Composite parent, int style) {
- this(new CCombo(parent, style));
- }
-
- /**
- * Creates a combo viewer on the given combo control.
- * The viewer has no input, no content provider, a default label provider,
- * no sorter, and no filters.
- *
- * @param list the combo control
- */
- public CComboViewer(CCombo list) {
- this.combo = list;
- hookControl(list);
- }
-
- protected void listAdd(String string, int index) {
- combo.add(string, index);
- }
-
- protected void listSetItem(int index, String string) {
- combo.setItem(index, string);
- }
-
- protected int[] listGetSelectionIndices() {
- return new int[] { combo.getSelectionIndex() };
- }
-
- protected int listGetItemCount() {
- return combo.getItemCount();
- }
-
- protected void listSetItems(String[] labels) {
- combo.setItems(labels);
- }
-
- protected void listRemoveAll() {
- combo.removeAll();
- }
-
- protected void listRemove(int index) {
- combo.remove(index);
- }
-
- /* (non-Javadoc)
- * Method declared on Viewer.
- */
- public Control getControl() {
- return combo;
- }
-
- /**
- * Returns this list viewer's list control.
- *
- * @return the list control
- */
- public CCombo getCombo() {
- return combo;
- }
-
- /*
- * Do nothing -- combos only display the selected element, so there is no way
- * we can ensure that the given element is visible without changing the selection.
- * Method defined on StructuredViewer.
- */
- public void reveal(Object element) {
- return;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.AbstractListViewer#listSelectAndShow(int[])
- */
- protected void listSetSelection(int[] ixs) {
- for (int idx = 0; idx < ixs.length; idx++) {
- combo.select(ixs[idx]);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.AbstractListViewer#listDeselectAll()
- */
- protected void listDeselectAll() {
- combo.deselectAll();
- combo.clearSelection();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.AbstractListViewer#listShowSelection()
- */
- protected void listShowSelection() {
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/ScrolledPageContent.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/ScrolledPageContent.java
deleted file mode 100644
index ce6d25d0d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/ScrolledPageContent.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.widgets;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.SharedScrolledComposite;
-
-//copied from package org.eclipse.jdt.internal.ui.preferences;
-public class ScrolledPageContent extends SharedScrolledComposite {
-
- private FormToolkit fToolkit;
-
- public ScrolledPageContent(Composite parent) {
- this(parent, SWT.V_SCROLL | SWT.H_SCROLL);
- }
-
- public ScrolledPageContent(Composite parent, int style) {
- super(parent, style);
-
- setFont(parent.getFont());
-
- FormColors colors= new FormColors(parent.getDisplay());
- colors.setBackground(null);
- colors.setForeground(null);
-
- fToolkit= new FormToolkit(colors);
-
- setExpandHorizontal(true);
- setExpandVertical(true);
-
- Composite body= new Composite(this, SWT.NONE);
- body.setFont(parent.getFont());
- setContent(body);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Widget#dispose()
- */
- public void dispose() {
- fToolkit.dispose();
- super.dispose();
- }
-
- public void adaptChild(Control childControl) {
- fToolkit.adapt(childControl, true, true);
- }
-
- public Composite getBody() {
- return (Composite) getContent();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/DatabaseReconnectWizardPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/DatabaseReconnectWizardPage.java
deleted file mode 100644
index 337fe0c6d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/DatabaseReconnectWizardPage.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.wizards;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.db.internal.Connection;
-import org.eclipse.jpt.db.internal.ConnectionListener;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.ConnectionProfileRepository;
-import org.eclipse.jpt.db.internal.Database;
-import org.eclipse.jpt.db.internal.JptDbPlugin;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.db.ui.internal.DTPUiTools;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.ui.PlatformUI;
-
-public class DatabaseReconnectWizardPage extends WizardPage {
- private IJpaProject jpaProject;
-
- private Connection connection;
- private ConnectionListener connectionListener;
- private DatabaseGroup databaseGroup;
-
- public DatabaseReconnectWizardPage( IJpaProject jpaProject) {
- super( "Database Settings"); //$NON-NLS-1$
- this.jpaProject = jpaProject;
- setTitle( JptUiMessages.DatabaseReconnectWizardPage_databaseConnection);
- setMessage( JptUiMessages.DatabaseReconnectWizardPage_reconnectToDatabase);
- }
-
- public void createControl( Composite parent) {
- this.setPageComplete( false);
- Composite top = this.createTopLevelComposite( parent);
- this.setControl( top);
- }
-
- protected Composite createTopLevelComposite( Composite parent) {
- Composite composite = new Composite( parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- composite.setLayout( layout);
- this.databaseGroup = new DatabaseGroup( composite);
- Dialog.applyDialogFont( parent);
- // TODO Add Help - testing
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJpaHelpContextIds.PROPERTIES_JAVA_PERSISTENCE_CONNECTION);
- return composite;
- }
-
- private Label createLabel( Composite container, int span, String text) {
- Label label = new Label( container, SWT.NONE);
- label.setText( text);
- GridData gd = new GridData();
- gd.horizontalIndent = 30;
- gd.horizontalSpan = span;
- label.setLayoutData( gd);
- return label;
- }
-
- private Combo createCombo( Composite container, boolean fillHorizontal) {
- Combo combo = new Combo( container, SWT.BORDER | SWT.SINGLE);
- if ( fillHorizontal) {
- combo.setLayoutData( new GridData( GridData.FILL_HORIZONTAL));
- }
- else {
- combo.setLayoutData( new GridData());
- }
- return combo;
- }
-
- /**
- * Initialize a grid layout with the default Dialog settings.
- */
- protected GridLayout initGridLayout( GridLayout layout, boolean margins) {
- layout.horizontalSpacing = this.convertHorizontalDLUsToPixels( IDialogConstants.HORIZONTAL_SPACING);
- layout.verticalSpacing = this.convertVerticalDLUsToPixels( IDialogConstants.VERTICAL_SPACING);
- if ( margins) {
- layout.marginWidth = this.convertHorizontalDLUsToPixels( IDialogConstants.HORIZONTAL_MARGIN);
- layout.marginHeight = this.convertVerticalDLUsToPixels( IDialogConstants.VERTICAL_MARGIN);
- }
- else {
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- }
- return layout;
- }
-
- public Collection<Table> getTables() {
- Schema schema = this.getProjectUserSchema();
- if ( schema != null && schema.getName() != null) {
- return CollectionTools.collection( schema.tables());
- }
- return Collections.<Table>emptyList();
- }
-
- private void updateGenerateEntitiesPage( Schema schema) {
- GenerateEntitiesWizard generateEntitiesWizard = (( GenerateEntitiesWizard) this.getWizard());
- generateEntitiesWizard.updatePossibleTables( CollectionTools.collection( schema.tables()));
- }
-
- public void dispose() {
- this.removeConnectionListener();
- super.dispose();
- }
-
- private void removeConnectionListener() {
- if ( this.connectionListener != null) {
- if ( this.connection != null) {
- this.connection.removeConnectionListener( this.connectionListener);
- }
- this.connectionListener = null;
- }
- }
-
-
- ConnectionProfile getProjectConnectionProfile() {
- String profileName = this.jpaProject.getDataSource().getConnectionProfileName();
- return JptDbPlugin.getDefault().getConnectionProfileRepository().profileNamed( profileName);
- }
-
- Schema getProjectUserSchema() {
- ConnectionProfile profile = this.getProjectConnectionProfile();
- return profile.getDatabase().schemaNamed( profile.getUserName());
- }
-
- // ********** member classes **********
-
- private final class DatabaseGroup {
- private final Group group;
- private final Label connectionLabel;
- private final Combo connectionCombo;
- private final Label schemaLabel;
- private final Combo schemaCombo;
- private final Label schemaInfoLabel;
-
- private Link addConnectionLink;
- private Link reconnectLink;
-
- public DatabaseGroup( Composite composite) {
- this.group = new Group( composite, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- this.group.setLayout( layout);
- this.group.setLayoutData( new GridData( GridData.FILL_HORIZONTAL));
- this.group.setText( JptUiMessages.DatabaseReconnectWizardPage_database);
- //TODO Add Help
-// PlatformUI.getWorkbench().getHelpSystem().setHelp( this.group, IDaliHelpContextIds.XXX);
- this.connectionLabel = createLabel( this.group, 1, JptUiMessages.DatabaseReconnectWizardPage_connection);
- this.connectionCombo = createCombo( this.group, true);
- this.connectionCombo.addSelectionListener( new SelectionAdapter() {
- public void widgetDefaultSelected( SelectionEvent e) {
- widgetSelected( e);
- }
-
- public void widgetSelected( SelectionEvent e) {
- handleConnectionChange();
- }
- });
- this.schemaLabel = createLabel( this.group, 1, JptUiMessages.DatabaseReconnectWizardPage_schema);
- this.schemaCombo = createCombo( this.group, true);
- this.schemaCombo.addSelectionListener( new SelectionAdapter() {
- public void widgetDefaultSelected( SelectionEvent e) {
- widgetSelected( e);
- }
-
- public void widgetSelected( SelectionEvent e) {
- handleSchemaChange();
- }
- });
- schemaInfoLabel = createLabel( this.group, 2, JptUiMessages.DatabaseReconnectWizardPage_schemaInfo);
- this.addConnectionLink = new Link( this.group, SWT.NONE);
- GridData data = new GridData( GridData.END, GridData.CENTER, false, false);
- data.horizontalSpan = 2;
- this.addConnectionLink.setLayoutData( data);
- this.addConnectionLink.setText( JptUiMessages.DatabaseReconnectWizardPage_addConnectionLink);
- this.addConnectionLink.addSelectionListener( new SelectionAdapter() {
- public void widgetSelected( SelectionEvent e) {
- openNewConnectionWizard();
- }
- });
- this.reconnectLink = new Link( this.group, SWT.NONE);
- data = new GridData( GridData.END, GridData.CENTER, false, false);
- data.horizontalSpan = 2;
- this.reconnectLink.setLayoutData( data);
- this.reconnectLink.setText( JptUiMessages.DatabaseReconnectWizardPage_reconnectLink);
- this.reconnectLink.setEnabled( false);
- this.reconnectLink.addSelectionListener( new SelectionAdapter() {
- public void widgetSelected( SelectionEvent e) {
- openConnectionProfileNamed( connectionCombo.getText());
- }
- });
- this.populateConnectionCombo();
- this.populateSchemaCombo();
- }
-
- private ConnectionProfile getConnectionProfileNamed( String profileName) {
- return JptDbPlugin.getDefault().getConnectionProfileRepository().profileNamed( profileName);
- }
-
- private Iterator<String> dtpConnectionProfileNames() {
- return JptDbPlugin.getDefault().getConnectionProfileRepository().profileNames();
- }
-
- private String getProjectConnectionProfileName() {
- return jpaProject.getDataSource().getConnectionProfileName();
- }
-
- Schema getProjectUserSchema() {
- ConnectionProfile profile = getProjectConnectionProfile();
- return profile.getDatabase().schemaNamed( profile.getUserName());
- }
-
- private void openConnectionProfileNamed( String connectionProfileName) {
- if( DatabaseReconnectWizardPage.this.connection != null) {
- DatabaseReconnectWizardPage.this.removeConnectionListener();
- }
- ConnectionProfile profile = JptDbPlugin.getDefault().getConnectionProfileRepository().profileNamed( connectionProfileName);
- profile.connect();
- DatabaseReconnectWizardPage.this.connection = profile.getConnection();
- if( DatabaseReconnectWizardPage.this.connection != null) {
- this.populateSchemaCombo();
- DatabaseReconnectWizardPage.this.connectionListener = this.buildConnectionListener();
- DatabaseReconnectWizardPage.this.connection.addConnectionListener( DatabaseReconnectWizardPage.this.connectionListener);
- }
- return;
- }
-
- private void populateConnectionCombo() {
- // clear out connection entries from previous login.
- this.connectionCombo.removeAll();
- for ( Iterator<String> i = CollectionTools.sort( this.dtpConnectionProfileNames()); i.hasNext();) {
- this.connectionCombo.add( ( String) i.next());
- }
-
- String connectionName = getProjectConnectionProfileName();
- if ( !StringTools.stringIsEmpty( connectionName)) {
- this.connectionCombo.select( connectionCombo.indexOf( connectionName));
- this.reconnectLink.setEnabled( true);
- }
- }
-
- private void handleConnectionChange() {
- this.reconnectLink.setEnabled( true);
- this.populateSchemaCombo();
- }
-
- private void handleSchemaChange() {
- ConnectionProfile connectionProfile = this.getConnectionProfileNamed( getConnectionProfileName());
- Schema schema = connectionProfile.getDatabase().schemaNamed( this.getSchemaName());
- DatabaseReconnectWizardPage.this.updateGenerateEntitiesPage( schema);
- DatabaseReconnectWizardPage.this.setPageComplete( true);
- }
-
- private void populateSchemaCombo() {
- // clear out schema entries from previous connection selection
- this.schemaCombo.removeAll();
- ConnectionProfile connectionProfile = this.getConnectionProfileNamed( getConnectionProfileName());
- for ( Iterator<String> stream = CollectionTools.sort( connectionProfile.getDatabase().schemaNames()); stream.hasNext();) {
- this.schemaCombo.add( ( String) stream.next());
- }
- // set login user name as default schema
- Schema schema = this.getProjectUserSchema();
- if ( schema != null && schema.getName() != null) {
- schema = connectionProfile.getDatabase().schemaNamed( schema.getName()); // verify schema exist
- if ( schema != null) {
- this.schemaCombo.select( this.schemaCombo.indexOf( schema.getName()));
- updateGenerateEntitiesPage( schema);
- setPageComplete( true);
- }
- }
- }
-
- private String getConnectionProfileName() {
- return this.connectionCombo.getText();
- }
-
- private String getSchemaName() {
- return this.schemaCombo.getText();
- }
-
- private void openNewConnectionWizard() {
- String addedProfileName = DTPUiTools.createNewProfile();
-
- ConnectionProfile addedProfile = ConnectionProfileRepository.instance().profileNamed( addedProfileName);
-
- if( !addedProfile.isNull()) {
- this.populateConnectionCombo();
- this.connectionCombo.select( connectionCombo.indexOf( addedProfile.getName()));
- this.handleConnectionChange();
- }
- }
-
- private ConnectionListener buildConnectionListener() {
- return new ConnectionListener() {
-
- public void modified( Connection connection) {
- // not interested to this event.
- }
-
- public boolean okToClose( Connection connection) {
- // not interested to this event.
- return true;
- }
-
- public void opened( Connection connection) {
- if( DatabaseReconnectWizardPage.this.connection.equals( connection)) {
- DatabaseGroup.this.populateSchemaCombo();
- }
- }
-
- public void aboutToClose( Connection connection) {
- if( DatabaseReconnectWizardPage.this.connection.equals( connection)) {
- DatabaseReconnectWizardPage.this.removeConnectionListener();
- }
- }
-
- public void closed( Connection connection) {
- // not interested to this event.
- }
-
- public void databaseChanged(Connection connection, final Database database) {
- // not interested to this event.
- }
-
- public void schemaChanged(Connection connection, final Schema schema) {
- // not interested to this event.
- }
-
- public void tableChanged(Connection connection, final Table table) {
- // not interested to this event.
- }
- };
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizard.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizard.java
deleted file mode 100644
index 65c7177df1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizard.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.wizards;
-
-import java.util.Collection;
-import java.util.Collections;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.gen.internal.EntityGenerator;
-import org.eclipse.jpt.gen.internal.PackageGenerator;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class GenerateEntitiesWizard extends Wizard {
-
- private IJpaProject jpaProject;
-
- private IStructuredSelection selection;
-
- /** this page is only built when the project is not connected to the db */
- private DatabaseReconnectWizardPage dbSettingsPage;
-
- private GenerateEntitiesWizardPage generateEntitiesPage;
-
- private PackageGenerator.Config packageGeneratorConfig;
-
- private EntityGenerator.Config entityGeneratorConfig;
-
- private boolean synchronizePersistenceXml;
-
- private Collection<Table> selectedTables;
-
- public GenerateEntitiesWizard( IJpaProject jpaProject, IStructuredSelection selection) {
- super();
- this.jpaProject = jpaProject;
- this.selection = selection;
- this.packageGeneratorConfig = new PackageGenerator.Config();
- this.entityGeneratorConfig = new EntityGenerator.Config();
- this.setWindowTitle( JptUiMessages.GenerateEntitiesWizard_generateEntities);
- }
-
- public void addPages() {
- super.addPages();
- if ( ! this.jpaProjectIsConnected() || ! this.projectUserSchemaExists()) {
- this.dbSettingsPage = new DatabaseReconnectWizardPage( this.jpaProject);
- this.addPage(this.dbSettingsPage);
- }
- this.generateEntitiesPage = new GenerateEntitiesWizardPage();
- this.addPage( this.generateEntitiesPage);
- this.generateEntitiesPage.init( this.selection);
- }
-
- public boolean performFinish() {
- this.packageGeneratorConfig.setPackageFragment( this.buildPackageFragment());
-
- this.entityGeneratorConfig.setConvertToCamelCase( this.generateEntitiesPage.convertToCamelCase());
- this.entityGeneratorConfig.setFieldAccessType( this.generateEntitiesPage.fieldAccessType());
- this.entityGeneratorConfig.setCollectionTypeName( this.generateEntitiesPage.getCollectionTypeName());
- this.entityGeneratorConfig.setFieldVisibility( this.generateEntitiesPage.getFieldVisibility());
- this.entityGeneratorConfig.setMethodVisibility( this.generateEntitiesPage.getMethodVisibility());
- this.entityGeneratorConfig.setGenerateGettersAndSetters( this.generateEntitiesPage.generateGettersAndSetters());
- this.entityGeneratorConfig.setGenerateDefaultConstructor( this.generateEntitiesPage.generateDefaultConstructor());
- this.entityGeneratorConfig.setSerializable( this.generateEntitiesPage.serializable());
- this.entityGeneratorConfig.setGenerateSerialVersionUID( this.generateEntitiesPage.generateSerialVersionUID());
- this.entityGeneratorConfig.setGenerateEmbeddedIdForCompoundPK( this.generateEntitiesPage.generateEmbeddedIdForCompoundPK());
- this.entityGeneratorConfig.setOverrideEntityNames( this.generateEntitiesPage.getOverrideEntityNames());
-
- this.synchronizePersistenceXml = this.generateEntitiesPage.synchronizePersistenceXml();
-
- this.selectedTables = this.generateEntitiesPage.getSelectedTables();
- return true;
- }
-
- private IPackageFragment buildPackageFragment() {
- IPackageFragmentRoot packageFragmentRoot = this.generateEntitiesPage.getPackageFragmentRoot();
- IPackageFragment packageFragment = this.generateEntitiesPage.getPackageFragment();
-
- if ( packageFragment == null) {
- packageFragment= packageFragmentRoot.getPackageFragment( ""); //$NON-NLS-1$
- }
-
- if ( packageFragment.exists()) {
- return packageFragment;
- }
-
- try {
- return packageFragmentRoot.createPackageFragment( packageFragment.getElementName(), true, null);
- }
- catch ( JavaModelException ex) {
- throw new RuntimeException( ex);
- }
- }
-
- Collection<Table> getPossibleTables() {
- if ( this.dbSettingsPage != null) {
- return this.dbSettingsPage.getTables();
- }
- return ( this.projectUserSchemaExists()) ? CollectionTools.collection( this.getProjectUserSchema().tables()) : Collections.<Table>emptyList();
- }
-
- ConnectionProfile getProjectConnectionProfile() {
- return this.jpaProject.connectionProfile();
- }
-
- IJpaProject getJpaProject(){
- return this.jpaProject;
- }
-
- Schema getProjectUserSchema() {
- ConnectionProfile profile = this.getProjectConnectionProfile();
- return profile.getDatabase().schemaNamed( profile.getUserName());
- }
-
- public PackageGenerator.Config getPackageGeneratorConfig() {
- return this.packageGeneratorConfig;
- }
-
- public EntityGenerator.Config getEntityGeneratorConfig() {
- return this.entityGeneratorConfig;
- }
-
- public Collection<Table> getSelectedTables() {
- return this.selectedTables;
- }
-
- public boolean synchronizePersistenceXml(){
- return this.synchronizePersistenceXml;
- }
-
- public boolean canFinish() {
- boolean canFinish = true;
- if ( ! this.generateEntitiesPage.isPageComplete()) {
- canFinish = false;
- }
- return canFinish;
- }
-
- private boolean jpaProjectIsConnected() {
- return this.getProjectConnectionProfile().isConnected();
- }
-
- private boolean projectUserSchemaExists() {
- return ( this.getProjectUserSchema() != null);
- }
-
- /**
- * updatePossibleTables is called when schema’s PossibleTables changed.
- * The dbSettingsPage is mainly the source of changes,
- * and the generateEntitiesPage needs to be kept in sync.
- */
- void updatePossibleTables( Collection<Table> possibleTables) {
- this.generateEntitiesPage.updateTablesListViewer( possibleTables);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizardPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizardPage.java
deleted file mode 100644
index 2a00d5cb61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizardPage.java
+++ /dev/null
@@ -1,539 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.wizards;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.util.TableLayoutComposite;
-import org.eclipse.jdt.ui.wizards.NewTypeWizardPage;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.gen.internal.EntityGenerator;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.PlatformUI;
-
-// TODO determine name collisions
-class GenerateEntitiesWizardPage extends NewTypeWizardPage {
-
- CheckboxTableViewer tableTable;
-
- private boolean convertToCamelCase = true;
- private boolean fieldAccessType = true;
- private String collectionTypeName = Set.class.getName();
- private int fieldVisibility = EntityGenerator.Config.PRIVATE;
- private int methodVisibility = EntityGenerator.Config.PUBLIC;
- private boolean generateGettersAndSetters = true;
- private boolean generateDefaultConstructor = true;
- private boolean serializable = true;
- private boolean generateSerialVersionUID = true;
- private boolean generateEmbeddedIdForCompoundPK = true;
- private boolean synchronizePersistenceXml = false;
- private Map<Table, String> overrideEntityNames;
-
- static final String[] TABLE_TABLE_COLUMN_PROPERTIES = { "table", "entityName" };
- private static final int TABLE_COLUMN_INDEX = 0;
- private static final int ENTITY_NAME_COLUMN_INDEX = 1;
-
-
- GenerateEntitiesWizardPage() {
- super(true, "Generate Entities"); //$NON-NLS-1$
- setTitle(JptUiMessages.GenerateEntitiesWizardPage_generateEntities);
- setMessage(JptUiMessages.GenerateEntitiesWizardPage_chooseEntityTable);
- }
-
- // -------- Initialization ---------
- /**
- * The wizard owning this page is responsible for calling this method with the
- * current selection. The selection is used to initialize the fields of the wizard
- * page.
- *
- * @param selection used to initialize the fields
- */
- void init(IStructuredSelection selection) {
- IJavaElement jelem= getInitialJavaElement(selection);
- initContainerPage(jelem);
- initTypePage(jelem);
- doStatusUpdate();
- }
-
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- int nColumns= 4;
- GridLayout layout = new GridLayout();
- layout.numColumns = nColumns;
- composite.setLayout(layout);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJpaHelpContextIds.DIALOG_GENERATE_ENTITIES);
-
- createContainerControls(composite, nColumns);
- createPackageControls(composite, nColumns);
-
- final Button synchronizeClassesCheckBox = new Button(composite, SWT.CHECK);
- synchronizeClassesCheckBox.setText(JptUiMessages.GenerateEntitiesWizardPage_synchronizeClasses);
- synchronizeClassesCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- setSynchronizePersistenceXml(synchronizeClassesCheckBox.getSelection());
- }
- });
-
- Group tablesGroup = new Group(composite, SWT.SHADOW_ETCHED_IN);
- tablesGroup.setLayout(new GridLayout(2, false));
- tablesGroup.setText(JptUiMessages.GenerateEntitiesWizardPage_tables);
- GridData data = new GridData();
- data.horizontalSpan = 4;
- data.verticalAlignment = SWT.FILL;
- data.horizontalAlignment = SWT.FILL;
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- tablesGroup.setLayoutData(data);
-
- createTablesSelectionControl(tablesGroup);
- createButtonComposite(tablesGroup);
-
- GenerateEntitiesWizard generateEntitiesWizard = ((GenerateEntitiesWizard)this.getWizard());
- Collection<Table> possibleTables = generateEntitiesWizard.getPossibleTables();
- initTablesSelectionControl(possibleTables);
-
- //set initial selection state of the synchronize classes checkbox
- synchronizeClassesCheckBox.setSelection(!generateEntitiesWizard.getJpaProject().isDiscoverAnnotatedClasses());
- setSynchronizePersistenceXml(synchronizeClassesCheckBox.getSelection());
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.tableTable.getControl(), IJpaHelpContextIds.DIALOG_GENERATE_ENTITIES_TABLES);
-
- setControl(composite);
- this.setPageComplete( false);
- }
-
- private void selectAllTables(){
- this.tableTable.setAllChecked(true);
- doStatusUpdate();
- }
-
- private void deselectAllTables(){
- this.tableTable.setAllChecked(false);
- doStatusUpdate();
- }
-
- private void initTablesSelectionControl(Collection<Table> possibleTables) {
- this.overrideEntityNames = new HashMap<Table, String>(possibleTables.size());
- this.tableTable.setInput(possibleTables);
- }
-
- private void createTablesSelectionControl(Composite parent) {
- TableLayoutComposite layout= new TableLayoutComposite(parent, SWT.NONE);
- addColumnLayoutData(layout);
-
- final org.eclipse.swt.widgets.Table table = new org.eclipse.swt.widgets.Table(layout, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER | SWT.CHECK);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- TableColumn tableNameColumn = new TableColumn(table, SWT.NONE, TABLE_COLUMN_INDEX);
- tableNameColumn.setText(JptUiMessages.GenerateEntitiesWizardPage_tableColumn);
- tableNameColumn.setResizable(true);
-
- TableColumn entityNameColumn = new TableColumn(table, SWT.NONE, ENTITY_NAME_COLUMN_INDEX);
- entityNameColumn.setText(JptUiMessages.GenerateEntitiesWizardPage_entityNameColumn);
- entityNameColumn.setResizable(true);
-
- GridData gd= new GridData(GridData.FILL_BOTH);
- gd.heightHint= SWTUtil.getTableHeightHint(table, 20);
- gd.widthHint = 600;
- layout.setLayoutData(gd);
-
- this.tableTable = new CheckboxTableViewer(table);
- this.tableTable.setUseHashlookup(true);
- this.tableTable.setLabelProvider(this.buildTableTableLabelProvider());
- this.tableTable.setContentProvider(this.buildTableTableContentProvider());
- this.tableTable.setSorter(new ViewerSorter() {
- public int compare(Viewer viewer, Object e1, Object e2) {
- return ((Table) e1).getName().compareTo(((Table) e2).getName());
- }
- });
-
- this.tableTable.addPostSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- handleTablesListSelectionChanged(event);
- }
- });
-
- table.addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- if (e.keyCode == SWT.F2 && e.stateMask == SWT.NONE) {
- editEntityNameIfPossible();
- e.doit= false;
- }
- }
- });
-
- this.addCellEditors();
- }
-
- private void createButtonComposite(Group tablesGroup){
-
- Composite buttonComposite = new Composite(tablesGroup, SWT.NULL);
- GridLayout buttonLayout = new GridLayout(1, false);
- buttonComposite.setLayout(buttonLayout);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.BEGINNING;
- buttonComposite.setLayoutData(data);
-
- Button selectAllButton = new Button(buttonComposite, SWT.PUSH);
- selectAllButton.setText(JptUiMessages.General_selectAll);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- selectAllButton.setLayoutData(gridData);
- selectAllButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- selectAllTables();
-
- }
- });
-
- Button deselectAllButton = new Button(buttonComposite, SWT.PUSH);
- deselectAllButton.setText(JptUiMessages.General_deselectAll);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- deselectAllButton.setLayoutData(gridData);
- deselectAllButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- deselectAllTables();
- }
- });
- }
-
-
- private void addColumnLayoutData(TableLayoutComposite layout) {
- layout.addColumnData(new ColumnWeightData(50, true));
- layout.addColumnData(new ColumnWeightData(50, true));
- }
-
- void editEntityNameIfPossible(){
- Object[] selected = ((IStructuredSelection) this.tableTable.getSelection()).toArray();
- if (selected.length != 1) {
- return;
- }
- this.tableTable.editElement(selected[0], ENTITY_NAME_COLUMN_INDEX);
- }
-
- private void addCellEditors() {
- this.tableTable.setColumnProperties(TABLE_TABLE_COLUMN_PROPERTIES);
-
- TextCellEditor[] editors = new TextCellEditor[TABLE_TABLE_COLUMN_PROPERTIES.length];
- editors[ENTITY_NAME_COLUMN_INDEX]= new TextCellEditor(this.tableTable.getTable(), SWT.SINGLE);
-
- this.tableTable.setCellEditors(editors);
- this.tableTable.setCellModifier(this.buildTableTableCellModifier());
- }
-
- void handleTablesListSelectionChanged(SelectionChangedEvent event) {
- this.setPageComplete(true);
- if ( ! this.hasTablesSelected()) {
- this.setPageComplete(false);
- }
- }
-
- private IBaseLabelProvider buildTableTableLabelProvider() {
- return new TableTableLabelProvider();
- }
-
- private IContentProvider buildTableTableContentProvider() {
- return new TableTableContentProvider();
- }
-
- private ICellModifier buildTableTableCellModifier() {
- return new TableTableCellModifier();
- }
-
- Collection<Table> getSelectedTables() {
- ArrayList<Table> selectedTables = new ArrayList<Table>();
- for (Object selectedTable : this.tableTable.getCheckedElements())
- selectedTables.add((Table) selectedTable);
- return selectedTables;
- }
-
- private boolean hasTablesSelected() {
- return (this.tableTable != null) ? (this.getSelectedTables().size() > 0) : false;
- }
-
- void updateTablesListViewer(Collection<Table> possibleTables) {
- if (this.tableTable != null) {
- this.initTablesSelectionControl(possibleTables);
- }
- }
-
- private void doStatusUpdate() {
- // status of all used components
- IStatus[] status= new IStatus[] {
- fContainerStatus,
- fPackageStatus
- };
- // the mode severe status will be displayed and the OK button enabled/disabled.
- this.updateStatus(status);
- }
-
- /**
- * Update the status line and the OK button according to the given status
- */
- protected void updateStatus(IStatus status) {
- super.updateStatus(status);
- if (this.isPageComplete() && ! this.hasTablesSelected()) {
- this.setPageComplete(false);
- }
- }
-
- String entityName(Table table) {
- String overrideEntityName = (String) this.overrideEntityNames.get(table);
- return (overrideEntityName != null) ? overrideEntityName : this.defaultEntityName(table);
- }
-
- private String defaultEntityName(Table table) {
- String entityName = table.shortJavaClassName();
- if (this.convertToCamelCase) {
- entityName = StringTools.convertUnderscoresToCamelCase(entityName);
- }
- return entityName;
- }
-
- void setOverrideEntityName(Table table, String name) {
- if (table.shortJavaClassName().equals(name)) {
- this.overrideEntityNames.remove(table);
- } else {
- this.overrideEntityNames.put(table, name);
- }
- }
-
- boolean convertToCamelCase() {
- return this.convertToCamelCase;
- }
- private void setConvertToCamelCase(boolean convertToCamelCase) {
- // TODO re-calculate the default entity names if this changes
- this.convertToCamelCase = convertToCamelCase;
- }
-
- boolean fieldAccessType() {
- return this.fieldAccessType;
- }
- private void setFieldAccessType(boolean fieldAccessType) {
- this.fieldAccessType = fieldAccessType;
- }
-
- String getCollectionTypeName() {
- return this.collectionTypeName;
- }
- private void setCollectionTypeName(String collectionTypeName) {
- this.collectionTypeName = collectionTypeName;
- }
-
- int getFieldVisibility() {
- return this.fieldVisibility;
- }
- private void setFieldVisibility(int fieldVisibility) {
- this.fieldVisibility = fieldVisibility;
- }
-
- int getMethodVisibility() {
- return this.methodVisibility;
- }
- private void setMethodVisibility(int methodVisibility) {
- this.methodVisibility = methodVisibility;
- }
-
- boolean generateGettersAndSetters() {
- return this.generateGettersAndSetters;
- }
- private void setGenerateGettersAndSetters(boolean generateGettersAndSetters) {
- this.generateGettersAndSetters = generateGettersAndSetters;
- }
-
- boolean generateDefaultConstructor() {
- return this.generateDefaultConstructor;
- }
- private void setGenerateDefaultConstructor(boolean generateDefaultConstructor) {
- this.generateDefaultConstructor = generateDefaultConstructor;
- }
-
- boolean serializable() {
- return this.serializable;
- }
- private void setSerializable(boolean serializable) {
- this.serializable = serializable;
- }
-
- boolean generateSerialVersionUID() {
- return this.generateSerialVersionUID;
- }
- private void setGenerateSerialVersionUID(boolean generateSerialVersionUID) {
- this.generateSerialVersionUID = generateSerialVersionUID;
- }
-
- boolean generateEmbeddedIdForCompoundPK() {
- return this.generateEmbeddedIdForCompoundPK;
- }
- private void setGenerateEmbeddedIdForCompoundPK(boolean generateEmbeddedIdForCompoundPK) {
- this.generateEmbeddedIdForCompoundPK = generateEmbeddedIdForCompoundPK;
- }
-
- boolean synchronizePersistenceXml() {
- return this.synchronizePersistenceXml;
- }
-
- private void setSynchronizePersistenceXml(boolean synchronizePersistenceXml){
- this.synchronizePersistenceXml = synchronizePersistenceXml;
- }
-
- /**
- * key = table
- * value = override entity name
- */
- Map<Table, String> getOverrideEntityNames() {
- return this.overrideEntityNames;
- }
-
-
- // ********** inner classes **********
-
- private class TableTableLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- TableTableLabelProvider() {
- super();
- }
-
- public String getText(Object element) {
- return ((Table) element).getName();
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- if (element == null) {
- return null;
- }
- switch (columnIndex) {
- case TABLE_COLUMN_INDEX:
- return ((Table) element).getName();
-
- case ENTITY_NAME_COLUMN_INDEX:
- return GenerateEntitiesWizardPage.this.entityName((Table) element);
- }
- throw new IllegalArgumentException("invalid column index: " + columnIndex);
- }
-
- }
-
-
- private class TableTableContentProvider implements IStructuredContentProvider {
-
- TableTableContentProvider() {
- super();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object inputElement) {
- return ((Collection) inputElement).toArray();
- }
-
- }
-
-
- private class TableTableCellModifier implements ICellModifier {
-
- TableTableCellModifier() {
- super();
- }
-
- public boolean canModify(Object element, String property) {
- return property.equals(TABLE_TABLE_COLUMN_PROPERTIES[ENTITY_NAME_COLUMN_INDEX]);
- }
-
- public Object getValue(Object element, String property) {
- if (property.equals(TABLE_TABLE_COLUMN_PROPERTIES[ENTITY_NAME_COLUMN_INDEX])) {
- return GenerateEntitiesWizardPage.this.entityName((Table) element);
- }
- return null;
- }
-
- public void modify(Object element, String property, Object value) {
- if (element instanceof TableItem) {
- element= ((TableItem) element).getData();
- }
- if ( ! (element instanceof Table)) {
- return;
- }
-
- boolean unchanged = false;
- Table table = (Table) element;
- if (property.equals(TABLE_TABLE_COLUMN_PROPERTIES[ENTITY_NAME_COLUMN_INDEX])) {
- unchanged = GenerateEntitiesWizardPage.this.entityName(table).equals(value);
- GenerateEntitiesWizardPage.this.setOverrideEntityName(table, (String) value);
- }
- if (! unchanged) {
- GenerateEntitiesWizardPage.this.tableTable.update(table, new String[] { property });
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java
deleted file mode 100644
index 225c69e19a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java
+++ /dev/null
@@ -1,528 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.wizards;
-
-import java.util.Iterator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.internal.ui.preferences.UserLibraryPreferencePage;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jpt.core.internal.JpaPlatformRegistry;
-import org.eclipse.jpt.core.internal.facet.IJpaFacetDataModelProperties;
-import org.eclipse.jpt.db.internal.ConnectionProfileRepository;
-import org.eclipse.jpt.db.ui.internal.DTPUiTools;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.JptUiIcons;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.prefs.JpaPreferencePage;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
-import org.eclipse.wst.common.project.facet.ui.internal.AbstractDataModel;
-import org.eclipse.wst.common.project.facet.ui.internal.ChangeTargetedRuntimesDataModel;
-import org.eclipse.wst.common.project.facet.ui.internal.FacetsSelectionPage;
-import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetInstallPage;
-
-public class JpaFacetWizardPage
- extends DataModelFacetInstallPage
- implements IJpaFacetDataModelProperties
-{
- private PlatformGroup platformGroup;
-
- private ConnectionGroup connectionGroup;
-
- private ClasspathConfigGroup classpathConfigGroup;
-
- private PersistentClassManagementGroup persistentClassManagementGroup;
-
- private OrmXmlGroup ormXmlGroup;
-
-
- public JpaFacetWizardPage() {
- super("jpt.jpa.facet.install.page"); //$NON-NLS-1$
- setTitle(JptUiMessages.JpaFacetWizardPage_title);
- setDescription(JptUiMessages.JpaFacetWizardPage_description);
- setImageDescriptor(JptUiPlugin.getPlugin().getImageDescriptor(JptUiIcons.JPA_WIZ_BANNER));
- }
-
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
-
- platformGroup = new PlatformGroup(composite);
- connectionGroup = new ConnectionGroup(composite);
- classpathConfigGroup = new ClasspathConfigGroup(composite);
- persistentClassManagementGroup = new PersistentClassManagementGroup(composite);
- ormXmlGroup = new OrmXmlGroup(composite);
-
- setUpRuntimeListener();
-
- Dialog.applyDialogFont(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IJpaHelpContextIds.DIALOG_JPA_FACET);
-
- return composite;
- }
-
- private void setUpRuntimeListener() {
- final ChangeTargetedRuntimesDataModel runtimeDataModel = getRuntimeDataModel();
- // must do it manually the first time
- model.setProperty(RUNTIME, runtimeDataModel.getPrimaryRuntime());
- runtimeDataModel.addListener(
- ChangeTargetedRuntimesDataModel.EVENT_PRIMARY_RUNTIME_CHANGED,
- new AbstractDataModel.IDataModelListener() {
- public void handleEvent() {
- model.setProperty(RUNTIME, runtimeDataModel.getPrimaryRuntime());
- }
- }
- );
- }
-
- private ChangeTargetedRuntimesDataModel getRuntimeDataModel() {
- // This is hacky, but unfortunately the only current way to do this
- // see bug 138074
- FacetsSelectionPage facetPage = null;
- for (IWizardPage page : getWizard().getPages()) {
- if (page instanceof FacetsSelectionPage) {
- facetPage = (FacetsSelectionPage) page;
- break;
- }
- }
- return (facetPage == null) ?
- null :
- facetPage.panel.getDataModel().getTargetedRuntimesDataModel();
- }
-
-
-
- private Label createLabel(Composite container, int span, String text) {
- Label label = new Label(container, SWT.NONE);
- label.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- label.setLayoutData(gd);
- return label;
- }
-
- private Button createButton(Composite container, int span, String text, int style) {
- Button button = new Button(container, SWT.NONE | style);
- button.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- button.setLayoutData(gd);
- return button;
- }
-
- private Combo createCombo(Composite container, int span, boolean fillHorizontal) {
- Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
- GridData gd;
- if (fillHorizontal) {
- gd = new GridData(GridData.FILL_HORIZONTAL);
- }
- else {
- gd = new GridData();
- }
- gd.horizontalSpan = span;
- combo.setLayoutData(gd);
- return combo;
- }
-
- @Override
- protected String[] getValidationPropertyNames() {
- return new String[] {
- PLATFORM_ID,
- CONNECTION,
- USE_SERVER_JPA_IMPLEMENTATION,
- JPA_LIBRARY,
- DISCOVER_ANNOTATED_CLASSES
- };
- }
-
- @Override
- public boolean isPageComplete() {
- if (! super.isPageComplete()) {
- return false;
- }
- else {
- return (model.validate().getSeverity() != IStatus.ERROR);
- }
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible) {
- setErrorMessage();
- }
- }
-
-
- private final class PlatformGroup
- {
- private final ComboViewer platformCombo;
-
-
- public PlatformGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_platformLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IJpaHelpContextIds.DIALOG_JPA_PLATFORM);
-
- platformCombo = new ComboViewer(createCombo(group, 1, true));
- platformCombo.setContentProvider(
- new IStructuredContentProvider() {
- public Object[] getElements(Object inputElement) {
- return CollectionTools.array(JpaPlatformRegistry.INSTANCE.allJpaPlatformIds());
- }
-
- public void dispose() {}
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- }
- );
- platformCombo.setLabelProvider(
- new ILabelProvider() {
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return JpaPlatformRegistry.INSTANCE.getJpaPlatformLabel((String) element);
- }
-
- public void addListener(ILabelProviderListener listener) {}
-
- public void removeListener(ILabelProviderListener listener) {}
-
- public void dispose() {}
-
- public boolean isLabelProperty(Object element, String property) {
- return true;
- }
- }
- );
- platformCombo.addSelectionChangedListener(
- new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- model.setProperty(PLATFORM_ID, ((StructuredSelection) event.getSelection()).getFirstElement());
- }
- }
- );
- // we need some input here, even if it means absolutely nothing
- platformCombo.setInput("null input");
- if (platformCombo.getElementAt(0) != null) {
- platformCombo.setSelection(new StructuredSelection(platformCombo.getElementAt(0)));
- }
- }
- }
-
-
- private final class ConnectionGroup
- {
- private final Combo connectionCombo;
-
- private Link connectionLink;
-
-
- public ConnectionGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_connectionLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IJpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE);
-
- connectionCombo = createCombo(group, 1, true);
- connectionCombo.addSelectionListener(
- new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- model.setProperty(CONNECTION, connectionCombo.getItem(connectionCombo.getSelectionIndex()));
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- }
- );
- fillConnections();
- if (connectionCombo.getItemCount() > 0) {
- connectionCombo.select(0);
- model.setProperty(CONNECTION, connectionCombo.getItem(0));
- }
- else {
- connectionCombo.clearSelection();
- model.setProperty(CONNECTION, null);
- }
-
- connectionLink = new Link(group, SWT.NONE);
- GridData data = new GridData(GridData.END, GridData.CENTER, false, false);
- data.horizontalSpan = 2;
- connectionLink.setLayoutData(data);
- connectionLink.setText(JptUiMessages.JpaFacetWizardPage_connectionLink);
- connectionLink.addSelectionListener(
- new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- openNewConnectionWizard();
- }
- }
- );
- }
-
- private void fillConnections() {
- //clear out connection entries from previous login.
- connectionCombo.removeAll();
-
- for (Iterator stream = ConnectionProfileRepository.instance().profileNames(); stream.hasNext(); ) {
- connectionCombo.add((String) stream.next());
- }
- }
-
- private String getConnectionName() {
- return connectionCombo.getText();
- }
-
- private void openNewConnectionWizard() {
- String connectionName = DTPUiTools.createNewProfile();
- if (connectionName != null) {
- fillConnections();
- model.setProperty(CONNECTION, connectionName);
- connectionCombo.select(connectionCombo.indexOf(connectionName));
- }
- }
- }
-
-
- private final class ClasspathConfigGroup
- {
- private final Button useServerLibButton;
-
- private final Button specifyLibButton;
-
- private final Combo jpaLibCombo;
-
- private final Link jpaPrefsLink;
-
- private final Link userLibsLink;
-
-
-
- public ClasspathConfigGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_jpaImplementationLabel);
- group.setLayout(new GridLayout(2, false));
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IJpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH);
-
- useServerLibButton = createButton(group, 2, JptUiMessages.JpaFacetWizardPage_userServerLibLabel, SWT.RADIO);
- useServerLibButton.addSelectionListener(
- new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- model.setBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION, true);
- }
- }
- );
-
- specifyLibButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_specifyLibLabel, SWT.RADIO);
- specifyLibButton.addSelectionListener(
- new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- model.setBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION, false);
- }
- }
- );
-
- jpaLibCombo = createCombo(group, 1, true);
- synchHelper.synchCombo(jpaLibCombo, JPA_LIBRARY, null);
-
- model.addListener(
- new IDataModelListener() {
- public void propertyChanged(DataModelEvent event) {
- if (USE_SERVER_JPA_IMPLEMENTATION.equals(event.getPropertyName())) {
- boolean useServerLib = (Boolean) event.getProperty();
- useServerLibButton.setSelection(useServerLib);
- specifyLibButton.setSelection(! useServerLib);
- jpaLibCombo.setEnabled(! useServerLib);
- }
- }
- }
- );
-
- jpaPrefsLink = new Link(group, SWT.NONE);
- GridData data = new GridData(GridData.END, GridData.CENTER, false, false);
- data.horizontalSpan = 2;
- jpaPrefsLink.setLayoutData(data);
- jpaPrefsLink.setText(JptUiMessages.JpaFacetWizardPage_jpaPrefsLink);
- jpaPrefsLink.addSelectionListener(
- new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- promptToConfigJpaPrefs();
- }
- }
- );
-
- userLibsLink = new Link(group, SWT.NONE);
- data = new GridData(GridData.END, GridData.CENTER, false, false);
- data.horizontalSpan = 2;
- userLibsLink.setLayoutData(data);
- userLibsLink.setText(JptUiMessages.JpaFacetWizardPage_userLibsLink);
- userLibsLink.addSelectionListener(
- new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- promptToConfigUserLibraries();
- }
- }
- );
- }
-
- private void promptToConfigJpaPrefs() {
- PreferenceDialog dlg =
- PreferencesUtil.createPreferenceDialogOn(
- getShell(),
- JpaPreferencePage.ID,
- new String[] {JpaPreferencePage.ID},
- null);
- dlg.open();
- model.notifyPropertyChange(JPA_LIBRARY, IDataModel.VALID_VALUES_CHG);
- model.notifyPropertyChange(JPA_LIBRARY, IDataModel.DEFAULT_CHG);
- }
-
- private void promptToConfigUserLibraries() {
- PreferenceDialog dlg =
- PreferencesUtil.createPreferenceDialogOn(
- getShell(),
- UserLibraryPreferencePage.ID,
- new String[] {UserLibraryPreferencePage.ID},
- null);
- dlg.open();
- model.notifyPropertyChange(JPA_LIBRARY, IDataModel.VALID_VALUES_CHG);
- }
- }
-
-
- private final class PersistentClassManagementGroup
- {
- private final Button discoverClassesButton;
-
- private final Button listClassesButton;
-
-
- public PersistentClassManagementGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_persistentClassManagementLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IJpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH);
-
- discoverClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_discoverClassesButton, SWT.RADIO);
- discoverClassesButton.addSelectionListener(
- new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- model.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, true);
- }
- }
- );
-
- listClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_listClassesButton, SWT.RADIO);
- listClassesButton.addSelectionListener(
- new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- model.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, false);
- }
- }
- );
-
- model.addListener(
- new IDataModelListener() {
- public void propertyChanged(DataModelEvent event) {
- if (DISCOVER_ANNOTATED_CLASSES.equals(event.getPropertyName())) {
- boolean discoverClasses = (Boolean) event.getProperty();
- discoverClassesButton.setSelection(discoverClasses);
- listClassesButton.setSelection(! discoverClasses);
- }
- }
- }
- );
- }
- }
-
-
- private final class OrmXmlGroup
- {
- private final Button createOrmXmlButton;
-
-
- public OrmXmlGroup(Composite composite) {
- Composite group = new Composite(composite, SWT.NONE);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IJpaHelpContextIds.DIALOG_CREATE_ORM);
-
- createOrmXmlButton = new Button(group, SWT.CHECK);
- createOrmXmlButton.setText(JptUiMessages.JpaFacetWizardPage_createOrmXmlButton);
- createOrmXmlButton.setSelection(model.getBooleanProperty(CREATE_ORM_XML));
- createOrmXmlButton.addSelectionListener(
- new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- model.setBooleanProperty(CREATE_ORM_XML, createOrmXmlButton.getSelection());
- }
- }
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectFirstPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectFirstPage.java
deleted file mode 100644
index 299d2ebb06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectFirstPage.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.wizards;
-
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jst.j2ee.ui.project.facet.UtilityProjectFirstPage;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class NewJpaProjectFirstPage extends UtilityProjectFirstPage
-{
- public NewJpaProjectFirstPage(IDataModel dataModel, String pageName) {
- super(dataModel, pageName);
- setTitle(JptUiMessages.NewJpaProjectWizard_firstPage_title);
- setDescription(JptUiMessages.NewJpaProjectWizard_firstPage_description);
- setInfopopID(IJpaHelpContextIds.NEW_JPA_PROJECT);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectWizard.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectWizard.java
deleted file mode 100644
index d5f83a3b49..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/NewJpaProjectWizard.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.wizards;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jpt.ui.internal.JptUiIcons;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.JptUiPlugin;
-import org.eclipse.jst.j2ee.ui.project.facet.UtilityProjectWizard;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-public class NewJpaProjectWizard extends UtilityProjectWizard {
-
- public NewJpaProjectWizard() {
- super();
- setWindowTitle(JptUiMessages.NewJpaProjectWizard_title);
- }
-
- public NewJpaProjectWizard(IDataModel model) {
- super(model);
- setWindowTitle(JptUiMessages.NewJpaProjectWizard_title);
- }
-
- // TODO - when we have a data model to add
-// protected IDataModel createDataModel() {
-// return DataModelFactory.createDataModel(new UtilityProjectCreationDataModelProvider());
-// }
-
- protected ImageDescriptor getDefaultPageImageDescriptor() {
- return JptUiPlugin.getPlugin().getImageDescriptor(JptUiIcons.JPA_WIZ_BANNER);
- }
-
- protected IFacetedProjectTemplate getTemplate() {
- return ProjectFacetsManager.getTemplate("jpt.jpa.template");
- }
-
- protected IWizardPage createFirstPage() {
- return new NewJpaProjectFirstPage(model, "first.page"); //$NON-NLS-1$
- }
-
- protected String getFinalPerspectiveID() {
- return "org.eclipse.jpt.ui.jpaPerspective";
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/JptUiXmlMessages.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/JptUiXmlMessages.java
deleted file mode 100644
index c6804dd5a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/JptUiXmlMessages.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml;
-
-import org.eclipse.osgi.util.NLS;
-
-public class JptUiXmlMessages
-{
- private static final String BUNDLE_NAME = "jpt_ui_xml"; //$NON-NLS-1$
-
- public static String PersistentTypePage_javaClassLabel;
- public static String PersistentTypePage_MetadataCompleteLabel;
- public static String PersistentTypePage_AccessLabel;
-
- public static String PersistenceUnitMetadataSection_SchemaDefault;
- public static String PersistenceUnitMetadataSection_CatalogDefault;
-
- public static String PersistentAttributePage_javaAttributeLabel;
-
- public static String XMLEntityMappingsPage_XmlMappingMetadataCompleteCheckBox;
- public static String XMLEntityMappingsPage_CascadePersistCheckBox;
- public static String XMLEntityMappingsPage_PersistenceUnitSection;
- public static String XMLEntityMappingsPage_SchemaDefault;
- public static String XMLEntityMappingsPage_SchemaNoDefaultSpecified;
- public static String XMLEntityMappingsPage_CatalogDefault;
- public static String XMLEntityMappingsPage_CatalogNoDefaultSpecified;
-
- public static String XmlSchemaChooser_SchemaChooser;
- public static String XmlCatalogChooser_CatalogChooser;
-
- public static String XmlJavaClassChooser_XmlJavaClassDialog_title;
- public static String XmlJavaClassChooser_XmlJavaClassDialog_message;
- public static String XmlPackageChooser_PackageDialog_title;
- public static String XmlPackageChooser_PackageDialog_message;
-
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, JptUiXmlMessages.class);
- }
-
- private JptUiXmlMessages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/AccessTypeComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/AccessTypeComboViewer.java
deleted file mode 100644
index 55afba9db8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/AccessTypeComboViewer.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.core.internal.AccessType;
-import org.eclipse.jpt.core.internal.mappings.InheritanceType;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.CComboViewer;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class AccessTypeComboViewer extends BaseJpaController
-{
- private AccessHolder accessHolder;
- private Adapter accessHolderListener;
-
- private CComboViewer comboViewer;
-
-
- public AccessTypeComboViewer(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- buildAccessHolderListener();
- }
-
-
- private void buildAccessHolderListener() {
- this.accessHolderListener = new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- accessHolderChanged(notification);
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent);
- this.comboViewer = new CComboViewer(combo);
- this.comboViewer.setLabelProvider(buildAccessTypeLabelProvider());
- this.comboViewer.add(AccessType.VALUES.toArray());
-
- this.comboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- AccessTypeComboViewer.this.accessTypeSelectionChanged(event.getSelection());
- }
- });
- }
-
- private IBaseLabelProvider buildAccessTypeLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- if (element == AccessType.DEFAULT) {
- return JptUiMappingsMessages.AccessTypeCombo_default;
- }
- return super.getText(element);
- }
- };
- }
-
- void accessTypeSelectionChanged(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- AccessType access = (AccessType) ((IStructuredSelection) selection).getFirstElement();
- if ( ! this.accessHolder.getAccess().equals(access)) {
- this.accessHolder.setAccess(access);
- }
- }
- }
-
- private void accessHolderChanged(Notification notification) {
- if (notification.getFeatureID(accessHolder.featureClass()) ==
- this.accessHolder.featureId()) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- }
- }
-
- @Override
- protected void engageListeners() {
- if (this.accessHolder != null && this.accessHolder.wrappedObject() != null) {
- this.accessHolder.wrappedObject().eAdapters().add(this.accessHolderListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.accessHolder != null && this.accessHolder.wrappedObject() != null) {
- this.accessHolder.wrappedObject().eAdapters().remove(this.accessHolderListener);
- }
- }
-
- public final void populate(AccessHolder accessHolder) {
- super.populate(accessHolder);
- }
-
- @Override
- public void doPopulate(EObject obj) {
- this.accessHolder = (AccessHolder) obj;
- populateCombo();
- }
-
- @Override
- protected void doPopulate() {
- populateCombo();
- }
-
- private void populateCombo() {
- if (this.accessHolder.wrappedObject() == null) {
- return;
- }
-
- AccessType access = this.accessHolder.getAccess();
-
- if (((IStructuredSelection) this.comboViewer.getSelection()).getFirstElement() != access) {
- this.comboViewer.setSelection(new StructuredSelection(access));
- }
- }
-
-
- @Override
- public Control getControl() {
- return this.comboViewer.getCombo();
- }
-
- /**
- * An interface to wrap an object that supports accessType
- * An object of this type must be passed in to populate(EObject)
- */
- public static interface AccessHolder extends EObject {
- /**
- * Return the AccessType from the wrapped object
- * @return
- */
- AccessType getAccess();
-
- /**
- * Set the AccessType on the wrapped object
- * @param accessType
- */
- void setAccess(AccessType accessType);
-
- /**
- * Return the Class of the wrapped object
- * @return
- */
- Class featureClass();
-
- /**
- * Return the feature id of accessType on the wrapped object
- * @return
- */
- int featureId();
-
- /**
- * The wrapped EObject that the accessType is stored on
- * @return
- */
- EObject wrappedObject();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CascadePersistCheckBox.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CascadePersistCheckBox.java
deleted file mode 100644
index 332079a3f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CascadePersistCheckBox.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class CascadePersistCheckBox extends BaseJpaController
-{
- private PersistenceUnitDefaults persistenceUnitDefaults;
- private Adapter persistenceUnitDefaultsListener;
-
- private Button button;
-
-
- public CascadePersistCheckBox(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- buildPeristenceUnitDefaultsListener();
- }
-
- private void buildPeristenceUnitDefaultsListener() {
- this.persistenceUnitDefaultsListener = new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- persistenceUnitDefaultsChanged(notification);
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- this.button = getWidgetFactory().createButton(
- parent,
- JptUiXmlMessages.XMLEntityMappingsPage_CascadePersistCheckBox,
- SWT.CHECK);
-
- this.button.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- CascadePersistCheckBox.this.cascadePersistSelectionChanged();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- CascadePersistCheckBox.this.cascadePersistSelectionChanged();
- }
- });
- }
-
- void cascadePersistSelectionChanged() {
- boolean cascadePersist = this.button.getSelection();
- if (this.persistenceUnitDefaults.isCascadePersist() != cascadePersist) {
- this.persistenceUnitDefaults.setCascadePersist(cascadePersist);
- }
- }
-
- private void persistenceUnitDefaultsChanged(Notification notification) {
- if (notification.getFeatureID(PersistenceUnitDefaults.class) ==
- OrmPackage.PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- }
- }
-
- @Override
- protected void engageListeners() {
- if (this.persistenceUnitDefaults != null) {
- this.persistenceUnitDefaults.eAdapters().add(this.persistenceUnitDefaultsListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.persistenceUnitDefaults != null) {
- this.persistenceUnitDefaults.eAdapters().remove(this.persistenceUnitDefaultsListener);
- }
- }
-
- @Override
- public void doPopulate(EObject obj) {
- this.persistenceUnitDefaults = (PersistenceUnitDefaults) obj;
- populateButton();
- }
-
- @Override
- protected void doPopulate() {
- populateButton();
- }
-
- private void populateButton() {
- boolean cascadePersist = false;
- if (this.persistenceUnitDefaults != null) {
- cascadePersist = this.persistenceUnitDefaults.isCascadePersist();
- }
-
- if (this.button.getSelection() != cascadePersist) {
- this.button.setSelection(cascadePersist);
- }
- }
-
-
- @Override
- public Control getControl() {
- return this.button;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CommonWidgets.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CommonWidgets.java
deleted file mode 100644
index 01e5c21461..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/CommonWidgets.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser;
-import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class CommonWidgets
-{
- public static Label buildJavaClassLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- Label label = widgetFactory.createLabel(parent, JptUiXmlMessages.PersistentTypePage_javaClassLabel);
- return label;
- }
-
- public static XmlJavaClassChooser buildJavaClassChooser(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new XmlJavaClassChooser(parent, commandStack, widgetFactory);
- }
-
- public static Label buildJavaAttributeNameLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- Label label = widgetFactory.createLabel(parent, JptUiXmlMessages.PersistentAttributePage_javaAttributeLabel);
- return label;
- }
-
- public static XmlJavaAttributeChooser buildJavaAttributeChooser(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new XmlJavaAttributeChooser(parent, commandStack, widgetFactory);
- }
-
-
- public static Label buildAccessLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiXmlMessages.PersistentTypePage_AccessLabel);
- }
-
- public static AccessTypeComboViewer buildAccessTypeComboViewer(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new AccessTypeComboViewer(parent, commandStack, widgetFactory);
- }
-
-
- public static Label buildCatalogLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiXmlMessages.XmlCatalogChooser_CatalogChooser);
- }
-
- public static StringWithDefaultChooser buildCatalogChooser(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new StringWithDefaultChooser(parent, commandStack, widgetFactory);
- }
-
-
- public static Label buildSchemaLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, JptUiXmlMessages.XmlSchemaChooser_SchemaChooser);
- }
-
- public static StringWithDefaultChooser buildSchemaChooser(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new StringWithDefaultChooser(parent, commandStack, widgetFactory);
- }
-
-
- public static Label buildPackageLabel(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- return widgetFactory.createLabel(parent, "Package:");
- }
-
- public static XmlPackageChooser buildXmlPackageChooser(
- Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- return new XmlPackageChooser(parent, commandStack, widgetFactory);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/MetaDataCompleteComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/MetaDataCompleteComboViewer.java
deleted file mode 100644
index 4d98719c2c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/MetaDataCompleteComboViewer.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping;
-import org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean;
-import org.eclipse.jpt.core.internal.mappings.InheritanceType;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.CComboViewer;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class MetaDataCompleteComboViewer extends BaseJpaController
-{
- private XmlTypeMapping mapping;
- private Adapter typeMappingListener;
-
- private CComboViewer comboViewer;
-
-
- public MetaDataCompleteComboViewer(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- buildTypeMappingListener();
- }
-
-
- private void buildTypeMappingListener() {
- this.typeMappingListener = new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- typeMappingChanged(notification);
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- CCombo combo = getWidgetFactory().createCCombo(parent);
- this.comboViewer = new CComboViewer(combo);
- this.comboViewer.setLabelProvider(buildLabelProvider());
- this.comboViewer.add(DefaultFalseBoolean.VALUES.toArray());
- this.comboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- MetaDataCompleteComboViewer.this.metadataCompleteSelectionChanged(event.getSelection());
- }
- });
- }
- private IBaseLabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- if (element == DefaultFalseBoolean.DEFAULT) {
- //TODO need to move this to the model, don't want hardcoded String
- return NLS.bind(JptUiMappingsMessages.MetaDataCompleteCombo_Default, "False");
- }
- return super.getText(element);
- }
- };
- }
-
- void metadataCompleteSelectionChanged(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- DefaultFalseBoolean metadataComplete = (DefaultFalseBoolean) ((IStructuredSelection) selection).getFirstElement();
- if ( ! this.mapping.getMetadataComplete().equals(metadataComplete)) {
- this.mapping.setMetadataComplete(metadataComplete);
-// this.editingDomain.getCommandStack().execute(
-// SetCommand.create(
-// this.editingDomain,
-// this.basicMapping,
-// OrmPackage.eINSTANCE.getBasicMapping_Optional(),
-// optional
-// )
-// );
- }
- }
- }
-
- private void typeMappingChanged(Notification notification) {
- if (notification.getFeatureID(XmlTypeMapping.class) ==
- OrmPackage.XML_TYPE_MAPPING__METADATA_COMPLETE) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- }
- }
-
- @Override
- protected void engageListeners() {
- if (this.mapping != null) {
- this.mapping.eAdapters().add(this.typeMappingListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.mapping != null) {
- this.mapping.eAdapters().remove(this.typeMappingListener);
- }
- }
-
- @Override
- public void doPopulate(EObject obj) {
- this.mapping = (XmlTypeMapping) obj;
- populateCombo();
- }
-
- @Override
- protected void doPopulate() {
- populateCombo();
- }
-
- private void populateCombo() {
- if (this.mapping == null) {
- return;
- }
-
- DefaultFalseBoolean metadataComplete = mapping.getMetadataComplete();
-
- if (((IStructuredSelection) this.comboViewer.getSelection()).getFirstElement() != metadataComplete) {
- this.comboViewer.setSelection(new StructuredSelection(metadataComplete));
- }
- }
-
-
- @Override
- public Control getControl() {
- return this.comboViewer.getCombo();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/PersistenceUnitMetadataSection.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/PersistenceUnitMetadataSection.java
deleted file mode 100644
index 253d9c91c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/PersistenceUnitMetadataSection.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.AccessType;
-import org.eclipse.jpt.core.internal.XmlEObject;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults;
-import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal;
-import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser;
-import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser.StringHolder;
-import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages;
-import org.eclipse.jpt.ui.internal.xml.details.AccessTypeComboViewer.AccessHolder;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class PersistenceUnitMetadataSection extends BaseJpaController
-{
-
- private Section section;
- private XmlMappingMetadataCompleteCheckBox xmlMappingMetadataCompleteCheckBox;
- private StringWithDefaultChooser xmlSchemaChooser;
- private StringWithDefaultChooser xmlCatalogChooser;
- private AccessTypeComboViewer accessComboViewer;
- private CascadePersistCheckBox cascadePersistCheckBox;
-
- public PersistenceUnitMetadataSection(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, commandStack, widgetFactory);
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
- this.section = getWidgetFactory().createSection(parent, SWT.FLAT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
- this.section.setText(JptUiXmlMessages.XMLEntityMappingsPage_PersistenceUnitSection);
-
- Composite persistenceUnitComposite = getWidgetFactory().createComposite(this.section);
- this.section.setClient(persistenceUnitComposite);
-
- GridLayout layout = new GridLayout(2, false);
- layout.marginWidth = 1;
- persistenceUnitComposite.setLayout(layout);
-
-
- this.xmlMappingMetadataCompleteCheckBox = buildXmlMappingMetadataCompleteCheckBox(persistenceUnitComposite);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalSpan = 2;
- this.xmlMappingMetadataCompleteCheckBox.getControl().setLayoutData(gridData);
- helpSystem.setHelp(xmlMappingMetadataCompleteCheckBox.getControl(), IJpaHelpContextIds.ENTITY_ORM_XML);
-
- CommonWidgets.buildSchemaLabel(persistenceUnitComposite, getWidgetFactory());
-
- this.xmlSchemaChooser = CommonWidgets.buildSchemaChooser(persistenceUnitComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.xmlSchemaChooser.getCombo().setLayoutData(gridData);
- helpSystem.setHelp(xmlSchemaChooser.getControl(), IJpaHelpContextIds.ENTITY_ORM_SCHEMA);
-
- CommonWidgets.buildCatalogLabel(persistenceUnitComposite, getWidgetFactory());
-
- this.xmlCatalogChooser = CommonWidgets.buildCatalogChooser(persistenceUnitComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.xmlCatalogChooser.getCombo().setLayoutData(gridData);
- helpSystem.setHelp(xmlCatalogChooser.getControl(), IJpaHelpContextIds.ENTITY_ORM_CATALOG);
-
- CommonWidgets.buildAccessLabel(persistenceUnitComposite, getWidgetFactory());
-
- this.accessComboViewer = CommonWidgets.buildAccessTypeComboViewer(persistenceUnitComposite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.accessComboViewer.getControl().setLayoutData(gridData);
- helpSystem.setHelp(accessComboViewer.getControl(), IJpaHelpContextIds.ENTITY_ORM_ACCESS);
-
-
- this.cascadePersistCheckBox = buildCascadePersistCheckBox(persistenceUnitComposite);
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalSpan = 2;
- this.cascadePersistCheckBox.getControl().setLayoutData(gridData);
- helpSystem.setHelp(cascadePersistCheckBox.getControl(), IJpaHelpContextIds.ENTITY_ORM_CASCADE);
-
- }
-
- private XmlMappingMetadataCompleteCheckBox buildXmlMappingMetadataCompleteCheckBox(Composite parent) {
- return new XmlMappingMetadataCompleteCheckBox(parent, this.commandStack, getWidgetFactory());
- }
-
- private CascadePersistCheckBox buildCascadePersistCheckBox(Composite parent) {
- return new CascadePersistCheckBox(parent, this.commandStack, getWidgetFactory());
- }
-
- @Override
- protected void engageListeners() {
- }
-
- @Override
- protected void disengageListeners() {
- }
-
- @Override
- public void doPopulate(EObject obj) {
- PersistenceUnitMetadata persistenceUnitMetadata = (PersistenceUnitMetadata) obj;
- this.xmlMappingMetadataCompleteCheckBox.populate(persistenceUnitMetadata);
- if (persistenceUnitMetadata != null) {
- this.accessComboViewer.populate(new MyAccessHolder(persistenceUnitMetadata.getPersistenceUnitDefaults()));
- this.xmlSchemaChooser.populate(new SchemaHolder(persistenceUnitMetadata.getPersistenceUnitDefaults()));
- this.xmlCatalogChooser.populate(new CatalogHolder(persistenceUnitMetadata.getPersistenceUnitDefaults()));
- this.cascadePersistCheckBox.populate(persistenceUnitMetadata.getPersistenceUnitDefaults());
- }
- else {
- this.accessComboViewer.populate(new MyAccessHolder(null));
- this.xmlSchemaChooser.populate(new SchemaHolder(null));
- this.xmlCatalogChooser.populate(new CatalogHolder(null));
- this.cascadePersistCheckBox.populate(null);
- }
- }
- private class MyAccessHolder extends XmlEObject implements AccessHolder{
-
- private PersistenceUnitDefaultsInternal persistenceUnitDefaults;
- MyAccessHolder(PersistenceUnitDefaults persistenceUnitDefaultsInternal) {
- super();
- this.persistenceUnitDefaults = (PersistenceUnitDefaultsInternal) persistenceUnitDefaultsInternal;
- }
- public void setAccess(AccessType accessType) {
- persistenceUnitDefaults.setAccess(accessType);
- }
-
- public AccessType getAccess() {
- return persistenceUnitDefaults.getAccess();
- }
-
- public Class featureClass() {
- return PersistenceUnitDefaults.class;
- }
-
- public int featureId() {
- return OrmPackage.PERSISTENCE_UNIT_DEFAULTS__ACCESS;
- }
-
- public EObject wrappedObject() {
- return this.persistenceUnitDefaults;
- }
- }
-
- private class SchemaHolder extends XmlEObject implements StringHolder {
- private PersistenceUnitDefaults persistenceUnitDefaults;
- SchemaHolder(PersistenceUnitDefaults persistenceUnitDefaults) {
- super();
- this.persistenceUnitDefaults = persistenceUnitDefaults;
- }
-
- public Class featureClass() {
- return PersistenceUnitDefaults.class;
- }
-
- public int featureId() {
- return OrmPackage.PERSISTENCE_UNIT_DEFAULTS__SCHEMA;
- }
-
- public boolean supportsDefault() {
- return false;
- }
-
- public int defaultFeatureId() {
- throw new UnsupportedOperationException();
- }
-
- public String defaultItem() {
- return JptUiXmlMessages.PersistenceUnitMetadataSection_SchemaDefault;
- }
-
- public String getString() {
- return this.persistenceUnitDefaults.getSchema();
- }
-
- public void setString(String newSchema) {
- this.persistenceUnitDefaults.setSchema(newSchema);
- }
-
- public EObject wrappedObject() {
- return this.persistenceUnitDefaults;
- }
- }
-
- private class CatalogHolder extends XmlEObject implements StringHolder {
- private PersistenceUnitDefaults persistenceUnitDefaults;
- CatalogHolder(PersistenceUnitDefaults persistenceUnitDefaults) {
- super();
- this.persistenceUnitDefaults = persistenceUnitDefaults;
- }
-
- public Class featureClass() {
- return PersistenceUnitDefaults.class;
- }
-
- public int featureId() {
- return OrmPackage.PERSISTENCE_UNIT_DEFAULTS__CATALOG;
- }
-
- public boolean supportsDefault() {
- return false;
- }
-
- public int defaultFeatureId() {
- throw new UnsupportedOperationException();
- }
-
- public String defaultItem() {
- return JptUiXmlMessages.PersistenceUnitMetadataSection_CatalogDefault;
- }
-
- public String getString() {
- return this.persistenceUnitDefaults.getCatalog();
- }
-
- public void setString(String string) {
- this.persistenceUnitDefaults.setCatalog(string);
- }
-
- public EObject wrappedObject() {
- return this.persistenceUnitDefaults;
- }
-
- }
-
- @Override
- protected void doPopulate() {
- this.xmlMappingMetadataCompleteCheckBox.populate();
- this.xmlSchemaChooser.populate();
- this.xmlCatalogChooser.populate();
- this.accessComboViewer.populate();
- this.cascadePersistCheckBox.populate();
- }
-
- @Override
- public void dispose() {
- this.xmlMappingMetadataCompleteCheckBox.dispose();
- this.xmlSchemaChooser.dispose();
- this.xmlCatalogChooser.dispose();
- this.accessComboViewer.dispose();
- this.cascadePersistCheckBox.dispose();
- super.dispose();
- }
-
- public Section getSection() {
- return this.section;
- }
-
- @Override
- public Control getControl() {
- return getSection();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlDetailsProvider.java
deleted file mode 100644
index 0bcd70ded8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlDetailsProvider.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.details;
-
-import org.eclipse.jpt.core.internal.JptCorePlugin;
-import org.eclipse.jpt.core.internal.content.orm.IXmlContentNodes;
-import org.eclipse.jpt.ui.internal.details.IJpaDetailsPage;
-import org.eclipse.jpt.ui.internal.details.IJpaDetailsProvider;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class XmlDetailsProvider
- implements IJpaDetailsProvider
-{
- public XmlDetailsProvider() {
- super();
- }
-
- public String fileContentType() {
- return JptCorePlugin.ORM_XML_CONTENT_TYPE;
- }
-
- public IJpaDetailsPage buildDetailsPage(
- Composite parentComposite, Object contentNodeId, TabbedPropertySheetWidgetFactory widgetFactory) {
- if (contentNodeId.equals(IXmlContentNodes.ENTITY_MAPPINGS_ID)) {
- return new XmlEntityMappingsDetailsPage(parentComposite, widgetFactory);
- }
- else if (contentNodeId.equals(IXmlContentNodes.PERSISTENT_TYPE_ID)) {
- return new XmlPersistentTypeDetailsPage(parentComposite, widgetFactory);
- }
- else if (contentNodeId.equals(IXmlContentNodes.PERSISTENT_ATTRIBUTE_ID)) {
- return new XmlPersistentAttributeDetailsPage(parentComposite, widgetFactory);
- }
-
- return null;
- }
-
- public void dispose() {
- // no op ... for now
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlEntityMappingsDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlEntityMappingsDetailsPage.java
deleted file mode 100644
index b70bde8825..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlEntityMappingsDetailsPage.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.details;
-
-import org.eclipse.emf.common.command.BasicCommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.AccessType;
-import org.eclipse.jpt.core.internal.IJpaContentNode;
-import org.eclipse.jpt.core.internal.XmlEObject;
-import org.eclipse.jpt.core.internal.content.orm.EntityMappings;
-import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.BaseJpaDetailsPage;
-import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser;
-import org.eclipse.jpt.ui.internal.mappings.details.StringWithDefaultChooser.StringHolder;
-import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages;
-import org.eclipse.jpt.ui.internal.xml.details.AccessTypeComboViewer.AccessHolder;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class XmlEntityMappingsDetailsPage extends BaseJpaDetailsPage
-{
- private EntityMappings entityMappings;
-
- private XmlPackageChooser xmlPackageChooser;
-
- private StringWithDefaultChooser xmlSchemaChooser;
-
- private StringWithDefaultChooser xmlCatalogChooser;
-
- private AccessTypeComboViewer accessComboViewer;
-
- private PersistenceUnitMetadataSection persistenceUnitMetadataSection;
-
- public XmlEntityMappingsDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, new BasicCommandStack(), widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
- GridLayout layout = new GridLayout(2, false);
- layout.horizontalSpacing = 6;
- composite.setLayout(layout);
-
- GridData gridData;
-
- CommonWidgets.buildPackageLabel(composite, getWidgetFactory());
-
- this.xmlPackageChooser = CommonWidgets.buildXmlPackageChooser(composite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.xmlPackageChooser.getControl().setLayoutData(gridData);
- helpSystem.setHelp(xmlPackageChooser.getControl(), IJpaHelpContextIds.ENTITY_ORM_PACKAGE);
-
-
- CommonWidgets.buildSchemaLabel(composite, getWidgetFactory());
-
- this.xmlSchemaChooser = CommonWidgets.buildSchemaChooser(composite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.xmlSchemaChooser.getCombo().setLayoutData(gridData);
- helpSystem.setHelp(xmlSchemaChooser.getControl(), IJpaHelpContextIds.ENTITY_ORM_SCHEMA);
-
-
- CommonWidgets.buildCatalogLabel(composite, getWidgetFactory());
-
- this.xmlCatalogChooser = CommonWidgets.buildCatalogChooser(composite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.xmlCatalogChooser.getCombo().setLayoutData(gridData);
- helpSystem.setHelp(xmlCatalogChooser.getControl(), IJpaHelpContextIds.ENTITY_ORM_CATALOG);
-
-
- CommonWidgets.buildAccessLabel(composite, getWidgetFactory());
-
- this.accessComboViewer = CommonWidgets.buildAccessTypeComboViewer(composite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.accessComboViewer.getControl().setLayoutData(gridData);
- helpSystem.setHelp(accessComboViewer.getControl(), IJpaHelpContextIds.ENTITY_ORM_ACCESS);
-
- this.persistenceUnitMetadataSection = new PersistenceUnitMetadataSection(composite, this.commandStack, getWidgetFactory());
-
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalSpan = 2;
- this.persistenceUnitMetadataSection.getSection().setLayoutData(gridData);
- }
-
-
- @Override
- protected void doPopulate(IJpaContentNode contentNode) {
- this.entityMappings = (EntityMappings) contentNode;
- this.xmlPackageChooser.populate(this.entityMappings);
- this.xmlSchemaChooser.populate(new SchemaHolder(this.entityMappings));
- this.xmlCatalogChooser.populate(new CatalogHolder(this.entityMappings));
- this.accessComboViewer.populate(new MyAccessHolder(this.entityMappings));
- if (this.entityMappings != null) {
- this.persistenceUnitMetadataSection.populate(this.entityMappings.getPersistenceUnitMetadata());
- }
- else {
- this.persistenceUnitMetadataSection.populate(null);
- }
- }
-
- @Override
- protected void doPopulate() {
- this.xmlPackageChooser.populate();
- this.xmlSchemaChooser.populate();
- this.xmlCatalogChooser.populate();
- this.accessComboViewer.populate();
- this.persistenceUnitMetadataSection.populate();
- }
-
- @Override
- public void dispose() {
- this.xmlPackageChooser.dispose();
- this.xmlSchemaChooser.dispose();
- this.xmlCatalogChooser.dispose();
- this.accessComboViewer.dispose();
- this.persistenceUnitMetadataSection.dispose();
- super.dispose();
- }
-
- @Override
- protected void engageListeners() {
- }
-
- @Override
- protected void disengageListeners() {
- }
-
-
- private class MyAccessHolder extends XmlEObject implements AccessHolder{
-
- private EntityMappingsInternal entityMappings;
- MyAccessHolder(EntityMappings entityMappings) {
- super();
- this.entityMappings = (EntityMappingsInternal) entityMappings;
- }
- public void setAccess(AccessType accessType) {
- entityMappings.setSpecifiedAccess(accessType);
- }
-
- public AccessType getAccess() {
- return entityMappings.getSpecifiedAccess();
- }
-
- public Class featureClass() {
- return EntityMappingsInternal.class;
- }
-
- public int featureId() {
- return OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_ACCESS;
- }
-
- public EObject wrappedObject() {
- return this.entityMappings;
- }
-
- }
-
- private class SchemaHolder extends XmlEObject implements StringHolder {
- private EntityMappingsInternal entityMappings;
- SchemaHolder(EntityMappings entityMappings) {
- super();
- this.entityMappings = (EntityMappingsInternal) entityMappings;
- }
-
- public Class featureClass() {
- return EntityMappingsInternal.class;
- }
-
- public int featureId() {
- return OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_SCHEMA;
- }
-
- public boolean supportsDefault() {
- return true;
- }
-
- public int defaultFeatureId() {
- return OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_SCHEMA;
- }
-
- public String defaultItem() {
- String defaultSchema = this.entityMappings.getDefaultSchema();
- if (defaultSchema != null) {
- return NLS.bind(JptUiXmlMessages.XMLEntityMappingsPage_SchemaDefault, defaultSchema);
- }
- return JptUiXmlMessages.XMLEntityMappingsPage_SchemaNoDefaultSpecified;
- }
-
- public String getString() {
- return this.entityMappings.getSpecifiedSchema();
- }
-
- public void setString(String newSchema) {
- this.entityMappings.setSpecifiedSchema(newSchema);
- }
-
- public EObject wrappedObject() {
- return this.entityMappings;
- }
- }
-
- private class CatalogHolder extends XmlEObject implements StringHolder {
- private EntityMappingsInternal entityMappings;
- CatalogHolder(EntityMappings entityMappings) {
- super();
- this.entityMappings = (EntityMappingsInternal) entityMappings;
- }
-
- public Class featureClass() {
- return EntityMappingsInternal.class;
- }
-
- public int featureId() {
- return OrmPackage.ENTITY_MAPPINGS_INTERNAL__SPECIFIED_CATALOG;
- }
-
- public boolean supportsDefault() {
- return true;
- }
-
- public int defaultFeatureId() {
- return OrmPackage.ENTITY_MAPPINGS_INTERNAL__DEFAULT_CATALOG;
- }
-
- public String defaultItem() {
- String defaultCatalog = this.entityMappings.getDefaultCatalog();
- if (defaultCatalog != null) {
- return NLS.bind(JptUiXmlMessages.XMLEntityMappingsPage_CatalogDefault, defaultCatalog);
- }
- return JptUiXmlMessages.XMLEntityMappingsPage_CatalogNoDefaultSpecified;
- }
-
- public String getString() {
- return this.entityMappings.getSpecifiedCatalog();
- }
-
- public void setString(String newCatalog) {
- this.entityMappings.setSpecifiedCatalog(newCatalog);
- }
-
- public EObject wrappedObject() {
- return this.entityMappings;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaAttributeChooser.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaAttributeChooser.java
deleted file mode 100644
index 8f58be68b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaAttributeChooser.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class XmlJavaAttributeChooser extends BaseJpaController
-{
- private XmlPersistentAttribute attribute;
- private Adapter persistentAttributeListener;
-
- private Text text;
-
-
- public XmlJavaAttributeChooser(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- buildPersistentAttributeListener();
- }
-
-
- private void buildPersistentAttributeListener() {
- this.persistentAttributeListener = new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- persistentAttributeChanged(notification);
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- text = getWidgetFactory().createText(parent, "");
- text.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- textModified(e);
- }
- });
- }
-
- private void textModified(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
-
- String text = ((Text) e.getSource()).getText();
- attribute.setName(text);
-
- // TODO Does this need to be done?
- //this.editingDomain.getCommandStack().execute(SetCommand.create(this.editingDomain, this.entity, MappingsPackage.eINSTANCE.getEntity_SpecifiedName(), text));
- }
-
- private void persistentAttributeChanged(Notification notification) {
- if (notification.getFeatureID(XmlAttributeMapping.class) ==
- OrmPackage.XML_PERSISTENT_ATTRIBUTE__NAME) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- }
- }
-
- @Override
- protected void engageListeners() {
- if (attribute != null) {
- attribute.eAdapters().add(persistentAttributeListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (attribute != null) {
- attribute.eAdapters().remove(persistentAttributeListener);
- }
- }
-
- @Override
- public void doPopulate(EObject obj) {
- attribute = (obj == null) ? null : ((XmlAttributeMapping) obj).getPersistentAttribute();
- populateText();
- }
-
- @Override
- protected void doPopulate() {
- populateText();
- }
-
- private void populateText() {
- if (attribute == null) {
- text.clearSelection();
- return;
- }
-
- String name = attribute.getName();
-
- if (name == null) {
- name = "";
- }
- setTextData(name);
- }
-
- private void setTextData(String textData) {
- if (! textData.equals(text.getText())) {
- text.setText(textData);
- }
- }
-
- public Control getControl() {
- return text;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaClassChooser.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaClassChooser.java
deleted file mode 100644
index 43fead2876..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlJavaClassChooser.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.details;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssistHelper;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType;
-import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping;
-import org.eclipse.jpt.ui.internal.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.IProgressService;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-//TODO possibly help the user and if they have chosen a package at the entity-mappings level
-//only insert the class name in the xml file if they choose a class from the package.
-//Not sure if this should be driven by the UI or by ui api in the model
-public class XmlJavaClassChooser extends BaseJpaController
-{
- private XmlPersistentType persistentType;
- private Adapter persistentTypeListener;
-
- private Composite composite;
- private Text text;
- private JavaTypeCompletionProcessor javaTypeCompletionProcessor;
-
- public XmlJavaClassChooser(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- buildPersistentTypeListener();
- }
-
-
- private void buildPersistentTypeListener() {
- persistentTypeListener = new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- persistentTypeChanged(notification);
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- this.composite = getWidgetFactory().createComposite(parent);
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 1;
- gridLayout.numColumns = 2;
- this.composite.setLayout(gridLayout);
-
- text = getWidgetFactory().createText(this.composite, "");
- GridData data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- this.text.setLayoutData(data);
- text.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- textModified(e);
- }
- });
-
- //TODO bug 156185 - when this is fixed there should be api for this
- this.javaTypeCompletionProcessor = new JavaTypeCompletionProcessor(false, false);
- ControlContentAssistHelper.createTextContentAssistant(this.text, this.javaTypeCompletionProcessor);
-
-
- Button browseButton = getWidgetFactory().createButton(this.composite, "Browse...", SWT.FLAT);
- data = new GridData();
- browseButton.setLayoutData(data);
- browseButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- IType type = chooseType();
- if (type != null) {
- text.setText(type.getFullyQualifiedName());
- }
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- IType type = chooseType();
- if (type != null) {
- text.setText(type.getFullyQualifiedName());
- }
- }
- });
-
- }
-
- private void textModified(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
-
- String text = ((Text) e.getSource()).getText();
- persistentType.setClass(text);
-
- // TODO Does this need to be done?
- //this.editingDomain.getCommandStack().execute(SetCommand.create(this.editingDomain, this.entity, MappingsPackage.eINSTANCE.getEntity_SpecifiedName(), text));
- }
-
-
- protected IType chooseType() {
- IPackageFragmentRoot root= getPackageFragmentRoot();
- if (root == null) {
- return null;
- }
-
- IJavaElement[] elements= new IJavaElement[] { root.getJavaProject() };
- IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements);
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
-
- SelectionDialog typeSelectionDialog;
- try {
- typeSelectionDialog = JavaUI.createTypeDialog(this.text.getShell(), service, scope, IJavaElementSearchConstants.CONSIDER_CLASSES, false, getType());
- }
- catch (JavaModelException e) {
- JptUiPlugin.log(e);
- throw new RuntimeException(e);
- }
- typeSelectionDialog.setTitle(JptUiXmlMessages.XmlJavaClassChooser_XmlJavaClassDialog_title);
- typeSelectionDialog.setMessage(JptUiXmlMessages.XmlJavaClassChooser_XmlJavaClassDialog_message);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
- return null;
- }
-
- private String getType() {
- return this.text.getText();
- }
-
- private IPackageFragmentRoot getPackageFragmentRoot() {
- IProject project = this.persistentType.getJpaProject().getProject();
- IJavaProject root = JavaCore.create(project);
- try {
- return root.getAllPackageFragmentRoots()[0];
- }
- catch (JavaModelException e) {
- JptUiPlugin.log(e);
- }
- return null;
- }
-
- private void persistentTypeChanged(Notification notification) {
- if (notification.getFeatureID(XmlPersistentType.class) ==
- OrmPackage.XML_PERSISTENT_TYPE__CLASS) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- }
- }
-
- @Override
- protected void engageListeners() {
- if (persistentType != null) {
- persistentType.eAdapters().add(persistentTypeListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (persistentType != null) {
- persistentType.eAdapters().remove(persistentTypeListener);
- }
- }
-
- @Override
- public void doPopulate(EObject obj) {
- persistentType = (obj == null) ? null : ((XmlTypeMapping) obj).getPersistentType();
- populateText();
- }
-
- @Override
- protected void doPopulate() {
- populateText();
- }
-
- private void populateText() {
- if (persistentType == null) {
- text.clearSelection();
- return;
- }
-
- IPackageFragmentRoot root = getPackageFragmentRoot();
- if (root != null) {
- this.javaTypeCompletionProcessor.setPackageFragment(root.getPackageFragment(""));
- }
-
-
- String javaClass = persistentType.getClass_();
-
- if (javaClass == null) {
- setTextData("");
- }
- else {
- setTextData(javaClass);
- }
- }
-
- private void setTextData(String textData) {
- if (! textData.equals(text.getText())) {
- text.setText(textData);
- }
- }
-
- public Control getControl() {
- return this.composite;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlMappingMetadataCompleteCheckBox.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlMappingMetadataCompleteCheckBox.java
deleted file mode 100644
index 5cdd03801e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlMappingMetadataCompleteCheckBox.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.details;
-
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class XmlMappingMetadataCompleteCheckBox extends BaseJpaController
-{
- private PersistenceUnitMetadata persistenceUnitMetadata;
- private Adapter persistenceUnitMetadataListener;
-
- private Button button;
-
-
- public XmlMappingMetadataCompleteCheckBox(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- buildPeristenceUnitMetadataListener();
- }
-
- private void buildPeristenceUnitMetadataListener() {
- this.persistenceUnitMetadataListener = new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- persistenceUnitMetadataChanged(notification);
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- this.button = getWidgetFactory().createButton(
- parent,
- JptUiXmlMessages.XMLEntityMappingsPage_XmlMappingMetadataCompleteCheckBox,
- SWT.CHECK);
-
- this.button.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- XmlMappingMetadataCompleteCheckBox.this.xmlMappingMetadataCompleteSelectionChanged();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- XmlMappingMetadataCompleteCheckBox.this.xmlMappingMetadataCompleteSelectionChanged();
- }
- });
- }
-
- void xmlMappingMetadataCompleteSelectionChanged() {
- boolean xmlMappingMetadataComplete = this.button.getSelection();
- if (this.persistenceUnitMetadata.isXmlMappingMetadataComplete() != xmlMappingMetadataComplete) {
- this.persistenceUnitMetadata.setXmlMappingMetadataComplete(xmlMappingMetadataComplete);
- }
- }
-
- private void persistenceUnitMetadataChanged(Notification notification) {
- if (notification.getFeatureID(PersistenceUnitMetadata.class) ==
- OrmPackage.PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- }
- }
-
- @Override
- protected void engageListeners() {
- if (this.persistenceUnitMetadata != null) {
- this.persistenceUnitMetadata.eAdapters().add(this.persistenceUnitMetadataListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.persistenceUnitMetadata != null) {
- this.persistenceUnitMetadata.eAdapters().remove(this.persistenceUnitMetadataListener);
- }
- }
-
- @Override
- public void doPopulate(EObject obj) {
- this.persistenceUnitMetadata = (PersistenceUnitMetadata) obj;
- populateButton();
- }
-
- @Override
- protected void doPopulate() {
- populateButton();
- }
-
- private void populateButton() {
- boolean xmlMappingMetadataComplete = false;
- if (this.persistenceUnitMetadata != null) {
- xmlMappingMetadataComplete = this.persistenceUnitMetadata.isXmlMappingMetadataComplete();
- }
-
- if (this.button.getSelection() != xmlMappingMetadataComplete) {
- this.button.setSelection(xmlMappingMetadataComplete);
- }
- }
-
-
- @Override
- public Control getControl() {
- return this.button;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPackageChooser.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPackageChooser.java
deleted file mode 100644
index fbaf451347..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPackageChooser.java
+++ /dev/null
@@ -1,255 +0,0 @@
- /*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.details;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssistHelper;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaPackageCompletionProcessor;
-import org.eclipse.jdt.ui.JavaElementLabelProvider;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.core.internal.XmlEObject;
-import org.eclipse.jpt.core.internal.content.orm.EntityMappings;
-import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.ui.internal.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.details.BaseJpaController;
-import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class XmlPackageChooser extends BaseJpaController
-{
- private EntityMappingsInternal entityMappings;
- private Adapter entityMappingsListener;
- private IContentAssistProcessor contentAssistProcessor;
-
- private Composite composite;
- private Text text;
-
-
- public XmlPackageChooser(Composite parent, CommandStack theCommandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, theCommandStack, widgetFactory);
- buildSchemaHolderListener();
- }
-
-
- private void buildSchemaHolderListener() {
- this.entityMappingsListener = new AdapterImpl() {
- public void notifyChanged(Notification notification) {
- entityMappingsChanged(notification);
- }
- };
- }
-
- @Override
- protected void buildWidget(Composite parent) {
- this.composite = getWidgetFactory().createComposite(parent);
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 1;
- gridLayout.numColumns = 2;
- this.composite.setLayout(gridLayout);
- this.text = getWidgetFactory().createText(this.composite, "");
- GridData data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- this.text.setLayoutData(data);
- this.contentAssistProcessor = new JavaPackageCompletionProcessor(new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_ROOT));
- ControlContentAssistHelper.createTextContentAssistant(this.text, this.contentAssistProcessor);
-
- this.text.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- textModified(e);
- }
- });
-
- Button browseButton = getWidgetFactory().createButton(this.composite, "Browse...", SWT.FLAT);
- data = new GridData();
- browseButton.setLayoutData(data);
- browseButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- IPackageFragment packageFragment = choosePackage();
- if (packageFragment != null) {
- text.setText(packageFragment.getElementName());
- }
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- IPackageFragment packageFragment = choosePackage();
- if (packageFragment != null) {
- text.setText(packageFragment.getElementName());
- }
- }
- });
- }
-
- private void textModified(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
-
- String text = ((Text) e.getSource()).getText();
- this.entityMappings.setPackage(text);
- //TODO set a JEM Package??
- //.setJavaClass(JavaRefFactory.eINSTANCE.createClassRef(text));
-
- // TODO Does this need to be done?
- //this.editingDomain.getCommandStack().execute(SetCommand.create(this.editingDomain, this.entity, MappingsPackage.eINSTANCE.getEntity_SpecifiedName(), text));
- }
-
- private void entityMappingsChanged(Notification notification) {
- if (notification.getFeatureID(EntityMappings.class) ==
- OrmPackage.ENTITY_MAPPINGS__PACKAGE) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- populate();
- }
- });
- }
- }
-
- @Override
- protected void engageListeners() {
- if (this.entityMappings != null) {
- entityMappings.eAdapters().add(this.entityMappingsListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.entityMappings != null) {
- this.entityMappings.eAdapters().remove(this.entityMappingsListener);
- }
- }
-
- @Override
- public void doPopulate(EObject obj) {
- this.entityMappings = (EntityMappingsInternal) obj;
- populateText();
- }
-
- @Override
- protected void doPopulate() {
- populateText();
- }
-
- private void populateText() {
- if (entityMappings == null) {
- text.clearSelection();
- return;
- }
-
- IPackageFragmentRoot root = getPackageFragmentRoot();
- if (root != null) {
- ((JavaPackageCompletionProcessor)this.contentAssistProcessor).setPackageFragmentRoot(root);
- }
-
- String package_ = this.entityMappings.getPackage();
-
- if (package_ == null) {
- setTextData("");
- }
- else {
- setTextData(package_);
- }
- }
-
- private IPackageFragmentRoot getPackageFragmentRoot() {
- IProject project = ((XmlEObject) this.entityMappings).getJpaProject().getProject();
- IJavaProject root = JavaCore.create(project);
- try {
- return root.getAllPackageFragmentRoots()[0];
- }
- catch (JavaModelException e) {
- JptUiPlugin.log(e);
- }
- return null;
- }
-
- private void setTextData(String textData) {
- if (! textData.equals(text.getText())) {
- text.setText(textData);
- }
- }
-
- @Override
- public Control getControl() {
- return this.composite;
- }
-
- /**
- * Opens a selection dialog that allows to select a package.
- *
- * @return returns the selected package or <code>null</code> if the dialog has been canceled.
- * The caller typically sets the result to the package input field.
- * <p>
- * Clients can override this method if they want to offer a different dialog.
- * </p>
- *
- * @since 3.2
- */
- protected IPackageFragment choosePackage() {
- SelectionDialog selectionDialog;
- try {
- selectionDialog = JavaUI.createPackageDialog(text.getShell(), getPackageFragmentRoot());
- }
- catch (JavaModelException e) {
- JptUiPlugin.log(e);
- throw new RuntimeException(e);
- }
- selectionDialog.setTitle(JptUiXmlMessages.XmlPackageChooser_PackageDialog_title);
- selectionDialog.setMessage(JptUiXmlMessages.XmlPackageChooser_PackageDialog_message);
- selectionDialog.setHelpAvailable(false);
- IPackageFragment pack= getPackageFragment();
- if (pack != null) {
- selectionDialog.setInitialSelections(new Object[] { pack });
- }
-
- if (selectionDialog.open() == Window.OK) {
- return (IPackageFragment) selectionDialog.getResult()[0];
- }
- return null;
- }
-
- /**
- * Returns the package fragment corresponding to the current input.
- *
- * @return a package fragment or <code>null</code> if the input
- * could not be resolved.
- */
- public IPackageFragment getPackageFragment() {
- String packageString = this.text.getText();
- return getPackageFragmentRoot().getPackageFragment(packageString);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentAttributeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentAttributeDetailsPage.java
deleted file mode 100644
index 36194e5b66..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentAttributeDetailsPage.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.details;
-
-import java.util.Iterator;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.jpt.core.internal.IJpaContentNode;
-import org.eclipse.jpt.core.internal.IPersistentType;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType;
-import org.eclipse.jpt.ui.internal.details.PersistentAttributeDetailsPage;
-import org.eclipse.jpt.ui.internal.widgets.CComboViewer;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class XmlPersistentAttributeDetailsPage
- extends PersistentAttributeDetailsPage
-{
- private XmlJavaAttributeChooser javaAttributeChooser;
-
- private Adapter persistentTypeListener;
-
- private IPersistentType persistentType;
-
- public XmlPersistentAttributeDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, widgetFactory);
- buildPersistentTypeListener();
- }
-
- private void buildPersistentTypeListener() {
- this.persistentTypeListener = new AdapterImpl() {
- @Override
- public void notifyChanged(Notification notification) {
- persistentTypeChanged(notification);
- }
- };
- }
-
- void persistentTypeChanged(Notification notification) {
- if (notification.getFeatureID(XmlPersistentType.class) ==
- OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_ATTRIBUTE_MAPPINGS) {
- Display.getDefault().asyncExec(
- new Runnable() {
- public void run() {
- updateEnbabledState();
- }
- });
- }
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- composite.setLayout(new GridLayout(2, false));
-
- GridData gridData;
-
- CommonWidgets.buildJavaAttributeNameLabel(composite, getWidgetFactory());
-
- this.javaAttributeChooser = CommonWidgets.buildJavaAttributeChooser(composite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.javaAttributeChooser.getControl().setLayoutData(gridData);
-
-
- buildMappingLabel(composite);
-
- CComboViewer mappingCombo = buildMappingCombo(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- mappingCombo.getCombo().setLayoutData(gridData);
-
- PageBook book = buildMappingPageBook(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalSpan = 2;
- book.setLayoutData(gridData);
- }
-
- @Override
- protected void engageListeners() {
- super.engageListeners();
- if (getAttribute() != null) {
- this.persistentType = getAttribute().typeMapping().getPersistentType();
- this.persistentType.eAdapters().add(this.persistentTypeListener);
- }
- }
-
- @Override
- protected void disengageListeners() {
- if (this.persistentType != null) {
- this.persistentType.eAdapters().remove(this.persistentTypeListener);
- this.persistentType = null;
- }
- super.disengageListeners();
- }
-
- @Override
- protected void doPopulate(IJpaContentNode persistentAttributeNode) {
- super.doPopulate(persistentAttributeNode);
- if (persistentAttributeNode == null) {
- this.javaAttributeChooser.populate(null);
- }
- else {
- XmlAttributeMapping mapping = ((XmlPersistentAttribute) persistentAttributeNode).getMapping();
- this.javaAttributeChooser.populate(mapping);
- updateEnbabledState();
- }
- }
-
- @Override
- protected void doPopulate() {
- super.doPopulate();
- this.javaAttributeChooser.populate();
- updateEnbabledState();
- }
-
- @Override
- public void dispose() {
- this.javaAttributeChooser.dispose();
- super.dispose();
- }
-
- public void updateEnbabledState() {
- if (getAttribute() == null || getAttribute().eContainer() == null) {
- return;
- }
- boolean enabled = !((XmlPersistentAttribute) getAttribute()).isVirtual();
- updateEnabledState(enabled, getControl());
- }
-
- public void updateEnabledState(boolean enabled, Control control) {
- control.setEnabled(enabled);
- if (control instanceof Composite) {
- for (Iterator<Control> i = new ArrayIterator<Control>(((Composite) control).getChildren()); i.hasNext(); ) {
- updateEnabledState(enabled, i.next());
- }
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentTypeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentTypeDetailsPage.java
deleted file mode 100644
index 3c615476dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/details/XmlPersistentTypeDetailsPage.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.details;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.internal.AccessType;
-import org.eclipse.jpt.core.internal.IJpaContentNode;
-import org.eclipse.jpt.core.internal.XmlEObject;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType;
-import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping;
-import org.eclipse.jpt.ui.internal.details.PersistentTypeDetailsPage;
-import org.eclipse.jpt.ui.internal.java.details.ITypeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.EmbeddableUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.EntityUiProvider;
-import org.eclipse.jpt.ui.internal.java.mappings.properties.MappedSuperclassUiProvider;
-import org.eclipse.jpt.ui.internal.widgets.CComboViewer;
-import org.eclipse.jpt.ui.internal.xml.JptUiXmlMessages;
-import org.eclipse.jpt.ui.internal.xml.details.AccessTypeComboViewer.AccessHolder;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class XmlPersistentTypeDetailsPage extends PersistentTypeDetailsPage
-{
- private XmlJavaClassChooser javaClassChooser;
-
- private MetaDataCompleteComboViewer metadataCompleteComboViewer;
-
- private AccessTypeComboViewer accessComboViewer;
-
- public XmlPersistentTypeDetailsPage(Composite parent, TabbedPropertySheetWidgetFactory widgetFactory) {
- super(parent, widgetFactory);
- }
-
- protected Collection<ITypeMappingUiProvider> buildTypeMappingUiProviders() {
- Collection<ITypeMappingUiProvider> typeMappingUiProviders = new ArrayList<ITypeMappingUiProvider>();
- typeMappingUiProviders.add(new EntityUiProvider());
- typeMappingUiProviders.add(new MappedSuperclassUiProvider());
- typeMappingUiProviders.add(new EmbeddableUiProvider());
- return typeMappingUiProviders;
- }
-
- @Override
- protected void initializeLayout(Composite composite) {
- composite.setLayout(new GridLayout(2, false));
-
- GridData gridData;
-
- CommonWidgets.buildJavaClassLabel(composite, getWidgetFactory());
-
- this.javaClassChooser = CommonWidgets.buildJavaClassChooser(composite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.javaClassChooser.getControl().setLayoutData(gridData);
-
- buildTypeMappingLabel(composite);
-
- CComboViewer typeMappingCombo = buildTypeMappingCombo(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- typeMappingCombo.getCombo().setLayoutData(gridData);
-
- buildMetadataCompleteLabel(composite);
- this.metadataCompleteComboViewer = new MetaDataCompleteComboViewer(composite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.metadataCompleteComboViewer.getControl().setLayoutData(gridData);
-
- CommonWidgets.buildAccessLabel(composite, getWidgetFactory());
- this.accessComboViewer = CommonWidgets.buildAccessTypeComboViewer(composite, this.commandStack, getWidgetFactory());
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.BEGINNING;
- gridData.grabExcessHorizontalSpace = true;
- this.accessComboViewer.getControl().setLayoutData(gridData);
-
- PageBook typeMappingPageBook = buildTypeMappingPageBook(composite);
- gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalSpan = 2;
- typeMappingPageBook.setLayoutData(gridData);
- }
-
- private Label buildMetadataCompleteLabel(Composite parent ) {
- return getWidgetFactory().createLabel(parent, JptUiXmlMessages.PersistentTypePage_MetadataCompleteLabel);
- }
-
- @Override
- protected void doPopulate(IJpaContentNode persistentTypeNode) {
- super.doPopulate(persistentTypeNode);
- if (persistentTypeNode == null) {
- this.javaClassChooser.populate(null);
- this.metadataCompleteComboViewer.populate(null);
- this.accessComboViewer.populate(new MyAccessHolder(null));
- }
- else {
- XmlTypeMapping mapping = ((XmlPersistentType) persistentTypeNode).getMapping();
- this.javaClassChooser.populate(mapping);
- this.metadataCompleteComboViewer.populate(mapping);
- this.accessComboViewer.populate(new MyAccessHolder(mapping));
- }
- }
-
- @Override
- protected void doPopulate() {
- super.doPopulate();
- this.javaClassChooser.populate();
- this.metadataCompleteComboViewer.populate();
- this.accessComboViewer.populate();
- }
-
- @Override
- public void dispose() {
- this.javaClassChooser.dispose();
- this.metadataCompleteComboViewer.dispose();
- this.accessComboViewer.dispose();
- super.dispose();
- }
-
-
- private class MyAccessHolder extends XmlEObject implements AccessHolder{
-
- private XmlTypeMapping xmlTypeMapping;
- MyAccessHolder(XmlTypeMapping xmlTypeMapping) {
- super();
- this.xmlTypeMapping = xmlTypeMapping;
- }
- public void setAccess(AccessType accessType) {
- xmlTypeMapping.setSpecifiedAccess(accessType);
- }
-
- public AccessType getAccess() {
- return xmlTypeMapping.getSpecifiedAccess();
- }
-
- public Class featureClass() {
- return XmlTypeMapping.class;
- }
-
- public int featureId() {
- return OrmPackage.XML_TYPE_MAPPING__SPECIFIED_ACCESS;
- }
-
- public EObject wrappedObject() {
- return this.xmlTypeMapping;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/EntityMappingsItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/EntityMappingsItemProvider.java
deleted file mode 100644
index 171664b153..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/EntityMappingsItemProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.structure;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.emf.edit.provider.ItemProviderAdapter;
-import org.eclipse.emf.edit.provider.ViewerNotification;
-import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsImages;
-
-public class EntityMappingsItemProvider extends ItemProviderAdapter
- implements IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider
-{
- public EntityMappingsItemProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- @Override
- public Collection getChildrenFeatures(Object object) {
- if (childrenFeatures == null) {
- super.getChildrenFeatures(object);
- childrenFeatures.add(OrmPackage.Literals.ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES);
- }
- return childrenFeatures;
- }
-
- @Override
- public Object getParent(Object object) {
- return null;
- }
-
- @Override
- public Object getImage(Object object) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.ENTITY_MAPPINGS);
- }
-
- @Override
- public String getText(Object object) {
- // TODO
- return "EntityMappings";
- }
-
- @Override
- public void notifyChanged(Notification notification) {
- updateChildren(notification);
-
- switch (notification.getFeatureID(EntityMappingsInternal.class)) {
- case OrmPackage.ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES:
- case OrmPackage.ENTITY_MAPPINGS_INTERNAL__TYPE_MAPPINGS:
- fireNotifyChanged(
- new ViewerNotification(
- notification, notification.getNotifier(), true, false));
- return;
- }
- super.notifyChanged(notification);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/JpaCoreXmlItemProviderAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/JpaCoreXmlItemProviderAdapterFactory.java
deleted file mode 100644
index a79c0ffa0b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/JpaCoreXmlItemProviderAdapterFactory.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.structure;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.edit.provider.ChangeNotifier;
-import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.IChangeNotifier;
-import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.INotifyChangedListener;
-import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.jpt.core.internal.content.orm.util.OrmAdapterFactory;
-import org.eclipse.ui.services.IDisposable;
-
-/**
- * This is the factory that is used to provide the interfaces needed to support Viewers.
- * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
- * The adapters also support Eclipse property sheets.
- * Note that most of the adapters are shared among multiple instances.
- */
-public class JpaCoreXmlItemProviderAdapterFactory
- extends OrmAdapterFactory
- implements ComposeableAdapterFactory,
- IChangeNotifier,
- IDisposable
-{
- /**
- * This keeps track of the root adapter factory that delegates to this adapter factory.
- */
- protected ComposedAdapterFactory parentAdapterFactory;
-
- /**
- * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
- */
- protected IChangeNotifier changeNotifier = new ChangeNotifier();
-
- /**
- * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
- */
- protected Collection supportedTypes = new ArrayList();
-
- public JpaCoreXmlItemProviderAdapterFactory() {
- supportedTypes.add(IEditingDomainItemProvider.class);
- supportedTypes.add(IStructuredItemContentProvider.class);
- supportedTypes.add(ITreeItemContentProvider.class);
- supportedTypes.add(IItemLabelProvider.class);
- }
-
-
- protected XmlRootContentNodeItemProvider xmlRootContentNodeItemProvider;
-
- public Adapter createXmlRootContentNodeAdapter() {
- if (xmlRootContentNodeItemProvider == null) {
- xmlRootContentNodeItemProvider = new XmlRootContentNodeItemProvider(this);
- }
-
- return xmlRootContentNodeItemProvider;
- }
-
- protected EntityMappingsItemProvider entityMappingsItemProvider;
-
- /**
- * This creates an adapter for a {@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsImpl}.
- */
- public Adapter createEntityMappingsAdapter() {
- if (entityMappingsItemProvider == null) {
- entityMappingsItemProvider = new EntityMappingsItemProvider(this);
- }
-
- return entityMappingsItemProvider;
- }
-
- /**
- * This keeps track of the one adapter used for all {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType} instances.
- */
- protected XmlPersistentTypeItemProvider xmlPersistentTypeItemProvider;
-
- /**
- * This creates an adapter for a {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType}.
- */
- public Adapter createXmlPersistentTypeAdapter() {
- if (xmlPersistentTypeItemProvider == null) {
- xmlPersistentTypeItemProvider = new XmlPersistentTypeItemProvider(
- this);
- }
-
- return xmlPersistentTypeItemProvider;
- }
-
- /**
- * This keeps track of the one adapter used for all {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute} instances.
- */
- protected XmlPersistentAttributeItemProvider xmlPersistentAttributeItemProvider;
-
- /**
- * This creates an adapter for a {@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute}.
- */
- public Adapter createXmlPersistentAttributeAdapter() {
- if (xmlPersistentAttributeItemProvider == null) {
- xmlPersistentAttributeItemProvider = new XmlPersistentAttributeItemProvider(
- this);
- }
-
- return xmlPersistentAttributeItemProvider;
- }
-
- /**
- * This returns the root adapter factory that contains this factory.
- */
- public ComposeableAdapterFactory getRootAdapterFactory() {
- return parentAdapterFactory == null ? this : parentAdapterFactory
- .getRootAdapterFactory();
- }
-
- /**
- * This sets the composed adapter factory that contains this factory.
- */
- public void setParentAdapterFactory(
- ComposedAdapterFactory parentAdapterFactory) {
- this.parentAdapterFactory = parentAdapterFactory;
- }
-
- public boolean isFactoryForType(Object type) {
- return supportedTypes.contains(type) || super.isFactoryForType(type);
- }
-
- /**
- * This implementation substitutes the factory itself as the key for the adapter.
- */
- public Adapter adapt(Notifier notifier, Object type) {
- return super.adapt(notifier, this);
- }
-
- public Object adapt(Object object, Object type) {
- if (isFactoryForType(type)) {
- Object adapter = super.adapt(object, type);
- if (!(type instanceof Class)
- || (((Class) type).isInstance(adapter))) {
- return adapter;
- }
- }
-
- return null;
- }
-
- /**
- * This adds a listener.
- */
- public void addListener(INotifyChangedListener notifyChangedListener) {
- changeNotifier.addListener(notifyChangedListener);
- }
-
- /**
- * This removes a listener.
- */
- public void removeListener(INotifyChangedListener notifyChangedListener) {
- changeNotifier.removeListener(notifyChangedListener);
- }
-
- /**
- * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
- */
- public void fireNotifyChanged(Notification notification) {
- changeNotifier.fireNotifyChanged(notification);
-
- if (parentAdapterFactory != null) {
- parentAdapterFactory.fireNotifyChanged(notification);
- }
- }
-
- /**
- * This disposes all of the item providers created by this factory.
- */
- public void dispose() {
- if (xmlRootContentNodeItemProvider != null)
- xmlRootContentNodeItemProvider.dispose();
- if (entityMappingsItemProvider != null)
- entityMappingsItemProvider.dispose();
- if (xmlPersistentTypeItemProvider != null)
- xmlPersistentTypeItemProvider.dispose();
- if (xmlPersistentAttributeItemProvider != null)
- xmlPersistentAttributeItemProvider.dispose();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java
deleted file mode 100644
index e9f4260b1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.structure;
-
-import org.eclipse.draw2d.ImageUtilities;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.emf.edit.provider.ItemProviderAdapter;
-import org.eclipse.emf.edit.provider.ViewerNotification;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute;
-import org.eclipse.jpt.core.internal.mappings.IBasic;
-import org.eclipse.jpt.core.internal.mappings.IEmbedded;
-import org.eclipse.jpt.core.internal.mappings.IEmbeddedId;
-import org.eclipse.jpt.core.internal.mappings.IId;
-import org.eclipse.jpt.core.internal.mappings.IManyToMany;
-import org.eclipse.jpt.core.internal.mappings.IManyToOne;
-import org.eclipse.jpt.core.internal.mappings.IOneToMany;
-import org.eclipse.jpt.core.internal.mappings.IOneToOne;
-import org.eclipse.jpt.core.internal.mappings.ITransient;
-import org.eclipse.jpt.core.internal.mappings.IVersion;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsImages;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-
-public class XmlPersistentAttributeItemProvider extends ItemProviderAdapter
- implements IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider
-{
- public XmlPersistentAttributeItemProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- @Override
- public Object getImage(Object object) {
- XmlAttributeMapping mapping = ((XmlPersistentAttribute) object).getMapping();
-
- Image image;
- if (mapping instanceof IBasic) {
- image = JptUiMappingsImages.getImage(JptUiMappingsImages.BASIC);
- }
- else if (mapping instanceof IId) {
- image = JptUiMappingsImages.getImage(JptUiMappingsImages.ID);
- }
- else if (mapping instanceof IVersion) {
- image = JptUiMappingsImages.getImage(JptUiMappingsImages.VERSION);
- }
- else if (mapping instanceof IEmbedded) {
- image = JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDED);
- }
- else if (mapping instanceof IEmbeddedId) {
- image = JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDED_ID);
- }
- else if (mapping instanceof IOneToOne) {
- image = JptUiMappingsImages.getImage(JptUiMappingsImages.ONE_TO_ONE);
- }
- else if (mapping instanceof IOneToMany) {
- image = JptUiMappingsImages.getImage(JptUiMappingsImages.ONE_TO_MANY);
- }
- else if (mapping instanceof IManyToOne) {
- image = JptUiMappingsImages.getImage(JptUiMappingsImages.MANY_TO_ONE);
- }
- else if (mapping instanceof IManyToMany) {
- image = JptUiMappingsImages.getImage(JptUiMappingsImages.MANY_TO_MANY);
- }
- else if (mapping instanceof ITransient) {
- image = JptUiMappingsImages.getImage(JptUiMappingsImages.TRANSIENT);
- }
- else {
- image = JptUiMappingsImages.getImage(JptUiMappingsImages.NULL_ATTRIBUTE_MAPPING);
- }
-
- // apply "ghosting"
- if (mapping.isVirtual()) {
- Color offwhite = new Color(image.getDevice(), 250, 250, 250);
- ImageData imageData = ImageUtilities.createShadedImage(image, offwhite);
- image = new Image(image.getDevice(), imageData);
- }
-
- return image;
- }
-
- @Override
- public String getText(Object object) {
- return ((XmlPersistentAttribute) object).getName();
- }
-
- @Override
- public void notifyChanged(Notification notification) {
- updateChildren(notification);
-
- switch (notification.getFeatureID(XmlPersistentAttribute.class)) {
- case OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING:
- case OrmPackage.XML_PERSISTENT_ATTRIBUTE__NAME:
- fireNotifyChanged(new ViewerNotification(notification, notification
- .getNotifier(), false, true));
- return;
- }
- super.notifyChanged(notification);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentTypeItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentTypeItemProvider.java
deleted file mode 100644
index f87750ae2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentTypeItemProvider.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.structure;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.emf.edit.provider.ItemProviderAdapter;
-import org.eclipse.emf.edit.provider.ViewerNotification;
-import org.eclipse.jpt.core.internal.IPersistentType;
-import org.eclipse.jpt.core.internal.ITypeMapping;
-import org.eclipse.jpt.core.internal.JpaCorePackage;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType;
-import org.eclipse.jpt.core.internal.mappings.IEmbeddable;
-import org.eclipse.jpt.core.internal.mappings.IEntity;
-import org.eclipse.jpt.core.internal.mappings.IMappedSuperclass;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsImages;
-
-public class XmlPersistentTypeItemProvider extends ItemProviderAdapter
- implements IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider
-{
- public XmlPersistentTypeItemProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
-
- @Override
- protected Collection getChildrenFeatures(Object object) {
- if (childrenFeatures == null) {
- super.getChildrenFeatures(object);
- childrenFeatures.add(OrmPackage.Literals.XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES);
- childrenFeatures.add(OrmPackage.Literals.XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES);
- }
- return childrenFeatures;
- }
-
- @Override
- public Object getImage(Object object) {
- ITypeMapping mapping = ((IPersistentType) object).getMapping();
-
- if (mapping instanceof IEntity) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.ENTITY);
- }
- else if (mapping instanceof IEmbeddable) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDABLE);
- }
- else if (mapping instanceof IMappedSuperclass) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.MAPPED_SUPERCLASS);
- }
- else {
- return null;
- }
- }
-
- @Override
- public String getText(Object object) {
- return ((XmlPersistentType) object).getClass_();
- }
-
- @Override
- public void notifyChanged(Notification notification) {
- updateChildren(notification);
-
- switch (notification.getFeatureID(XmlPersistentType.class)) {
- case JpaCorePackage.IPERSISTENT_TYPE__MAPPING_KEY:
- case OrmPackage.XML_PERSISTENT_TYPE__CLASS:
- fireNotifyChanged(
- new ViewerNotification(
- notification, notification.getNotifier(), false, true));
- return;
-
- case OrmPackage.XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES:
- case OrmPackage.XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES:
- fireNotifyChanged(
- new ViewerNotification(
- notification, notification.getNotifier(), true, false));
- return;
- }
-
- super.notifyChanged(notification);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlRootContentNodeItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlRootContentNodeItemProvider.java
deleted file mode 100644
index 969c7c8407..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlRootContentNodeItemProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.structure;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.emf.edit.provider.ItemProviderAdapter;
-import org.eclipse.emf.edit.provider.ViewerNotification;
-import org.eclipse.jpt.core.internal.content.orm.EntityMappings;
-import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-
-public class XmlRootContentNodeItemProvider extends ItemProviderAdapter
- implements IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider
-{
- public XmlRootContentNodeItemProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- @Override
- public Collection getChildrenFeatures(Object object) {
- if (childrenFeatures == null) {
- super.getChildrenFeatures(object);
- childrenFeatures.add(OrmPackage.Literals.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS);
- }
- return childrenFeatures;
- }
-
- @Override
- public void notifyChanged(Notification notification) {
- updateChildren(notification);
-
- switch (notification.getFeatureID(EntityMappings.class)) {
- case OrmPackage.XML_ROOT_CONTENT_NODE__ENTITY_MAPPINGS:
- fireNotifyChanged(
- new ViewerNotification(
- notification, notification.getNotifier(), true, false));
- return;
- }
- super.notifyChanged(notification);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlStructureProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlStructureProvider.java
deleted file mode 100644
index ca7dddcceb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlStructureProvider.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.xml.structure;
-
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jpt.core.internal.JptCorePlugin;
-import org.eclipse.jpt.ui.internal.structure.IJpaStructureProvider;
-
-public class XmlStructureProvider implements IJpaStructureProvider {
-
- public String fileContentType() {
- return JptCorePlugin.ORM_XML_CONTENT_TYPE;
- }
-
- public ITreeContentProvider buildContentProvider() {
- return new AdapterFactoryContentProvider(new JpaCoreXmlItemProviderAdapterFactory());
- }
-
- public ILabelProvider buildLabelProvider() {
- return new AdapterFactoryLabelProvider(new JpaCoreXmlItemProviderAdapterFactory());
- }
-
- public void dispose() {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/.classpath b/jpa/plugins/org.eclipse.jpt.utility/.classpath
deleted file mode 100644
index 1d0cf0db7b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.utility/.cvsignore b/jpa/plugins/org.eclipse.jpt.utility/.cvsignore
deleted file mode 100644
index 42191b4579..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-@dot
-build.xml \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.utility/.project b/jpa/plugins/org.eclipse.jpt.utility/.project
deleted file mode 100644
index 99b389b9c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.utility</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 8b1918da29..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:11:35 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 443826069d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:55:37 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.utility/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.utility/META-INF/MANIFEST.MF
deleted file mode 100644
index 20aef05fb4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,10 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.utility
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jpt.utility.internal,
- org.eclipse.jpt.utility.internal.iterators
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/jpa/plugins/org.eclipse.jpt.utility/about.html b/jpa/plugins/org.eclipse.jpt.utility/about.html
deleted file mode 100644
index 9e73bdabb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>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
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>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
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.utility/build.properties b/jpa/plugins/org.eclipse.jpt.utility/build.properties
deleted file mode 100644
index 11ab8d42f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 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/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
diff --git a/jpa/plugins/org.eclipse.jpt.utility/component.xml b/jpa/plugins/org.eclipse.jpt.utility/component.xml
deleted file mode 100644
index b210b281dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.utility"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.utility" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.utility/plugin.properties b/jpa/plugins/org.eclipse.jpt.utility/plugin.properties
deleted file mode 100644
index 95c029d5d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 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 = Java Persistence API Tools - Utility
-providerName = Eclipse.org
-
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java
deleted file mode 100644
index 2c68536c51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-/**
- * A collection that allows duplicate elements.
- * <p>
- * The <code>Bag</code> interface places additional stipulations,
- * beyond those inherited from the <code>java.util.Collection</code> interface,
- * on the contracts of the <code>equals</code> and <code>hashCode</code> methods.
- *
- * @version 1.00 Jan-2002
- * @see java.util.Collection
- * @see HashBag
- */
-
-public interface Bag<E> extends java.util.Collection<E> {
-
- /**
- * Compares the specified object with this bag for equality. Returns
- * <code>true</code> if the specified object is also a bag, the two bags
- * have the same size, and every member of the specified bag is
- * contained in this bag with the same number of occurrences (or equivalently,
- * every member of this bag is contained in the specified bag with the same
- * number of occurrences). This definition ensures that the
- * equals method works properly across different implementations of the
- * bag interface.
- */
- boolean equals(Object o);
-
- /**
- * Returns the hash code value for this bag. The hash code of a bag is
- * defined to be the sum of the hash codes of the elements in the bag,
- * where the hashcode of a <code>null</code> element is defined to be zero.
- * This ensures that <code>b1.equals(b2)</code> implies that
- * <code>b1.hashCode() == b2.hashCode()</code> for any two bags
- * <code>b1</code> and <code>b2</code>, as required by the general
- * contract of the <code>Object.hashCode</code> method.
- */
- int hashCode();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java
deleted file mode 100644
index cc1221a473..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.utility.internal;
-
-/**
- * Assorted bit tools
- */
-public class BitTools {
-
- /**
- * Return whether the specified 'flags' has all the specified
- * 'flagsToCheck' set.
- */
- public static boolean allFlagsAreSet(int flags, int flagsToCheck) {
- return (flags & flagsToCheck) == flagsToCheck;
- }
-
- /**
- * Return whether the specified 'flags' has any one of the specified
- * 'flagsToCheck' set.
- */
- public static boolean anyFlagsAreSet(int flags, int flagsToCheck) {
- return (flags & flagsToCheck) != 0;
- }
-
- /**
- * Return whether the specified 'flags' has all the specified
- * 'flagsToCheck' set.
- */
- public static boolean allFlagsAreSet(int flags, int[] flagsToCheck) {
- for (int i = flagsToCheck.length; i-- > 0; ) {
- if ( ! allFlagsAreSet(flags, flagsToCheck[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified 'flags' has any one of the specified
- * 'flagsToCheck' set.
- */
- public static boolean anyFlagsAreSet(int flags, int[] flagsToCheck) {
- for (int i = flagsToCheck.length; i-- > 0; ) {
- if (anyFlagsAreSet(flags, flagsToCheck[i])) {
- return true;
- }
- }
- return false;
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private BitTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassTools.java
deleted file mode 100644
index 9f8e2021e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassTools.java
+++ /dev/null
@@ -1,1505 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Collections;
-import java.util.Stack;
-
-/**
- * Convenience methods related to the java.lang.reflect package.
- * These methods provide shortcuts for manipulating objects via
- * reflection; particularly when dealing with fields and/or methods that
- * are not publicly accessible or are inherited.
- *
- * In most cases, all the exceptions are handled and
- * wrapped in java.lang.RuntimeExceptions; so these methods should
- * be used when you are confident that you will not having any problems
- * using reflection.
- *
- * There are also a number of methods whose names
- * begin with "attempt". These methods will throw a NoSuchMethodException
- * or NoSuchFieldException when appropriate, allowing you to probe
- * for methods that should be present but might not.
- */
-public final class ClassTools {
-
- public static final Class<?>[] ZERO_PARAMETER_TYPES = new Class[0];
- public static final Object[] ZERO_PARAMETERS = new Object[0];
- private static final String CR = StringTools.CR;
-
- public static final char NESTED_CLASS_NAME_SEPARATOR = '$';
-
- public static final char ARRAY_INDICATOR = '[';
-
- public static final char REFERENCE_CLASS_CODE = 'L';
- public static final char REFERENCE_CLASS_NAME_DELIMITER = ';';
-
- private static PrimitiveClassCode[] PRIMITIVE_CLASS_CODES; // pseudo 'final' - lazy-initialized
- public static final char BYTE_CODE = 'B';
- public static final char CHAR_CODE = 'C';
- public static final char DOUBLE_CODE = 'D';
- public static final char FLOAT_CODE = 'F';
- public static final char INT_CODE = 'I';
- public static final char LONG_CODE = 'J';
- public static final char SHORT_CODE = 'S';
- public static final char BOOLEAN_CODE = 'Z';
- public static final char VOID_CODE = 'V';
-
- private static int MAX_PRIMITIVE_CLASS_NAME_LENGTH = -1; // pseudo 'final' - lazy-initialized
-
-
- /**
- * Return all the fields for the
- * specified class, including inherited fields.
- * Class#allFields()
- */
- public static Field[] allFields(Class<?> javaClass) {
- Stack<Field> stack = new Stack<Field>();
- for (Class<?> tempClass = javaClass; tempClass != null; tempClass = tempClass.getSuperclass()) {
- pushDeclaredFields(tempClass, stack);
- }
- Collections.reverse(stack);
- return stack.toArray(new Field[stack.size()]);
- }
-
- /**
- * Return all the methods for the
- * specified class, including inherited methods.
- * Class#allMethods()
- */
- public static Method[] allMethods(Class<?> javaClass) {
- Stack<Method> stack = new Stack<Method>();
- for (Class<?> tempClass = javaClass; tempClass != null; tempClass = tempClass.getSuperclass()) {
- pushDeclaredMethods(tempClass, stack);
- }
- Collections.reverse(stack);
- return stack.toArray(new Method[stack.size()]);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * Throw an exception if the default constructor is not defined.
- * Class#newInstance() throws NoSuchMethodException
- */
- public static <T> T attemptNewInstance(Class<T> javaClass) throws NoSuchMethodException {
- return attemptNewInstance(javaClass, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and parameters.
- * Throw an exception if the constructor is not defined.
- * Class#newInstance(Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException
- */
- public static <T> T attemptNewInstance(Class<T> javaClass, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException {
- try {
- return constructor(javaClass, parameterTypes).newInstance(parameters);
- } catch (InstantiationException ie) {
- throw new RuntimeException(ie + CR + fullyQualifiedConstructorSignature(javaClass, parameterTypes), ie);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedConstructorSignature(javaClass, parameterTypes), iae);
- } catch (InvocationTargetException ite) {
- throw new RuntimeException(fullyQualifiedConstructorSignature(javaClass, parameterTypes) + CR + ite.getTargetException(), ite);
- }
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * given the constructor parameter type and parameter.
- * Throw an exception if the constructor is not defined.
- * Class#newInstance(Class<?> parameterType, Object parameter) throws NoSuchMethodException
- */
- public static <T> T attemptNewInstance(Class<T> javaClass, Class<?> parameterType, Object parameter) throws NoSuchMethodException {
- return attemptNewInstance(javaClass, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Attempt to get a field value, given the containing object and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * Throw an exception if the field is not defined.
- * Object#getFieldValue(String fieldName) throws NoSuchFieldException
- */
- public static Object attemptToGetFieldValue(Object object, String fieldName) throws NoSuchFieldException {
- try {
- return field(object, fieldName).get(object);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedFieldName(object, fieldName), iae);
- }
- }
-
- /**
- * Attempt to get a static field value, given the containing object and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * Throw an exception if the field is not defined.
- * Class#getStaticFieldValue(String fieldName) throws NoSuchFieldException
- */
- public static Object attemptToGetStaticFieldValue(Class<?> javaClass, String fieldName) throws NoSuchFieldException {
- try {
- return field(javaClass, fieldName).get(null);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedFieldName(javaClass, fieldName), iae);
- }
- }
-
- /**
- * Convenience method.
- * Attempt to execute a zero-argument method,
- * given the receiver and method name.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName) throws NoSuchMethodException
- */
- public static Object attemptToExecuteMethod(Object receiver, String methodName) throws NoSuchMethodException {
- return attemptToExecuteMethod(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Convenience method.
- * Attempt to execute a method, given the receiver,
- * method name, parameter type, and parameter.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?> parameterType, Object parameter) throws NoSuchMethodException
- */
- public static Object attemptToExecuteMethod(Object receiver, String methodName, Class<?> parameterType, Object parameter) throws NoSuchMethodException {
- return attemptToExecuteMethod(receiver, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Attempt to execute a method, given the receiver,
- * method name, parameter types, and parameters.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException
- */
- public static Object attemptToExecuteMethod(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException {
- return executeMethod(method(receiver, methodName, parameterTypes), receiver, parameters);
- }
-
- /**
- * Attempt to execute a method, given the receiver,
- * method name, parameter types, and parameters.
- * Return its result.
- * Throw an exception if the method is not found.
- * If the executed method throws an exception, rethrow that exception.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException
- */
- public static Object attemptToExecuteMethodWithException(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] parameters)
- throws Throwable, NoSuchMethodException
- {
- return executeMethodWithException(method(receiver, methodName, parameterTypes), receiver, parameters);
- }
-
- /**
- * Convenience method.
- * Attempt to execute a zero-argument static method,
- * given the class and method name.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName) throws NoSuchMethodException
- */
- public static Object attemptToExecuteStaticMethod(Class<?> javaClass, String methodName) throws NoSuchMethodException {
- return attemptToExecuteStaticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Attempt to execute a static method, given the class,
- * method name, parameter types, and parameters.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException
- */
- public static Object attemptToExecuteStaticMethod(Class<?> javaClass, String methodName, Class<?>[] parameterTypes, Object[] parameters) throws NoSuchMethodException {
- return executeStaticMethod(staticMethod(javaClass, methodName, parameterTypes), parameters);
- }
-
- /**
- * Convenience method.
- * Attempt to execute a static method, given the class,
- * method name, parameter type, and parameter.
- * Return its result.
- * Throw an exception if the method is not found.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName, Class<?> parameterType, Object parameter) throws NoSuchMethodException
- */
- public static Object attemptToExecuteStaticMethod(Class<?> javaClass, String methodName, Class<?> parameterType, Object parameter) throws NoSuchMethodException {
- return attemptToExecuteStaticMethod(javaClass, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Attempt to set a field value, given the
- * containing object, field name, and new field value.
- * Useful for accessing private, package, or protected fields.
- * Throw an exception if the field is not defined.
- * Object#setFieldValue(String fieldName, Object fieldValue) throws NoSuchFieldException
- */
- public static void attemptToSetFieldValue(Object object, String fieldName, Object fieldValue) throws NoSuchFieldException {
- try {
- field(object, fieldName).set(object, fieldValue);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedFieldName(object, fieldName), iae);
- }
- }
-
- /**
- * Attempt to set a static field value, given the
- * containing class, field name, and new field value.
- * Useful for accessing private, package, or protected fields.
- * Throw an exception if the field is not defined.
- * Class#setStaticFieldValue(String fieldName, Object fieldValue) throws NoSuchFieldException
- */
- public static void attemptToSetStaticFieldValue(Class<?> javaClass, String fieldName, Object fieldValue) throws NoSuchFieldException {
- try {
- field(javaClass, fieldName).set(null, fieldValue);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + fullyQualifiedFieldName(javaClass, fieldName), iae);
- }
- }
-
- /**
- * Convenience method.
- * Return the default (zero-argument) constructor
- * for the specified class.
- * Set accessible to true, so we can access
- * private/package/protected constructors.
- * Class#constructor() throws NoSuchMethodException
- */
- public static <T> Constructor<T> constructor(Class<T> javaClass) throws NoSuchMethodException {
- return constructor(javaClass, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * Return the constructor for the specified class
- * and formal parameter types.
- * Set accessible to true, so we can access
- * private/package/protected constructors.
- * Class#constructor(Class<?>[] parameterTypes) throws NoSuchMethodException
- */
- public static <T> Constructor<T> constructor(Class<T> javaClass, Class<?>[] parameterTypes) throws NoSuchMethodException {
- Constructor<T> constructor = javaClass.getDeclaredConstructor(parameterTypes);
- constructor.setAccessible(true);
- return constructor;
- }
-
- /**
- * Convenience method.
- * Return the constructor for the specified class
- * and formal parameter type.
- * Set accessible to true, so we can access
- * private/package/protected constructors.
- * Class#constructor(Class<?> parameterType) throws NoSuchMethodException
- */
- public static <T> Constructor<T> constructor(Class<T> javaClass, Class<?> parameterType) throws NoSuchMethodException {
- return constructor(javaClass, new Class[] {parameterType});
- }
-
- /**
- * Return the declared fields for the specified class.
- * Set accessible to true, so we can access
- * private/package/protected fields.
- * Class#accessibleDeclaredFields()
- */
- public static Field[] declaredFields(Class<?> javaClass) {
- Field[] fields = javaClass.getDeclaredFields();
- for (Field field : fields) {
- field.setAccessible(true);
- }
- return fields;
- }
-
- /**
- * Return the declared methods for the
- * specified class.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- * Class#accessibleDeclaredMethods()
- */
- public static Method[] declaredMethods(Class<?> javaClass) {
- Method[] methods = javaClass.getDeclaredMethods();
- for (Method method : methods) {
- method.setAccessible(true);
- }
- return methods;
- }
-
- /**
- * Return the default (zero-argument) constructor
- * for the specified class.
- * Set accessible to true, so we can access
- * private/package/protected constructors.
- * Class#defaultConstructor()
- */
- public static <T> Constructor<T> defaultConstructor(Class<T> javaClass) throws NoSuchMethodException {
- return constructor(javaClass);
- }
-
- /**
- * Return a field for the specified class and field name.
- * If the class does not directly
- * define the field, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected fields.
- */
- public static Field field(Class<?> javaClass, String fieldName) throws NoSuchFieldException {
- Field field = null;
- try {
- field = javaClass.getDeclaredField(fieldName);
- } catch (NoSuchFieldException ex) {
- Class<?> superclass = javaClass.getSuperclass();
- if (superclass == null) {
- throw ex;
- }
- // recurse
- return field(superclass, fieldName);
- }
- field.setAccessible(true);
- return field;
- }
-
- /**
- * Convenience method.
- * Return a field for the specified object and field name.
- * If the object's class does not directly
- * define the field, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected fields.
- */
- public static Field field(Object object, String fieldName) throws NoSuchFieldException {
- return field(object.getClass(), fieldName);
- }
-
- /**
- * Return a string representation of the specified constructor.
- */
- private static String fullyQualifiedConstructorSignature(Class<?> javaClass, Class<?>[] parameterTypes) {
- return fullyQualifiedMethodSignature(javaClass, null, parameterTypes);
- }
-
- /**
- * Return a string representation of the specified field.
- */
- private static String fullyQualifiedFieldName(Class<?> javaClass, String fieldName) {
- StringBuffer sb = new StringBuffer(200);
- sb.append(javaClass.getName());
- sb.append('.');
- sb.append(fieldName);
- return sb.toString();
- }
-
- /**
- * Return a string representation of the specified field.
- */
- private static String fullyQualifiedFieldName(Object object, String fieldName) {
- return fullyQualifiedFieldName(object.getClass(), fieldName);
- }
-
- /**
- * Return a string representation of the specified method.
- */
- private static String fullyQualifiedMethodSignature(Class<?> javaClass, String methodName, Class<?>[] parameterTypes) {
- StringBuffer sb = new StringBuffer(200);
- sb.append(javaClass.getName());
- // this check allows us to use this code for constructors, where the methodName is null
- if (methodName != null) {
- sb.append('.');
- sb.append(methodName);
- }
- sb.append('(');
- int max = parameterTypes.length - 1;
- if (max != -1) {
- // stop one short of the end of the array
- for (int i = 0; i < max; i++) {
- sb.append(parameterTypes[i].getName());
- sb.append(", ");
- }
- sb.append(parameterTypes[max].getName());
- }
- sb.append(')');
- return sb.toString();
- }
-
- /**
- * Return a string representation of the specified method.
- */
- private static String fullyQualifiedMethodSignature(Object receiver, String methodName, Class<?>[] parameterTypes) {
- return fullyQualifiedMethodSignature(receiver.getClass(), methodName, parameterTypes);
- }
-
- /**
- * Get a field value, given the containing object and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * Object#getFieldValue(String fieldName)
- */
- public static Object getFieldValue(Object object, String fieldName) {
- try {
- return attemptToGetFieldValue(object, fieldName);
- } catch (NoSuchFieldException nsfe) {
- throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(object, fieldName), nsfe);
- }
- }
-
- /**
- * Get a static field value, given the containing class and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * Class#getStaticFieldValue(String fieldName)
- */
- public static Object getStaticFieldValue(Class<?> javaClass, String fieldName) {
- try {
- return attemptToGetStaticFieldValue(javaClass, fieldName);
- } catch (NoSuchFieldException nsfe) {
- throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(javaClass, fieldName), nsfe);
- }
- }
-
- /**
- * Convenience method.
- * Execute a zero-argument method, given the receiver and method name.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName)
- */
- public static Object executeMethod(Object receiver, String methodName) {
- return executeMethod(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Execute a method, given the receiver,
- * method name, parameter types, and parameters.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object executeMethod(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] parameters) {
- try {
- return attemptToExecuteMethod(receiver, methodName, parameterTypes, parameters);
- } catch (NoSuchMethodException nsme) {
- throw new RuntimeException(nsme + CR + fullyQualifiedMethodSignature(receiver, methodName, parameterTypes), nsme);
- }
- }
-
- /**
- * Convenience method.
- * Execute a one-argument method, given the receiver,
- * method name, parameter type, and parameter.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?> parameterType, Object parameter)
- */
- public static Object executeMethod(Object receiver, String methodName, Class<?> parameterType, Object parameter) {
- return executeMethod(receiver, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Convenience method.
- * Execute a zero-argument method, given the receiver and method name.
- * Return its result.
- * If the method throws an exception, rethrow that exception.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName)
- */
- public static Object executeMethodWithException(Object receiver, String methodName)
- throws Throwable
- {
- return executeMethodWithException(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Convenience method.
- * Execute a one-argument method, given the receiver,
- * method name, parameter type, and parameter.
- * Return its result.
- * If the method throws an exception, rethrow that exception.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?> parameterType, Object parameter)
- */
- public static Object executeMethodWithException(Object receiver, String methodName, Class<?> parameterType, Object parameter)
- throws Throwable
- {
- return executeMethodWithException(receiver, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Execute a method, given the receiver,
- * method name, parameter types, and parameters.
- * Return its result.
- * If the method throws an exception, rethrow that exception.
- * Useful for invoking private, package, or protected methods.
- * Object#execute(String methodName, Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object executeMethodWithException(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] parameters)
- throws Throwable
- {
- try {
- return attemptToExecuteMethodWithException(receiver, methodName, parameterTypes, parameters);
- } catch (NoSuchMethodException nsme) {
- throw new RuntimeException(nsme + CR + fullyQualifiedMethodSignature(receiver, methodName, parameterTypes), nsme);
- }
- }
-
- /**
- * Execute the specified method with the specified parameters.
- * Return its result.
- * Convert exceptions to RuntimeExceptions.
- */
- public static Object executeMethod(Method method, Object receiver, Object[] parameters) {
- try {
- return method.invoke(receiver, parameters);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + method, iae);
- } catch (InvocationTargetException ite) {
- throw new RuntimeException(method + CR + ite.getTargetException(), ite);
- }
- }
-
- /**
- * Execute the specified method with the specified parameters.
- * Return its result.
- * If the method throws an exception, rethrow that exception.
- * Convert all other exceptions to RuntimeExceptions.
- */
- public static Object executeMethodWithException(Method method, Object receiver, Object[] parameters)
- throws Throwable
- {
- try {
- return method.invoke(receiver, parameters);
- } catch (IllegalAccessException iae) {
- throw new RuntimeException(iae + CR + method, iae);
- } catch (InvocationTargetException ite) {
- Throwable cause = ite.getCause();
- if (cause == null) {
- throw new RuntimeException(method.toString(), ite);
- }
- throw cause;
- }
- }
-
- /**
- * Convenience method.
- * Execute a zero-argument static method,
- * given the class and method name.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName)
- */
- public static Object executeStaticMethod(Class<?> javaClass, String methodName) {
- return executeStaticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Execute a static method, given the class,
- * method name, parameter types, and parameters.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName, Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object executeStaticMethod(Class<?> javaClass, String methodName, Class<?>[] parameterTypes, Object[] parameters) {
- try {
- return attemptToExecuteStaticMethod(javaClass, methodName, parameterTypes, parameters);
- } catch (NoSuchMethodException nsme) {
- throw new RuntimeException(nsme + CR + fullyQualifiedMethodSignature(javaClass, methodName, parameterTypes), nsme);
- }
- }
-
- /**
- * Convenience method.
- * Execute a static method, given the class,
- * method name, parameter type, and parameter.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * Class#executeStaticMethod(String methodName, Class<?> parameterType, Object parameter)
- */
- public static Object executeStaticMethod(Class<?> javaClass, String methodName, Class<?> parameterType, Object parameter) {
- return executeStaticMethod(javaClass, methodName, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Execute the specified static method with the specified parameters.
- * Return its result.
- * Convert exceptions to RuntimeExceptions.
- */
- public static Object executeStaticMethod(Method method, Object[] parameters) {
- return executeMethod(method, null, parameters);
- }
-
- /**
- * Convenience method.
- * Return a zero-argument method for the specified class
- * and method name. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Class<?> javaClass, String methodName) throws NoSuchMethodException {
- return method(javaClass, methodName, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * Return a method for the specified class, method name,
- * and formal parameter types. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Class<?> javaClass, String methodName, Class<?>[] parameterTypes) throws NoSuchMethodException {
- Method method = null;
- try {
- method = javaClass.getDeclaredMethod(methodName, parameterTypes);
- } catch (NoSuchMethodException ex) {
- Class<?> superclass = javaClass.getSuperclass();
- if (superclass == null) {
- throw ex;
- }
- // recurse
- return method(superclass, methodName, parameterTypes);
- }
- method.setAccessible(true);
- return method;
- }
-
- /**
- * Convenience method.
- * Return a method for the specified class, method name,
- * and formal parameter type. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Class<?> javaClass, String methodName, Class<?> parameterType) throws NoSuchMethodException {
- return method(javaClass, methodName, new Class[] {parameterType});
- }
-
- /**
- * Convenience method.
- * Return a zero-argument method for the specified object
- * and method name. If the object's class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Object object, String methodName) throws NoSuchMethodException {
- return method(object.getClass(), methodName);
- }
-
- /**
- * Convenience method.
- * Return a method for the specified object, method name,
- * and formal parameter types. If the object's class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Object object, String methodName, Class<?>[] parameterTypes) throws NoSuchMethodException {
- return method(object.getClass(), methodName, parameterTypes);
- }
-
- /**
- * Convenience method.
- * Return a method for the specified object, method name,
- * and formal parameter type. If the object's class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method method(Object object, String methodName, Class<?> parameterType) throws NoSuchMethodException {
- return method(object.getClass(), methodName, parameterType);
- }
-
- /**
- * Convenience method.
- * Return the specified class,.
- */
- public static Class<?> classForName(String javaClassName) {
- try {
- return Class.forName(javaClassName);
- } catch (ClassNotFoundException ex) {
- throw new RuntimeException(javaClassName, ex);
- }
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * Class#newInstance()
- */
- public static <T> T newInstance(Class<T> javaClass) {
- return newInstance(javaClass, ZERO_PARAMETER_TYPES, ZERO_PARAMETERS);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * Class#newInstance()
- */
- public static Object newInstance(String javaClassName) throws ClassNotFoundException {
- return newInstance(javaClassName, ClassTools.class.getClassLoader());
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * Class#newInstance()
- */
- public static Object newInstance(String javaClassName, ClassLoader classLoader) throws ClassNotFoundException {
- return newInstance(classLoader.loadClass(javaClassName));
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and parameters.
- * Class#newInstance(Class<?>[] parameterTypes, Object[] parameters)
- */
- public static <T> T newInstance(Class<T> javaClass, Class<?>[] parameterTypes, Object[] parameters) {
- try {
- return attemptNewInstance(javaClass, parameterTypes, parameters);
- } catch (NoSuchMethodException nsme) {
- throw new RuntimeException(nsme + CR + fullyQualifiedConstructorSignature(javaClass, parameterTypes), nsme);
- }
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and parameters.
- * Class#newInstance(Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object newInstance(String javaClassName, Class<?>[] parameterTypes, Object[] parameters) throws ClassNotFoundException {
- return newInstance(javaClassName, parameterTypes, parameters, ClassTools.class.getClassLoader());
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and parameters.
- * Class#newInstance(Class<?>[] parameterTypes, Object[] parameters)
- */
- public static Object newInstance(String javaClassName, Class<?>[] parameterTypes, Object[] parameters, ClassLoader classLoader) throws ClassNotFoundException {
- return newInstance(classLoader.loadClass(javaClassName), parameterTypes, parameters);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * given the constructor parameter type and parameter.
- * Class#newInstance(Class<?> parameterType, Object parameter)
- */
- public static <T> T newInstance(Class<T> javaClass, Class<?> parameterType, Object parameter) {
- return newInstance(javaClass, new Class[] {parameterType}, new Object[] {parameter});
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter type and parameter.
- * Class#newInstance(Class<?> parameterType, Object parameter)
- */
- public static Object newInstance(String javaClassName, Class<?> parameterType, Object parameter) throws ClassNotFoundException {
- return newInstance(javaClassName, parameterType, parameter, ClassTools.class.getClassLoader());
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter type and parameter.
- * Class#newInstance(Class<?> parameterType, Object parameter)
- */
- public static Object newInstance(String javaClassName, Class<?> parameterType, Object parameter, ClassLoader classLoader) throws ClassNotFoundException {
- return newInstance(classLoader.loadClass(javaClassName), parameterType, parameter);
- }
-
- /**
- * Push the declared fields for the specified class
- * onto the top of the stack.
- */
- private static void pushDeclaredFields(Class<?> javaClass, Stack<Field> stack) {
- Field[] fields = declaredFields(javaClass);
- for (int i = fields.length; i-- > 0; ) {
- stack.push(fields[i]);
- }
- }
-
- /**
- * Push the declared methods for the specified class
- * onto the top of the stack.
- */
- private static void pushDeclaredMethods(Class<?> javaClass, Stack<Method> stack) {
- Method[] methods = declaredMethods(javaClass);
- for (int i = methods.length; i-- > 0; ) {
- stack.push(methods[i]);
- }
- }
-
- /**
- * Set a field value, given the containing object, field name, and new field value.
- * Useful for accessing private, package, or protected fields.
- * Object#setFieldValue(String fieldName, Object fieldValue)
- */
- public static void setFieldValue(Object object, String fieldName, Object fieldValue) {
- try {
- attemptToSetFieldValue(object, fieldName, fieldValue);
- } catch (NoSuchFieldException nsfe) {
- throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(object, fieldName), nsfe);
- }
- }
-
- /**
- * Set a static field value, given the containing class, field name, and new field value.
- * Useful for accessing private, package, or protected fields.
- * Class#setStaticFieldValue(String fieldName, Object fieldValue)
- */
- public static void setStaticFieldValue(Class<?> javaClass, String fieldName, Object fieldValue) {
- try {
- attemptToSetStaticFieldValue(javaClass, fieldName, fieldValue);
- } catch (NoSuchFieldException nsfe) {
- throw new RuntimeException(nsfe + CR + fullyQualifiedFieldName(javaClass, fieldName), nsfe);
- }
- }
-
- /**
- * Return the short name of the object's class.
- * Class#getShortName()
- */
- public static String shortClassNameForObject(Object object) {
- return shortNameFor(object.getClass());
- }
-
- /**
- * Return the short name of the class (e.g. "Object").
- * Class#getShortName()
- */
- public static String shortNameForClassNamed(String className) {
- return className.substring(className.lastIndexOf('.') + 1);
- }
-
- /**
- * Return the short name of the class (e.g. "Object").
- * Class#getShortName()
- */
- public static String shortNameFor(Class<?> javaClass) {
- return shortNameForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the nested name of the object's class.
- * Class#getNestedName()
- */
- public static String nestedClassNameForObject(Object object) {
- return nestedNameFor(object.getClass());
- }
-
- /**
- * Return the nested name of the class (e.g. "Entry").
- * Class#getNestedName()
- */
- public static String nestedNameForClassNamed(String className) {
- return className.substring(className.lastIndexOf(NESTED_CLASS_NAME_SEPARATOR) + 1);
- }
-
- /**
- * Return the nested name of the class (e.g. "Entry").
- * Class#getNestedName()
- */
- public static String nestedNameFor(Class<?> javaClass) {
- return nestedNameForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the "toString()" name of the object's class.
- */
- public static String toStringClassNameForObject(Object object) {
- return toStringNameFor(object.getClass());
- }
-
- /**
- * Return the "toString()" name of the class.
- * "Member" classes will return only the final name:
- * "com.foo.bar.TopLevelClass$MemberClass$NestedMemberClass"
- * => "NestedMemberClass"
- * "Local" and "anonymous" classes will still return the embedded '$'s:
- * "com.foo.bar.TopLevelClass$1LocalClass"
- * => "TopLevelClass$1LocalClass"
- * "com.foo.bar.TopLevelClass$1"
- * => "TopLevelClass$1"
- */
- public static String toStringNameForClassNamed(String className) {
- return classNamedIsMember(className) ?
- className.substring(className.lastIndexOf(NESTED_CLASS_NAME_SEPARATOR) + 1)
- :
- className.substring(className.lastIndexOf('.') + 1);
- }
-
- /**
- * Return the "toString()" name of the class.
- */
- public static String toStringNameFor(Class<?> javaClass) {
- return toStringNameForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the package name of the class (e.g. "java.lang").
- * Class#getPackageName()
- */
- public static String packageNameFor(Class<?> javaClass) {
- return packageNameForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the package name of the class (e.g. "java.lang").
- * Class#getPackageName()
- */
- public static String packageNameForClassNamed(String className) {
- int lastPeriod = className.lastIndexOf('.');
- if (lastPeriod == -1) {
- return "";
- }
- return className.substring(0, lastPeriod);
- }
-
- /**
- * Return the short name of the class,
- * followed by its package name (e.g. "Object (java.lang)").
- * Class#getShortNameWithPackage()
- */
- public static String shortNameWithPackage(Class<?> javaClass) {
- StringBuffer sb = new StringBuffer(200);
- sb.append(shortNameFor(javaClass));
- if ( ! javaClass.isPrimitive()) {
- sb.append(" (");
- sb.append(packageNameFor(javaClass));
- sb.append(')');
- }
- return sb.toString();
- }
-
- /**
- * Convenience method.
- * Return a zero-argument, static method for the specified class
- * and method name. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method staticMethod(Class<?> javaClass, String methodName) throws NoSuchMethodException {
- return staticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * Return a static method for the specified class, method name,
- * and formal parameter types. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method staticMethod(Class<?> javaClass, String methodName, Class<?>[] parameterTypes) throws NoSuchMethodException {
- Method method = method(javaClass, methodName, parameterTypes);
- if (Modifier.isStatic(method.getModifiers())) {
- return method;
- }
- throw new NoSuchMethodException(fullyQualifiedMethodSignature(javaClass, methodName, parameterTypes));
- }
-
- /**
- * Convenience method.
- * Return a static method for the specified class, method name,
- * and formal parameter type. If the class does not directly
- * implement the method, look for it in the class's superclasses.
- * Set accessible to true, so we can access
- * private/package/protected methods.
- */
- public static Method staticMethod(Class<?> javaClass, String methodName, Class<?> parameterTypes) throws NoSuchMethodException {
- return staticMethod(javaClass, methodName, new Class[] {parameterTypes});
- }
-
- /**
- * Return whether the specified class can be "declared" in code;
- * i.e. it is either a "top-level" class or a "member" class, but it
- * is not an "array" class. This method rolls together all the checks
- * from the other methods for a bit of a performance tweak.
- * Class#isDeclarable()
- */
- public static boolean classNamedIsDeclarable(String className) {
- if (className.charAt(0) == ARRAY_INDICATOR) {
- return false; // it is an "array" class
- }
- int index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR);
- if (index == -1) {
- return true; // it is a "top-level" class
- }
- do {
- // the character immediately after each dollar sign cannot be a digit
- index++;
- if (Character.isDigit(className.charAt(index))) {
- return false;
- }
- index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR, index);
- } while (index != -1);
- return true;
- }
-
- /**
- * Return whether the specified class is a "top-level" class,
- * as opposed to a "member", "local", or "anonymous" class,
- * using the standard jdk naming conventions (i.e. the class
- * name does NOT contain a '$': "TopLevelClass").
- * Class#isTopLevel()
- */
- public static boolean classNamedIsTopLevel(String className) {
- if (classNamedIsArray(className)) {
- return false;
- }
- return className.indexOf(NESTED_CLASS_NAME_SEPARATOR) == -1;
- }
-
- /**
- * Return whether the specified class is a "member" class,
- * as opposed to a "top-level", "local", or "anonymous" class,
- * using the standard jdk naming conventions (i.e. the class
- * name contains at least one '$' and all the names between
- * each '$' are legal class names:
- * "TopLevelClass$MemberClass$NestedMemberClass").
- * Class#isMember()
- */
- public static boolean classNamedIsMember(String className) {
- if (classNamedIsArray(className)) {
- return false;
- }
- int index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR);
- if (index == -1) {
- return false; // it is a "top-level" class
- }
- do {
- // the character immediately after each dollar sign cannot be a digit
- index++;
- if (Character.isDigit(className.charAt(index))) {
- return false;
- }
- index = className.indexOf(NESTED_CLASS_NAME_SEPARATOR, index);
- } while (index != -1);
- return true;
- }
-
- /**
- * Return whether the specified class is a "local" class,
- * as opposed to a "top-level", "member", or "anonymous" class,
- * using the standard jdk (or Eclipse) naming conventions.
- * In the jdk, the class name ends with '$nnnXXX' where the '$' is
- * followed by a series of numeric digits which are followed by the
- * local class name: "TopLevelClass$1LocalClass".
- * In Eclipse, the class name ends with '$nnn$XXX' where the '$' is
- * followed by a series of numeric digits which are separated from
- * the local class name by another '$': "TopLevelClass$1$LocalClass".
- * Class#isLocal()
- */
- public static boolean classNamedIsLocal(String className) {
- if (classNamedIsArray(className)) {
- return false;
- }
- int dollar = className.indexOf(NESTED_CLASS_NAME_SEPARATOR);
- if (dollar == -1) {
- return false;
- }
- if ( ! Character.isDigit(className.charAt(dollar + 1))) {
- return false;
- }
- int len = className.length();
- for (int i = dollar + 2; i < len; i++) {
- if (Character.isJavaIdentifierStart(className.charAt(i))) {
- return true;
- }
- }
- // all the characters past the $ are digits (anonymous)
- return false;
- }
-
- /**
- * Return whether the specified class is an "anonymous" class,
- * as opposed to a "top-level", "member", or "local" class,
- * using the standard jdk naming conventions (i.e. the class
- * name ends with '$nnn' where all the characters past the
- * last '$' are numeric digits: "TopLevelClass$1").
- * Class#isAnonymous()
- */
- public static boolean classNamedIsAnonymous(String className) {
- if (classNamedIsArray(className)) {
- return false;
- }
- int dollar = className.indexOf(NESTED_CLASS_NAME_SEPARATOR);
- if (dollar == -1) {
- return false;
- }
- int start = dollar + 1;
- for (int i = className.length(); i-- > start; ) {
- if ( ! Character.isDigit(className.charAt(i))) {
- return false;
- }
- }
- // all the characters past the $ are digits
- return true;
- }
-
- /**
- * Return the "array depth" of the specified class.
- * The depth is the number of dimensions for an array type.
- * Non-array types have a depth of zero.
- * Class#getArrayDepth()
- */
- public static int arrayDepthFor(Class<?> javaClass) {
- int depth = 0;
- while (javaClass.isArray()) {
- depth++;
- javaClass = javaClass.getComponentType();
- }
- return depth;
- }
-
- /**
- * Return the "array depth" of the specified object.
- * The depth is the number of dimensions for an array.
- * Non-arrays have a depth of zero.
- */
- public static int arrayDepthForObject(Object object) {
- return arrayDepthFor(object.getClass());
- }
-
- /**
- * Return the "array depth" of the specified class.
- * The depth is the number of dimensions for an array type.
- * Non-array types have a depth of zero.
- * @see java.lang.Class#getName()
- * Class#getArrayDepth()
- */
- public static int arrayDepthForClassNamed(String className) {
- int depth = 0;
- while (className.charAt(depth) == ARRAY_INDICATOR) {
- depth++;
- }
- return depth;
- }
-
- /**
- * Return whether the specified class is an array type.
- * @see java.lang.Class#getName()
- */
- public static boolean classNamedIsArray(String className) {
- return className.charAt(0) == ARRAY_INDICATOR;
- }
-
- /**
- * Return the "element type" of the specified class.
- * The element type is the base type held by an array type.
- * A non-array type simply returns itself.
- * Class#getElementType()
- */
- public static Class<?> elementTypeFor(Class<?> javaClass) {
- while (javaClass.isArray()) {
- javaClass = javaClass.getComponentType();
- }
- return javaClass;
- }
-
- /**
- * Return the "element type" of the specified object.
- * The element type is the base type held by an array.
- * A non-array simply returns its class.
- */
- public static Class<?> elementTypeForObject(Object object) {
- return elementTypeFor(object.getClass());
- }
-
- /**
- * Return the "element type" of the specified class.
- * The element type is the base type held by an array type.
- * Non-array types simply return themselves.
- * Class#getElementType()
- */
- public static String elementTypeNameFor(Class<?> javaClass) {
- return elementTypeFor(javaClass).getName();
- }
-
- /**
- * Return the "element type" of the specified class.
- * The element type is the base type held by an array type.
- * Non-array types simply return themselves.
- * @see java.lang.Class#getName()
- * Class#getElementType()
- */
- public static String elementTypeNameForClassNamed(String className) {
- int depth = arrayDepthForClassNamed(className);
- if (depth == 0) {
- // the name is in the form: "java.lang.Object" or "int"
- return className;
- }
- int last = className.length() - 1;
- if (className.charAt(depth) == REFERENCE_CLASS_CODE) {
- // the name is in the form: "[[[Ljava.lang.Object;"
- return className.substring(depth + 1, last); // drop the trailing ';'
- }
- // the name is in the form: "[[[I"
- return classNameForCode(className.charAt(last));
- }
-
- /**
- * Return whether the specified class is a "reference"
- * class (i.e. not void or one of the primitives).
- */
- public static boolean classNamedIsReference(String className) {
- return ! classNamedIsNonReference(className);
- }
-
- /**
- * Return whether the specified class is a "non-reference"
- * class (i.e. void or one of the primitives).
- */
- public static boolean classNamedIsNonReference(String className) {
- if (classNamedIsArray(className) || (className.length() > maxPrimitiveClassNameLength())) {
- return false; // performance tweak
- }
- PrimitiveClassCode[] codes = primitiveClassCodes();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass.getName().equals(className)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return the class name for the specified class code.
- * @see java.lang.Class#getName()
- */
- public static String classNameForCode(char classCode) {
- return classForCode(classCode).getName();
- }
-
- /**
- * Return the class name for the specified class code.
- * @see java.lang.Class#getName()
- */
- public static String classNameForCode(int classCode) {
- return classNameForCode((char) classCode);
- }
-
- /**
- * Return the class for the specified class code.
- * @see java.lang.Class#getName()
- */
- public static Class<?> classForCode(char classCode) {
- PrimitiveClassCode[] codes = primitiveClassCodes();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].code == classCode) {
- return codes[i].javaClass;
- }
- }
- throw new IllegalArgumentException(String.valueOf(classCode));
- }
-
- /**
- * Return the class for the specified class code.
- * @see java.lang.Class#getName()
- */
- public static Class<?> classForCode(int classCode) {
- return classForCode((char) classCode);
- }
-
- /**
- * Return the class code for the specified class.
- * @see java.lang.Class.getName()
- */
- public static char codeForClass(Class<?> javaClass) {
- if (( ! javaClass.isArray()) && (javaClass.getName().length() <= maxPrimitiveClassNameLength())) {
- PrimitiveClassCode[] codes = primitiveClassCodes();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass == javaClass) {
- return codes[i].code;
- }
- }
- }
- throw new IllegalArgumentException(javaClass.getName());
- }
-
- /**
- * Return the class code for the specified class.
- * @see java.lang.Class.getName()
- */
- public static char codeForClassNamed(String className) {
- if (( ! classNamedIsArray(className)) && (className.length() <= maxPrimitiveClassNameLength())) {
- PrimitiveClassCode[] codes = primitiveClassCodes();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass.getName().equals(className)) {
- return codes[i].code;
- }
- }
- }
- throw new IllegalArgumentException(className);
- }
-
- /**
- * Return the class for specified "type declaration".
- */
- public static Class<?> classForTypeDeclaration(String elementTypeName, int arrayDepth) throws ClassNotFoundException {
- return classForTypeDeclaration(elementTypeName, arrayDepth, ClassTools.class.getClassLoader());
- }
-
- /**
- * Return the class for specified "type declaration",
- * using the specified class loader.
- */
- public static Class<?> classForTypeDeclaration(String elementTypeName, int arrayDepth, ClassLoader classLoader) throws ClassNotFoundException {
- // primitives cannot be loaded via Class#forName(),
- // so check for a primitive class name first
- PrimitiveClassCode pcc = null;
- if (elementTypeName.length() <= maxPrimitiveClassNameLength()) { // performance tweak
- PrimitiveClassCode[] codes = primitiveClassCodes();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass.getName().equals(elementTypeName)) {
- pcc = codes[i];
- break;
- }
- }
- }
-
- // non-array
- if (arrayDepth == 0) {
- return (pcc == null) ? classLoader.loadClass(elementTypeName) : pcc.javaClass;
- }
-
- // array
- StringBuffer sb = new StringBuffer(100);
- for (int i = arrayDepth; i-- > 0; ) {
- sb.append(ARRAY_INDICATOR);
- }
- if (pcc == null) {
- sb.append(REFERENCE_CLASS_CODE);
- sb.append(elementTypeName);
- sb.append(REFERENCE_CLASS_NAME_DELIMITER);
- } else {
- sb.append(pcc.code);
- }
- return classLoader.loadClass(sb.toString());
- }
-
- /**
- * Return the class name for specified "type declaration".
- */
- public static String classNameForTypeDeclaration(String elementTypeName, int arrayDepth) {
- // non-array
- if (arrayDepth == 0) {
- return elementTypeName;
- }
-
- if (elementTypeName.equals(void.class.getName())) {
- throw new IllegalArgumentException("'void' must have an array depth of zero: " + arrayDepth + '.');
- }
- // array
- StringBuffer sb = new StringBuffer(100);
- for (int i = arrayDepth; i-- > 0; ) {
- sb.append(ARRAY_INDICATOR);
- }
-
- // look for a primitive first
- PrimitiveClassCode pcc = null;
- if (elementTypeName.length() <= maxPrimitiveClassNameLength()) { // performance tweak
- PrimitiveClassCode[] codes = primitiveClassCodes();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass.getName().equals(elementTypeName)) {
- pcc = codes[i];
- break;
- }
- }
- }
-
- if (pcc == null) {
- sb.append(REFERENCE_CLASS_CODE);
- sb.append(elementTypeName);
- sb.append(REFERENCE_CLASS_NAME_DELIMITER);
- } else {
- sb.append(pcc.code);
- }
-
- return sb.toString();
- }
-
- private static int maxPrimitiveClassNameLength() {
- if (MAX_PRIMITIVE_CLASS_NAME_LENGTH == -1) {
- MAX_PRIMITIVE_CLASS_NAME_LENGTH = calculateMaxPrimitiveClassNameLength();
- }
- return MAX_PRIMITIVE_CLASS_NAME_LENGTH;
- }
-
- private static int calculateMaxPrimitiveClassNameLength() {
- int max = -1;
- PrimitiveClassCode[] codes = primitiveClassCodes();
- for (int i = codes.length; i-- > 0; ) {
- int len = codes[i].javaClass.getName().length();
- if (len > max) {
- max = len;
- }
- }
- return max;
- }
-
- private static PrimitiveClassCode[] primitiveClassCodes() {
- if (PRIMITIVE_CLASS_CODES == null) {
- PRIMITIVE_CLASS_CODES = buildPrimitiveClassCodes();
- }
- return PRIMITIVE_CLASS_CODES;
- }
-
- private static PrimitiveClassCode[] buildPrimitiveClassCodes() {
- PrimitiveClassCode[] result = new PrimitiveClassCode[9];
- result[0] = new PrimitiveClassCode(BYTE_CODE, byte.class);
- result[1] = new PrimitiveClassCode(CHAR_CODE, char.class);
- result[2] = new PrimitiveClassCode(DOUBLE_CODE, double.class);
- result[3] = new PrimitiveClassCode(FLOAT_CODE, float.class);
- result[4] = new PrimitiveClassCode(INT_CODE, int.class);
- result[5] = new PrimitiveClassCode(LONG_CODE, long.class);
- result[6] = new PrimitiveClassCode(SHORT_CODE, short.class);
- result[7] = new PrimitiveClassCode(BOOLEAN_CODE, boolean.class);
- result[8] = new PrimitiveClassCode(VOID_CODE, void.class);
- return result;
- }
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private ClassTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-
- // ********** member class **********
-
- private static class PrimitiveClassCode {
- char code;
- Class<?> javaClass;
- PrimitiveClassCode(char code, Class<?> javaClass) {
- this.code = code;
- this.javaClass = javaClass;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java
deleted file mode 100644
index 0eac533075..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java
+++ /dev/null
@@ -1,910 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.IOException;
-import java.io.Serializable;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * TODO
- */
-public class Classpath
- implements Serializable
-{
- /** The entries in the classpath */
- private final Entry[] entries;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** static methods **********
-
- // ***** factory methods for "standard" classpaths *****
-
- /**
- * Return the Java "boot" classpath. This includes rt.jar.
- */
- public static Classpath bootClasspath() {
- return new Classpath(System.getProperty("sun.boot.class.path"));
- }
-
- /**
- * Return a "virtual classpath" that contains all the jars
- * that would be used by the Java Extension Mechanism.
- */
- public static Classpath javaExtensionClasspath() {
- File[] dirs = javaExtensionDirectories();
- List<String> jarFileNames = new ArrayList<String>();
- for (File dir : dirs) {
- if (dir.isDirectory()) {
- addJarFileNamesTo(dir, jarFileNames);
- }
- }
- return new Classpath(jarFileNames);
- }
-
- /**
- * Return the Java "system" classpath.
- */
- public static Classpath javaClasspath() {
- return new Classpath(System.getProperty("java.class.path"));
- }
-
- /**
- * Return the unretouched "complete" classpath.
- * This includes the boot classpath, the Java Extension
- * Mechanism classpath, and the normal "system" classpath.
- */
- public static Classpath completeClasspath() {
- return new Classpath(new Classpath[] {
- bootClasspath(),
- javaExtensionClasspath(),
- javaClasspath()
- });
- }
-
- /**
- * Return a classpath that contains the location of the specified class.
- */
- public static Classpath classpathFor(Class<?> javaClass) {
- return new Classpath(locationFor(javaClass));
- }
-
-
- // ***** file => class *****
-
- /**
- * Convert a relative file name to a class name; this will work for
- * any file that has a single extension beyond the base
- * class name.
- * e.g. "java/lang/String.class" is converted to "java.lang.String"
- * e.g. "java/lang/String.java" is converted to "java.lang.String"
- */
- public static String convertToClassName(String classFileName) {
- String className = FileTools.stripExtension(classFileName);
- // do this for archive entry names
- className = className.replace('/', '.');
- // do this for O/S-specific file names
- if (File.separatorChar != '/') {
- className = className.replace(File.separatorChar, '.');
- }
- return className;
- }
-
- /**
- * Convert a file to a class name;
- * e.g. File(java/lang/String.class) is converted to "java.lang.String"
- */
- public static String convertToClassName(File classFile) {
- return convertToClassName(classFile.getPath());
- }
-
- /**
- * Convert a relative file name to a class;
- * e.g. "java/lang/String.class" is converted to java.lang.String.class
- */
- public static Class<?> convertToClass(String classFileName) throws ClassNotFoundException {
- return Class.forName(convertToClassName(classFileName));
- }
-
- /**
- * Convert a relative file to a class;
- * e.g. File(java/lang/String.class) is converted to java.lang.String.class
- */
- public static Class<?> convertToClass(File classFile) throws ClassNotFoundException {
- return convertToClass(classFile.getPath());
- }
-
-
- // ***** class => JAR entry *****
-
- /**
- * Convert a class name to an archive entry name base;
- * e.g. "java.lang.String" is converted to "java/lang/String"
- */
- public static String convertToArchiveEntryNameBase(String className) {
- return className.replace('.', '/');
- }
-
- /**
- * Convert a class to an archive entry name base;
- * e.g. java.lang.String.class is converted to "java/lang/String"
- */
- public static String convertToArchiveEntryNameBase(Class<?> javaClass) {
- return convertToArchiveEntryNameBase(javaClass.getName());
- }
-
- /**
- * Convert a class name to an archive class file entry name;
- * e.g. "java.lang.String" is converted to "java/lang/String.class"
- */
- public static String convertToArchiveClassFileEntryName(String className) {
- return convertToArchiveEntryNameBase(className) + ".class";
- }
-
- /**
- * Convert a class to an archive class file entry name;
- * e.g. java.lang.String.class is converted to "java/lang/String.class"
- */
- public static String convertToArchiveClassFileEntryName(Class<?> javaClass) {
- return convertToArchiveClassFileEntryName(javaClass.getName());
- }
-
-
- // ***** class => file (.class or .java) *****
-
- /**
- * Convert a class name to a file name base for the current O/S;
- * e.g. "java.lang.String" is converted to "java/lang/String" on Unix
- * and "java\\lang\\String" on Windows
- */
- public static String convertToFileNameBase(String className) {
- return className.replace('.', File.separatorChar);
- }
-
- /**
- * Convert a class to a file name base for the current O/S;
- * e.g. java.lang.String.class is converted to "java/lang/String" on Unix
- * and "java\\lang\\String" on Windows
- */
- public static String convertToFileNameBase(Class<?> javaClass) {
- return convertToFileNameBase(javaClass.getName());
- }
-
- /**
- * Convert a class name to a class file name for the current O/S;
- * e.g. "java.lang.String" is converted to "java/lang/String.class" on Unix
- * and "java\\lang\\String.class" on Windows
- */
- public static String convertToClassFileName(String className) {
- return convertToFileNameBase(className) + ".class";
- }
-
- /**
- * Convert a class to a class file name for the current O/S;
- * e.g. java.lang.String.class is converted to "java/lang/String.class" on Unix
- * and "java\\lang\\String.class" on Windows
- */
- public static String convertToClassFileName(Class<?> javaClass) {
- return convertToClassFileName(javaClass.getName());
- }
-
- /**
- * Convert a class name to a class file for the current O/S;
- * e.g. "java.lang.String" is converted to File(java/lang/String.class)
- */
- public static File convertToClassFile(String className) {
- return new File(convertToClassFileName(className));
- }
-
- /**
- * Convert a class to a class file for the current O/S;
- * e.g. java.lang.String.class is converted to File(java/lang/String.class)
- */
- public static File convertToClassFile(Class<?> javaClass) {
- return convertToClassFile(javaClass.getName());
- }
-
- /**
- * Convert a class name to a java file name for the current O/S;
- * e.g. "java.lang.String" is converted to "java/lang/String.java" on Unix
- * and "java\\lang\\String.java" on Windows
- */
- public static String convertToJavaFileName(String className) {
- return convertToFileNameBase(className) + ".java";
- }
-
- /**
- * Convert a class to a java file name for the current O/S;
- * e.g. java.lang.String.class is converted to "java/lang/String.java" on Unix
- * and "java\\lang\\String.java" on Windows
- */
- public static String convertToJavaFileName(Class<?> javaClass) {
- return convertToJavaFileName(javaClass.getName());
- }
-
- /**
- * Convert a class name to a java file for the current O/S;
- * e.g. "java.lang.String" is converted to File(java/lang/String.java)
- */
- public static File convertToJavaFile(String className) {
- return new File(convertToJavaFileName(className));
- }
-
- /**
- * Convert a class to a java file for the current O/S;
- * e.g. java.lang.String.class is converted to File(java/lang/String.java)
- */
- public static File convertToJavaFile(Class<?> javaClass) {
- return convertToJavaFile(javaClass.getName());
- }
-
-
- // ***** class => resource *****
-
- /**
- * Convert a class to a resource name;
- * e.g. java.lang.String.class is converted to "/java/lang/String.class".
- */
- public static String convertToResourceName(Class<?> javaClass) {
- return '/' + convertToArchiveClassFileEntryName(javaClass);
- }
-
- /**
- * Convert a class to a resource;
- * e.g. java.lang.String.class is converted to
- * URL(jar:file:/C:/jdk/1.4.2_04/jre/lib/rt.jar!/java/lang/String.class).
- */
- public static URL convertToResource(Class<?> javaClass) {
- return javaClass.getResource(convertToResourceName(javaClass));
- }
-
-
- // ***** utilities *****
-
- /**
- * Return whether the specified file is an archive file;
- * i.e. its name ends with ".zip" or ".jar"
- */
- public static boolean fileNameIsArchive(String fileName) {
- String ext = FileTools.extension(fileName).toLowerCase();
- return ext.equals(".jar") || ext.equals(".zip");
- }
-
- /**
- * Return whether the specified file is an archive file;
- * i.e. its name ends with ".zip" or ".jar"
- */
- public static boolean fileIsArchive(File file) {
- return fileNameIsArchive(file.getName());
- }
-
- /**
- * Return what should be the fully-qualified file name
- * for the JRE runtime JAR;
- * e.g. "C:\jdk1.4.2_04\jre\lib\rt.jar".
- */
- public static String rtJarName() {
- return locationFor(java.lang.Object.class);
- }
-
- /**
- * Return the location from where the specified class was loaded.
- */
- public static String locationFor(Class<?> javaClass) {
- URL url = convertToResource(javaClass);
- String path;
- try {
- path = FileTools.buildFile(url).getPath();
- } catch (URISyntaxException ex) {
- throw new RuntimeException(ex);
- }
- String protocol = url.getProtocol().toLowerCase();
- if (protocol.equals("jar")) {
- // if the class is in a JAR, the URL will look something like this:
- // jar:file:/C:/jdk/1.4.2_04/jre/lib/rt.jar!/java/lang/String.class
- return path.substring(0, path.indexOf('!'));
- } else if (protocol.equals("file")) {
- // if the class is in a directory, the URL will look something like this:
- // file:/C:/dev/main/mwdev/class/org/eclipse/dali/utility/Classpath.class
- return path.substring(0, path.length() - convertToClassFileName(javaClass).length() - 1);
- } else if (protocol.equals("bundleresource")) {
- // if the class is in a bundle resource (Eclipse?), the URL will look something like this:
- // bundleresource://43/org/eclipse/dali/utility/Classpath.class
- return path.substring(0, path.length() - convertToClassFileName(javaClass).length() - 1);
- }
-
- throw new IllegalStateException(url.toString());
- }
-
- /**
- * Return the directories used by the Java Extension Mechanism.
- */
- public static File[] javaExtensionDirectories() {
- return convertToFiles(javaExtensionDirectoryNames());
- }
-
- /**
- * Return the directory names used by the Java Extension Mechanism.
- */
- public static String[] javaExtensionDirectoryNames() {
- return System.getProperty("java.ext.dirs").split(File.pathSeparator);
- }
-
-
- // ***** internal *****
-
- private static File[] convertToFiles(String[] fileNames) {
- File[] files = new File[fileNames.length];
- for (int i = fileNames.length; i-- > 0; ) {
- files[i] = new File(fileNames[i]);
- }
- return files;
- }
-
- private static void addJarFileNamesTo(File dir, List<String> jarFileNames) {
- File[] jarFiles = jarFilesIn(dir);
- for (File jarFile : jarFiles) {
- jarFileNames.add(FileTools.canonicalFile(jarFile).getPath());
- }
- }
-
- private static File[] jarFilesIn(File directory) {
- return directory.listFiles(jarFileFilter());
- }
-
- private static FileFilter jarFileFilter() {
- return new FileFilter() {
- public boolean accept(File file) {
- return FileTools.extension(file.getName()).toLowerCase().equals(".jar");
- }
- };
- }
-
-
- // ********** constructors **********
-
- /**
- * Construct a classpath with the specified entries.
- */
- private Classpath(Entry[] entries) {
- super();
- this.entries = entries;
- }
-
- /**
- * Construct a classpath with the specified entries.
- */
- public Classpath(String[] fileNames) {
- this(buildEntries(fileNames));
- }
-
- /**
- * Skip empty file names because they will end up expanding to the current
- * working directory, which is not what we want. Empty file names actually
- * occur with some frequency; such as when the classpath has been built up
- * dynamically with too many separators. For example:
- * "C:\dev\foo.jar;;C:\dev\bar.jar"
- * will be parsed into three file names:
- * { "C:\dev\foo.jar", "", "C:\dev\bar.jar" }
- */
- private static Entry[] buildEntries(String[] fileNames) {
- List<Entry> entries = new ArrayList<Entry>();
- for (String fileName : fileNames) {
- if ((fileName != null) && (fileName.length() != 0)) {
- entries.add(new Entry(fileName));
- }
- }
- return entries.toArray(new Entry[entries.size()]);
- }
-
- /**
- * Construct a classpath with the specified path.
- */
- public Classpath(String path) {
- this(path.split(File.pathSeparator));
- }
-
- /**
- * Construct a classpath with the specified entries.
- */
- public Classpath(List<String> fileNames) {
- this(fileNames.toArray(new String[fileNames.size()]));
- }
-
- /**
- * Consolidate the specified classpaths into a single classpath.
- */
- public Classpath(Classpath[] classpaths) {
- this(consolidateEntries(classpaths));
- }
-
- private static Entry[] consolidateEntries(Classpath[] classpaths) {
- List<Entry> entries = new ArrayList<Entry>();
- for (Classpath classpath : classpaths) {
- CollectionTools.addAll(entries, classpath.getEntries());
- }
- return entries.toArray(new Entry[entries.size()]);
- }
-
-
- // ********** public API **********
-
- /**
- * Return the classpath's entries.
- */
- public Entry[] getEntries() {
- return this.entries;
- }
-
- /**
- * Return the classpath's path.
- */
- public String path() {
- Entry[] localEntries = this.entries;
- int max = localEntries.length - 1;
- if (max == -1) {
- return "";
- }
- StringBuffer sb = new StringBuffer(2000);
- // stop one short of the end of the array
- for (int i = 0; i < max; i++) {
- sb.append(localEntries[i].fileName());
- sb.append(File.pathSeparatorChar);
- }
- sb.append(localEntries[max].fileName());
- return sb.toString();
- }
-
- /**
- * Search the classpath for the specified (unqualified) file
- * and return its entry. Return null if an entry is not found.
- * For example, you could use this method to find the entry
- * for "rt.jar" or "toplink.jar".
- */
- public Entry entryForFileNamed(String shortFileName) {
- Entry[] localEntries = this.entries;
- for (Entry entry : localEntries) {
- if (entry.file().getName().equals(shortFileName)) {
- return entry;
- }
- }
- return null;
- }
-
- /**
- * Return the first entry file in the classpath
- * that contains the specified class.
- * Return null if an entry is not found.
- */
- public Entry entryForClassNamed(String className) {
- String relativeClassFileName = convertToClassFileName(className);
- String archiveEntryName = convertToArchiveClassFileEntryName(className);
- Entry[] localEntries = this.entries;
- for (Entry entry : localEntries) {
- if (entry.contains(relativeClassFileName, archiveEntryName)) {
- return entry;
- }
- }
- return null;
- }
-
- /**
- * Return the names of all the classes discovered on the classpath,
- * with duplicates removed.
- */
- public String[] classNames() {
- return this.classNames(Filter.Null.<String>instance());
- }
-
- /**
- * Return the names of all the classes discovered on the classpath
- * and accepted by the specified filter, with duplicates removed.
- */
- public String[] classNames(Filter<String> filter) {
- Collection<String> classNames = new HashSet<String>(10000);
- this.addClassNamesTo(classNames, filter);
- return classNames.toArray(new String[classNames.size()]);
- }
-
- /**
- * Add the names of all the classes discovered on the classpath
- * to the specified collection.
- */
- public void addClassNamesTo(Collection<String> classNames) {
- this.addClassNamesTo(classNames, Filter.Null.<String>instance());
- }
-
- /**
- * Add the names of all the classes discovered on the classpath
- * and accepted by the specified filter to the specified collection.
- */
- public void addClassNamesTo(Collection<String> classNames, Filter<String> filter) {
- Entry[] localEntries = this.entries;
- for (Entry entry : localEntries) {
- entry.addClassNamesTo(classNames, filter);
- }
- }
-
- /**
- * Return the names of all the classes discovered on the classpath.
- * Just a bit more performant than #classNames().
- */
- public Iterator<String> classNamesStream() {
- return this.classNamesStream(Filter.Null.<String>instance());
- }
-
- /**
- * Return the names of all the classes discovered on the classpath
- * that are accepted by the specified filter.
- * Just a bit more performant than #classNames(Filter).
- */
- public Iterator<String> classNamesStream(Filter<String> filter) {
- return new CompositeIterator<String>(this.entryClassNamesStreams(filter));
- }
-
- private Iterator<Iterator<String>> entryClassNamesStreams(final Filter<String> filter) {
- return new TransformationIterator<Entry, Iterator<String>>(new ArrayIterator<Entry>(this.entries)) {
- @Override
- protected Iterator<String> transform(Entry entry) {
- return entry.classNamesStream(filter);
- }
- };
- }
-
- /**
- * Return a "compressed" version of the classpath with its
- * duplicate entries eliminated.
- */
- public Classpath compressed() {
- return new Classpath((Entry[]) CollectionTools.removeDuplicateElements(this.entries));
- }
-
- /**
- * Convert the classpath to an array of URLs
- * (that can be used to instantiate a URLClassLoader).
- */
- public URL[] urls() {
- Entry[] localEntries = this.entries;
- int len = localEntries.length;
- URL[] urls = new URL[len];
- for (int i = 0; i < len; i++) {
- urls[i] = localEntries[i].url();
- }
- return urls;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.path());
- }
-
-
- // ********** inner class **********
-
- /**
- * TODO
- */
- public static class Entry implements Serializable {
- private final String fileName;
- private final File file;
- private final File canonicalFile;
-
- private static final long serialVersionUID = 1L;
-
- Entry(String fileName) {
- super();
- if ((fileName == null) || (fileName.length() == 0)) {
- throw new IllegalArgumentException("'fileName' must be non-empty");
- }
- this.fileName = fileName;
- this.file = new File(fileName);
- this.canonicalFile = FileTools.canonicalFile(this.file);
- }
-
- public String fileName() {
- return this.fileName;
- }
-
- public File file() {
- return this.file;
- }
-
- public File canonicalFile() {
- return this.canonicalFile;
- }
-
- public String canonicalFileName() {
- return this.canonicalFile.getAbsolutePath();
- }
-
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof Entry)) {
- return false;
- }
- return ((Entry) o).canonicalFile.equals(this.canonicalFile);
- }
-
- @Override
- public int hashCode() {
- return this.canonicalFile.hashCode();
- }
-
- /**
- * Return the entry's "canonical" URL.
- */
- public URL url() {
- try {
- return this.canonicalFile.toURL();
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * Return whether the entry contains the specified class.
- */
- public boolean contains(Class<?> javaClass) {
- return this.contains(javaClass.getName());
- }
-
- /**
- * Return whether the entry contains the specified class.
- */
- public boolean contains(String className) {
- return this.contains(convertToClassFileName(className), convertToArchiveClassFileEntryName(className));
- }
-
- /**
- * Return whether the entry contains either the specified relative
- * class file or the specified archive entry.
- * Not the prettiest signature, but it's internal....
- */
- boolean contains(String relativeClassFileName, String archiveEntryName) {
- if ( ! this.canonicalFile.exists()) {
- return false;
- }
- if (this.canonicalFile.isDirectory() && (new File(this.canonicalFile, relativeClassFileName)).exists()) {
- return true;
- }
- return (fileIsArchive(this.canonicalFile) && this.archiveContainsEntry(archiveEntryName));
- }
-
- /**
- * Return whether the entry's archive contains the specified entry.
- */
- private boolean archiveContainsEntry(String zipEntryName) {
- ZipFile zipFile = null;
- ZipEntry zipEntry = null;
- try {
- zipFile = new ZipFile(this.canonicalFile);
- zipEntry = zipFile.getEntry(zipEntryName);
- } catch (IOException ex) {
- zipEntry = null; // something is wrong, clear out the entry
- } finally {
- try {
- if (zipFile != null) {
- zipFile.close();
- }
- } catch (IOException ex) {
- zipEntry = null; // something is wrong, clear out the entry
- }
- }
- return zipEntry != null;
- }
-
- /**
- * Return the names of all the classes discovered in the entry.
- */
- public String[] classNames() {
- return this.classNames(Filter.Null.<String>instance());
- }
-
- /**
- * Return the names of all the classes discovered in the entry
- * and accepted by the specified filter.
- */
- public String[] classNames(Filter<String> filter) {
- Collection<String> classNames = new ArrayList<String>(2000);
- this.addClassNamesTo(classNames, filter);
- return classNames.toArray(new String[classNames.size()]);
- }
-
- /**
- * Add the names of all the classes discovered in the entry
- * to the specified collection.
- */
- public void addClassNamesTo(Collection<String> classNames) {
- this.addClassNamesTo(classNames, Filter.Null.<String>instance());
- }
-
- /**
- * Add the names of all the classes discovered in the entry
- * and accepted by the specified filter to the specified collection.
- */
- public void addClassNamesTo(Collection<String> classNames, Filter<String> filter) {
- if (this.canonicalFile.exists()) {
- if (this.canonicalFile.isDirectory()) {
- this.addClassNamesForDirectoryTo(classNames, filter);
- } else if (fileIsArchive(this.canonicalFile)) {
- this.addClassNamesForArchiveTo(classNames, filter);
- }
- }
- }
-
- /**
- * Add the names of all the classes discovered
- * under the entry's directory and accepted by
- * the specified filter to the specified collection.
- */
- private void addClassNamesForDirectoryTo(Collection<String> classNames, Filter<String> filter) {
- int start = this.canonicalFile.getAbsolutePath().length() + 1;
- for (Iterator<File> stream = this.classFilesForDirectory(); stream.hasNext(); ) {
- String className = convertToClassName(stream.next().getAbsolutePath().substring(start));
- if (filter.accept(className)) {
- classNames.add(className);
- }
- }
- }
-
- /**
- * Return an iterator on all the class files discovered
- * under the entry's directory.
- */
- private Iterator<File> classFilesForDirectory() {
- return new FilteringIterator<File>(FileTools.filesInTree(this.canonicalFile)) {
- @Override
- protected boolean accept(Object next) {
- return Entry.this.fileNameMightBeForClassFile(((File) next).getName());
- }
- };
- }
-
- /**
- * Add the names of all the classes discovered
- * in the entry's archive file and accepted by the
- * specified filter to the specified collection.
- */
- private void addClassNamesForArchiveTo(Collection<String> classNames, Filter<String> filter) {
- ZipFile zipFile = null;
- try {
- zipFile = new ZipFile(this.canonicalFile);
- } catch (IOException ex) {
- return;
- }
- for (Enumeration<? extends ZipEntry> stream = zipFile.entries(); stream.hasMoreElements(); ) {
- ZipEntry zipEntry = stream.nextElement();
- String zipEntryName = zipEntry.getName();
- if (this.fileNameMightBeForClassFile(zipEntryName)) {
- String className = convertToClassName(zipEntryName);
- if (filter.accept(className)) {
- classNames.add(className);
- }
- }
- }
- try {
- zipFile.close();
- } catch (IOException ex) {
- return;
- }
- }
-
- /**
- * Return whether the specified file might be a Java class file.
- * The file name must at least end with ".class" and contain no spaces.
- * (Neither class names nor package names may contain spaces.)
- * Whether it actually is a class file will need to be determined by
- * a class loader.
- */
- boolean fileNameMightBeForClassFile(String name) {
- return FileTools.extension(name).toLowerCase().equals(".class")
- && (name.indexOf(' ') == -1);
- }
-
- /**
- * Return the names of all the classes discovered on the classpath.
- * Just a bit more performant than #classNames().
- */
- public Iterator<String> classNamesStream() {
- return this.classNamesStream(Filter.Null.<String>instance());
- }
-
- /**
- * Return the names of all the classes discovered on the classpath
- * that are accepted by the specified filter.
- * Just a bit more performant than #classNames(Filter).
- */
- public Iterator<String> classNamesStream(Filter<String> filter) {
- if (this.canonicalFile.exists()) {
- if (this.canonicalFile.isDirectory()) {
- return this.classNamesForDirectory(filter);
- }
- if (fileIsArchive(this.canonicalFile)) {
- return this.classNamesForArchive(filter);
- }
- }
- return EmptyIterator.instance();
- }
-
- /**
- * Return the names of all the classes discovered
- * under the entry's directory and accepted by
- * the specified filter.
- */
- private Iterator<String> classNamesForDirectory(Filter<String> filter) {
- return new FilteringIterator<String>(this.classNamesForDirectory(), filter);
- }
-
- /**
- * Transform the class files to class names.
- */
- private Iterator<String> classNamesForDirectory() {
- final int start = this.canonicalFile.getAbsolutePath().length() + 1;
- return new TransformationIterator<File, String>(this.classFilesForDirectory()) {
- @Override
- protected String transform(File f) {
- return convertToClassName(f.getAbsolutePath().substring(start));
- }
- };
- }
-
- /**
- * Return the names of all the classes discovered
- * in the entry's archive file and accepted by the
- * specified filter.
- */
- private Iterator<String> classNamesForArchive(Filter<String> filter) {
- // we can't simply wrap iterators here because we need to close the archive file...
- ZipFile zipFile = null;
- try {
- zipFile = new ZipFile(this.canonicalFile);
- } catch (IOException ex) {
- return EmptyIterator.instance();
- }
- Collection<String> classNames = new HashSet<String>(zipFile.size());
- for (Enumeration<? extends ZipEntry> stream = zipFile.entries(); stream.hasMoreElements(); ) {
- ZipEntry zipEntry = stream.nextElement();
- String zipEntryName = zipEntry.getName();
- if (this.fileNameMightBeForClassFile(zipEntryName)) {
- String className = convertToClassName(zipEntryName);
- if (filter.accept(className)) {
- classNames.add(className);
- }
- }
- }
- try {
- zipFile.close();
- } catch (IOException ex) {
- return EmptyIterator.instance();
- }
- return classNames.iterator();
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java
deleted file mode 100644
index e4df43b1f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java
+++ /dev/null
@@ -1,2417 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Random;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.Vector;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-
-public final class CollectionTools {
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the specified object to be added.
- * java.util.Arrays#add(Object[] array, Object o)
- */
- @SuppressWarnings("unchecked")
- public static <E> E[] add(E[] array, E value) {
- int len = array.length;
- E[] result = (E[]) Array.newInstance(array.getClass().getComponentType(), len + 1);
- System.arraycopy(array, 0, result, 0, len);
- result[len] = value;
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified object added at the specified index.
- * java.util.Arrays#add(Object[] array, int index, Object o)
- */
- @SuppressWarnings("unchecked")
- public static <E> E[] add(E[] array, int index, E value) {
- int len = array.length;
- E[] result = (E[]) Array.newInstance(array.getClass().getComponentType(), len + 1);
- if (index > 0) {
- System.arraycopy(array, 0, result, 0, index);
- }
- result[index] = value;
- if (len > index) {
- System.arraycopy(array, index, result, index + 1, len - index);
- }
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the specified value to be added.
- * java.util.Arrays#add(char[] array, char value)
- */
- public static char[] add(char[] array, char value) {
- int len = array.length;
- char[] result = new char[len + 1];
- System.arraycopy(array, 0, result, 0, len);
- result[len] = value;
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified value added at the specified index.
- * java.util.Arrays#add(char[] array, int index, char value)
- */
- public static char[] add(char[] array, int index, char value) {
- int len = array.length;
- char[] result = new char[len + 1];
- System.arraycopy(array, 0, result, 0, index);
- result[index] = value;
- System.arraycopy(array, index, result, index + 1, len - index);
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the specified value to be added.
- * java.util.Arrays#add(int[] array, int value)
- */
- public static int[] add(int[] array, int value) {
- int len = array.length;
- int[] result = new int[len + 1];
- System.arraycopy(array, 0, result, 0, len);
- result[len] = value;
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified value added at the specified index.
- * java.util.Arrays#add(int[] array, int index, int value)
- */
- public static int[] add(int[] array, int index, int value) {
- int len = array.length;
- int[] result = new int[len + 1];
- System.arraycopy(array, 0, result, 0, index);
- result[index] = value;
- System.arraycopy(array, index, result, index + 1, len - index);
- return result;
- }
-
- /**
- * Add all the elements returned by the specified iterator
- * to the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#addAll(java.util.Iterator iterator)
- */
- public static <E> boolean addAll(Collection<? super E> collection, Iterator<E> iterator) {
- boolean modified = false;
- while (iterator.hasNext()) {
- modified |= collection.add(iterator.next());
- }
- return modified;
- }
-
- /**
- * Add all the elements in the specified array
- * to the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#addAll(Object[] array)
- */
- public static <E> boolean addAll(Collection<? super E> collection, E[] array) {
- boolean modified = false;
- for (E item : array) {
- modified |= collection.add(item);
- }
- return modified;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the elements
- * in the specified collection.
- * java.util.Arrays#addAll(Object[] array, java.util.Collection c)
- */
- @SuppressWarnings("unchecked")
- public static <E> E[] addAll(E[] array, Collection<? extends E> collection) {
- int len = array.length;
- E[] result = (E[]) Array.newInstance(array.getClass().getComponentType(), array.length + collection.size());
- System.arraycopy(array, 0, result, 0, len);
- int i = len;
- for (E item : collection) {
- result[i++] = item;
- }
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the elements
- * in the specified iterator.
- * java.util.Arrays#addAll(Object[] array, java.util.Iterator iterator)
- */
- public static <E> E[] addAll(E[] array, Iterator<? extends E> iterator) {
- return addAll(array, list(iterator));
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array 1 followed by the elements
- * in the specified array 2.
- * java.util.Arrays#addAll(Object[] array1, Object[] array2)
- */
- @SuppressWarnings("unchecked")
- public static <E> E[] addAll(E[] array1, E[] array2) {
- int len1 = array1.length;
- int len2 = array2.length;
- E[] result = (E[]) Array.newInstance(array1.getClass().getComponentType(), len1 + len2);
- System.arraycopy(array1, 0, result, 0, len1);
- System.arraycopy(array2, 0, result, len1, len2);
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * first specified array with the objects in the second
- * specified array added at the specified index.
- * java.util.Arrays#add(Object[] array1, int index, Object[] array2)
- */
- @SuppressWarnings("unchecked")
- public static <E> E[] addAll(E[] array1, int index, E[] array2) {
- int len1 = array1.length;
- int len2 = array2.length;
- E[] result = (E[]) Array.newInstance(array1.getClass().getComponentType(), len1 + len2);
- System.arraycopy(array1, 0, result, 0, index);
- System.arraycopy(array2, 0, result, index, len2);
- System.arraycopy(array1, index, result, index + len2, len1 - index);
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array 1 followed by the elements
- * in the specified array 2.
- * java.util.Arrays#addAll(char[] array1, char[] array2)
- */
- public static char[] addAll(char[] array1, char[] array2) {
- int len1 = array1.length;
- int len2 = array2.length;
- char[] result = new char[len1 + len2];
- System.arraycopy(array1, 0, result, 0, len1);
- System.arraycopy(array2, 0, result, len1, len2);
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * first specified array with the objects in the second
- * specified array added at the specified index.
- * java.util.Arrays#add(char[] array1, int index, char[] array2)
- */
- public static char[] addAll(char[] array1, int index, char[] array2) {
- int len1 = array1.length;
- int len2 = array2.length;
- char[] result = new char[len1 + len2];
- System.arraycopy(array1, 0, result, 0, index);
- System.arraycopy(array2, 0, result, index, len2);
- System.arraycopy(array1, index, result, index + len2, len1 - index);
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array 1 followed by the elements
- * in the specified array 2.
- * java.util.Arrays#addAll(int[] array1, int[] array2)
- */
- public static int[] addAll(int[] array1, int[] array2) {
- int len1 = array1.length;
- int len2 = array2.length;
- int[] result = new int[len1 + len2];
- System.arraycopy(array1, 0, result, 0, len1);
- System.arraycopy(array2, 0, result, len1, len2);
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * first specified array with the objects in the second
- * specified array added at the specified index.
- * java.util.Arrays#add(int[] array1, int index, int[] array2)
- */
- public static int[] addAll(int[] array1, int index, int[] array2) {
- int len1 = array1.length;
- int len2 = array2.length;
- int[] result = new int[len1 + len2];
- System.arraycopy(array1, 0, result, 0, index);
- System.arraycopy(array2, 0, result, index, len2);
- System.arraycopy(array1, index, result, index + len2, len1 - index);
- return result;
- }
-
- /**
- * Return an array corresponding to the specified iterator.
- * @see java.util.Collection#toArray()
- * java.util.Iterator#toArray()
- */
- public static Object[] array(Iterator<?> iterator) {
- return list(iterator).toArray();
- }
-
- /**
- * Return an array corresponding to the specified iterator;
- * the runtime type of the returned array is that of the specified array.
- * If the collection fits in the specified array, it is returned therein.
- * Otherwise, a new array is allocated with the runtime type of the
- * specified array and the size of this collection.
- * @see java.util.Collection#toArray(java.lang.Object[])
- * java.util.Iterator#toArray(Object[])
- */
- public static <E> E[] array(Iterator<? extends E> iterator, E[] array) {
- return list(iterator).toArray(array);
- }
-
- /**
- * Return a bag corresponding to the specified enumeration.
- * HashBag(java.util.Enumeration enumeration)
- */
- public static <E> Bag<E> bag(Enumeration<? extends E> enumeration) {
- Bag<E> bag = new HashBag<E>();
- while (enumeration.hasMoreElements()) {
- bag.add(enumeration.nextElement());
- }
- return bag;
- }
-
- /**
- * Return a bag corresponding to the specified iterator.
- * HashBag(java.util.Iterator iterator)
- */
- public static <E> Bag<E> bag(Iterator<? extends E> iterator) {
- Bag<E> bag = new HashBag<E>();
- while (iterator.hasNext()) {
- bag.add(iterator.next());
- }
- return bag;
- }
-
- /**
- * Return a bag corresponding to the specified array.
- * HashBag(Object[] array)
- */
- public static <E> Bag<E> bag(E... array) {
- Bag<E> bag = new HashBag<E>(array.length);
- for (E item : array) {
- bag.add(item);
- }
- return bag;
- }
-
- /**
- * Return a collection corresponding to the specified enumeration.
- */
- public static <E> Collection<E> collection(Enumeration<? extends E> enumeration) {
- return bag(enumeration);
- }
-
- /**
- * Return a collection corresponding to the specified iterator.
- */
- public static <E> Collection<E> collection(Iterator<? extends E> iterator) {
- return bag(iterator);
- }
-
- /**
- * Return a collection corresponding to the specified array.
- */
- public static <E> Collection<E> collection(E... array) {
- return bag(array);
- }
-
- /**
- * Return whether the specified enumeration contains the
- * specified element.
- * java.util.Enumeration#contains(Object o)
- */
- public static boolean contains(Enumeration<?> enumeration, Object value) {
- if (value == null) {
- while (enumeration.hasMoreElements()) {
- if (enumeration.nextElement() == null) {
- return true;
- }
- }
- } else {
- while (enumeration.hasMoreElements()) {
- if (value.equals(enumeration.nextElement())) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified iterator contains the
- * specified element.
- * java.util.Iterator#contains(Object o)
- */
- public static boolean contains(Iterator<?> iterator, Object value) {
- if (value == null) {
- while (iterator.hasNext()) {
- if (iterator.next() == null) {
- return true;
- }
- }
- } else {
- while (iterator.hasNext()) {
- if (value.equals(iterator.next())) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified array contains the
- * specified element.
- * java.util.Arrays#contains(Object[] array, Object o)
- */
- public static boolean contains(Object[] array, Object value) {
- if (value == null) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == null) {
- return true;
- }
- }
- } else {
- for (int i = array.length; i-- > 0; ) {
- if (value.equals(array[i])) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified array contains the
- * specified element.
- * java.util.Arrays#contains(char[] array, char value)
- */
- public static boolean contains(char[] array, char value) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == value) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified array contains the
- * specified element.
- * java.util.Arrays#contains(int[] array, int value)
- */
- public static boolean contains(int[] array, int value) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == value) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified collection contains all of the
- * elements in the specified iterator.
- * java.util.Collection#containsAll(java.util.Iterator iterator)
- */
- public static boolean containsAll(Collection<?> collection, Iterator<?> iterator) {
- while (iterator.hasNext()) {
- if ( ! collection.contains(iterator.next())) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified collection contains all of the
- * elements in the specified array.
- * java.util.Collection#containsAll(Object[] array)
- */
- public static boolean containsAll(Collection<?> collection, Object[] array) {
- for (int i = array.length; i-- > 0; ) {
- if ( ! collection.contains(array[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified collection.
- * java.util.Iterator#containsAll(java.util.Collection collection)
- */
- public static boolean containsAll(Iterator<?> iterator, Collection<?> collection) {
- return collection(iterator).containsAll(collection);
- }
-
- /**
- * Return whether the specified iterator 1 contains all of the
- * elements in the specified iterator 2.
- * java.util.Iterator#containsAll(java.util.Iterator iterator)
- */
- public static boolean containsAll(Iterator<?> iterator1, Iterator<?> iterator2) {
- return containsAll(collection(iterator1), iterator2);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified array.
- * java.util.Iterator#containsAll(Object[] array)
- */
- public static boolean containsAll(Iterator<?> iterator, Object[] array) {
- return containsAll(collection(iterator), array);
- }
-
- /**
- * Return whether the specified array contains all of the
- * elements in the specified collection.
- * java.util.Arrays#containsAll(Object[] array, java.util.Collection collection)
- */
- public static boolean containsAll(Object[] array, Collection<?> collection) {
- return containsAll(array, collection.iterator());
- }
-
- /**
- * Return whether the specified array contains all of the
- * elements in the specified iterator.
- * java.util.Arrays#containsAll(Object[] array, java.util.Iterator iterator)
- */
- public static boolean containsAll(Object[] array, Iterator<?> iterator) {
- while (iterator.hasNext()) {
- if ( ! contains(array, iterator.next())) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified array 1 contains all of the
- * elements in the specified array 2.
- * java.util.Arrays#containsAll(Object[] array1, Object[] array2)
- */
- public static boolean containsAll(Object[] array1, Object[] array2) {
- for (int i = array2.length; i-- > 0; ) {
- if ( ! contains(array1, array2[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified array 1 contains all of the
- * elements in the specified array 2.
- * java.util.Arrays#containsAll(char[] array1, char[] array2)
- */
- public static boolean containsAll(char[] array1, char[] array2) {
- for (int i = array2.length; i-- > 0; ) {
- if ( ! contains(array1, array2[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified array 1 contains all of the
- * elements in the specified array 2.
- * java.util.Arrays#containsAll(int[] array1, int[] array2)
- */
- public static boolean containsAll(int[] array1, int[] array2) {
- for (int i = array2.length; i-- > 0; ) {
- if ( ! contains(array1, array2[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return the index of the first elements in the specified
- * arrays that are different, beginning at the end.
- * If the arrays are identical, return -1.
- * If the arrays are different sizes, return the index of the
- * last element in the longer array.
- * Use the elements' #equals() method to compare the
- * elements.
- */
- public static int diffEnd(Object[] array1, Object[] array2) {
- return diffEnd(Arrays.asList(array1), Arrays.asList(array2));
- }
-
- /**
- * Return the index of the first elements in the specified
- * lists that are different, beginning at the end.
- * If the lists are identical, return -1.
- * If the lists are different sizes, return the index of the
- * last element in the longer list.
- * Use the elements' #equals() method to compare the
- * elements.
- */
- public static int diffEnd(List<?> list1, List<?> list2) {
- int size1 = list1.size();
- int size2 = list2.size();
- if (size1 != size2) {
- return Math.max(size1, size2) - 1;
- }
- int end = size1 - 1;
- while (end > -1) {
- Object o = list1.get(end);
- if (o == null) {
- if (list2.get(end) == null) {
- end--;
- } else {
- return end;
- }
- } else {
- if (o.equals(list2.get(end))) {
- end--;
- } else {
- return end;
- }
- }
- }
- return end;
- }
-
- /**
- * Return the range of elements in the specified
- * arrays that are different.
- * If the arrays are identical, return [size, -1].
- * Use the elements' #equals() method to compare the
- * elements.
- * @see #diffStart(Object[], Object[])
- * @see #diffEnd(Object[], Object[])
- */
- public static Range diffRange(Object[] array1, Object[] array2) {
- return diffRange(Arrays.asList(array1), Arrays.asList(array2));
- }
-
- /**
- * Return the range of elements in the specified
- * arrays that are different.
- * If the arrays are identical, return [size, -1].
- * Use the elements' #equals() method to compare the
- * elements.
- * @see #diffStart(java.util.List, java.util.List)
- * @see #diffEnd(java.util.List, java.util.List)
- */
- public static Range diffRange(List<?> list1, List<?> list2) {
- int end = diffEnd(list1, list2);
- if (end == -1) {
- // the lists are identical, the start is the size of the two lists
- return new Range(list1.size(), end);
- }
- // the lists are different, calculate the start of the range
- return new Range(diffStart(list1, list2), end);
- }
-
- /**
- * Return the index of the first elements in the specified
- * arrays that are different. If the arrays are identical, return
- * the size of the two arrays (i.e. one past the last index).
- * If the arrays are different sizes and all the elements in
- * the shorter array match their corresponding elements in
- * the longer array, return the size of the shorter array
- * (i.e. one past the last index of the shorter array).
- * Use the elements' #equals() method to compare the
- * elements.
- */
- public static int diffStart(Object[] array1, Object[] array2) {
- return diffStart(Arrays.asList(array1), Arrays.asList(array2));
- }
-
- /**
- * Return the index of the first elements in the specified
- * lists that are different. If the lists are identical, return
- * the size of the two lists (i.e. one past the last index).
- * If the lists are different sizes and all the elements in
- * the shorter list match their corresponding elements in
- * the longer list, return the size of the shorter list
- * (i.e. one past the last index of the shorter list).
- * Use the elements' #equals() method to compare the
- * elements.
- */
- public static int diffStart(List<?> list1, List<?> list2) {
- int end = Math.min(list1.size(), list2.size());
- int start = 0;
- while (start < end) {
- Object o = list1.get(start);
- if (o == null) {
- if (list2.get(start) == null) {
- start++;
- } else {
- return start;
- }
- } else {
- if (o.equals(list2.get(start))) {
- start++;
- } else {
- return start;
- }
- }
- }
- return start;
- }
-
- /**
- * Return whether the specified iterators return equal elements.
- * java.util.ListIterator#equals(java.util.ListIterator iterator)
- */
- public static boolean equals(ListIterator<?> iterator1, ListIterator<?> iterator2) {
- while (iterator1.hasNext() && iterator2.hasNext()) {
- Object o1 = iterator1.next();
- Object o2 = iterator2.next();
- if ( ! (o1 == null ? o2 == null : o1.equals(o2))) {
- return false;
- }
- }
- return ! (iterator1.hasNext() || iterator2.hasNext());
- }
-
- /**
- * Return the element corresponding to the specified index
- * in the specified iterator.
- * java.util.ListIterator#get(int index)
- */
- public static <E> E get(ListIterator<E> iterator, int index) {
- while (iterator.hasNext()) {
- E next = iterator.next();
- if (iterator.previousIndex() == index) {
- return next;
- }
- }
- throw new IndexOutOfBoundsException(String.valueOf(index) + ':' + String.valueOf(iterator.previousIndex()));
- }
-
- /**
- * Return whether the specified arrays contain the same elements.
- * java.util.Arrays#identical(Object[] array1, Object[] array2)
- */
- public static boolean identical(Object[] array1, Object[] array2) {
- if (array1 == array2) {
- return true;
- }
- if (array1 == null || array2 == null) {
- return false;
- }
- int length = array1.length;
- if (array2.length != length) {
- return false;
- }
- for (int i = length; i-- > 0; ) {
- if (array1[i] != array2[i]) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified iterators return the same elements.
- * java.util.ListIterator#identical(java.util.ListIterator iterator)
- */
- public static boolean identical(ListIterator<?> iterator1, ListIterator<?> iterator2) {
- while (iterator1.hasNext() && iterator2.hasNext()) {
- if (iterator1.next() != iterator2.next()) {
- return false;
- }
- }
- return ! (iterator1.hasNext() || iterator2.hasNext());
- }
-
- /**
- * Return the index of the first elements in the specified
- * arrays that are different, beginning at the end.
- * If the arrays are identical, return -1.
- * If the arrays are different sizes, return the index of the
- * last element in the longer array.
- * Use object identity to compare the elements.
- */
- public static int identityDiffEnd(Object[] array1, Object[] array2) {
- return identityDiffEnd(Arrays.asList(array1), Arrays.asList(array2));
- }
-
- /**
- * Return the index of the first elements in the specified
- * lists that are different, beginning at the end.
- * If the lists are identical, return -1.
- * If the lists are different sizes, return the index of the
- * last element in the longer list.
- * Use object identity to compare the elements.
- */
- public static int identityDiffEnd(List<?> list1, List<?> list2) {
- int size1 = list1.size();
- int size2 = list2.size();
- if (size1 != size2) {
- return Math.max(size1, size2) - 1;
- }
- int end = size1 - 1;
- while (end > -1) {
- if (list1.get(end) == list2.get(end)) {
- end--;
- } else {
- return end;
- }
- }
- return end;
- }
-
- /**
- * Return the range of elements in the specified
- * arrays that are different.
- * If the arrays are identical, return [size, -1].
- * Use object identity to compare the elements.
- * @see #identityDiffStart(Object[], Object[])
- * @see #identityDiffEnd(Object[], Object[])
- */
- public static Range identityDiffRange(Object[] array1, Object[] array2) {
- return identityDiffRange(Arrays.asList(array1), Arrays.asList(array2));
- }
-
- /**
- * Return the range of elements in the specified
- * arrays that are different.
- * If the arrays are identical, return [size, -1].
- * Use object identity to compare the elements.
- * @see #identityDiffStart(java.util.List, java.util.List)
- * @see #identityDiffEnd(java.util.List, java.util.List)
- */
- public static Range identityDiffRange(List<?> list1, List<?> list2) {
- int end = identityDiffEnd(list1, list2);
- if (end == -1) {
- // the lists are identical, the start is the size of the two lists
- return new Range(list1.size(), end);
- }
- // the lists are different, calculate the start of the range
- return new Range(identityDiffStart(list1, list2), end);
- }
-
- /**
- * Return the index of the first elements in the specified
- * arrays that are different. If the arrays are identical, return
- * the size of the two arrays (i.e. one past the last index).
- * If the arrays are different sizes and all the elements in
- * the shorter array match their corresponding elements in
- * the longer array, return the size of the shorter array
- * (i.e. one past the last index of the shorter array).
- * Use object identity to compare the elements.
- */
- public static int identityDiffStart(Object[] array1, Object[] array2) {
- return identityDiffStart(Arrays.asList(array1), Arrays.asList(array2));
- }
-
- /**
- * Return the index of the first elements in the specified
- * lists that are different. If the lists are identical, return
- * the size of the two lists (i.e. one past the last index).
- * If the lists are different sizes and all the elements in
- * the shorter list match their corresponding elements in
- * the longer list, return the size of the shorter list
- * (i.e. one past the last index of the shorter list).
- * Use object identity to compare the elements.
- */
- public static int identityDiffStart(List<?> list1, List<?> list2) {
- int end = Math.min(list1.size(), list2.size());
- int start = 0;
- while (start < end) {
- if (list1.get(start) == list2.get(start)) {
- start++;
- } else {
- return start;
- }
- }
- return start;
- }
-
- /**
- * Return the index of the first occurrence of the
- * specified element in the specified iterator,
- * or return -1 if there is no such index.
- * java.util.ListIterator#indexOf(Object o)
- */
- public static int indexOf(ListIterator<?> iterator, Object value) {
- if (value == null) {
- for (int i = 0; iterator.hasNext(); i++) {
- if (iterator.next() == null) {
- return i;
- }
- }
- } else {
- for (int i = 0; iterator.hasNext(); i++) {
- if (value.equals(iterator.next())) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /**
- * Return the index of the first occurrence of the
- * specified element in the specified array,
- * or return -1 if there is no such index.
- * java.util.Arrays#indexOf(Object[] array, Object o)
- */
- public static int indexOf(Object[] array, Object value) {
- int len = array.length;
- if (value == null) {
- for (int i = 0; i < len; i++) {
- if (array[i] == null) {
- return i;
- }
- }
- } else {
- for (int i = 0; i < len; i++) {
- if (value.equals(array[i])) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /**
- * Return the index of the first occurrence of the
- * specified element in the specified array,
- * or return -1 if there is no such index.
- * java.util.Arrays#indexOf(char[] array, char value)
- */
- public static int indexOf(char[] array, char value) {
- int len = array.length;
- for (int i = 0; i < len; i++) {
- if (array[i] == value) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Return the index of the first occurrence of the
- * specified element in the specified array,
- * or return -1 if there is no such index.
- * java.util.Arrays#indexOf(int[] array, int value)
- */
- public static int indexOf(int[] array, int value) {
- int len = array.length;
- for (int i = 0; i < len; i++) {
- if (array[i] == value) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Return the maximum index of where the specified comparable object
- * should be inserted into the specified sorted list and still keep
- * the list sorted.
- */
- public static <E extends Comparable<? super E>> int insertionIndexOf(List<E> sortedList, Comparable<E> value) {
- int len = sortedList.size();
- for (int i = 0; i < len; i++) {
- if (value.compareTo(sortedList.get(i)) < 0) {
- return i;
- }
- }
- return len;
- }
-
- /**
- * Return the maximum index of where the specified object
- * should be inserted into the specified sorted list and still keep
- * the list sorted.
- */
- public static <E> int insertionIndexOf(List<E> sortedList, E value, Comparator<? super E> comparator) {
- int len = sortedList.size();
- for (int i = 0; i < len; i++) {
- if (comparator.compare(value, sortedList.get(i)) < 0) {
- return i;
- }
- }
- return len;
- }
-
- /**
- * Return the maximum index of where the specified comparable object
- * should be inserted into the specified sorted array and still keep
- * the array sorted.
- */
- public static <E extends Comparable<? super E>> int insertionIndexOf(E[] sortedArray, Comparable<E> value) {
- int len = sortedArray.length;
- for (int i = 0; i < len; i++) {
- if (value.compareTo(sortedArray[i]) < 0) {
- return i;
- }
- }
- return len;
- }
-
- /**
- * Return the maximum index of where the specified comparable object
- * should be inserted into the specified sorted array and still keep
- * the array sorted.
- */
- public static <E> int insertionIndexOf(E[] sortedArray, E value, Comparator<? super E> comparator) {
- int len = sortedArray.length;
- for (int i = 0; i < len; i++) {
- if (comparator.compare(value, sortedArray[i]) < 0) {
- return i;
- }
- }
- return len;
- }
-
- /**
- * Return an iterator on the elements in the specified array.
- * java.util.Arrays#iterator(Object[] array)
- */
- public static <E> Iterator<E> iterator(E... array) {
- return new ArrayIterator<E>(array);
- }
-
- /**
- * Return the index of the last occurrence of the
- * specified element in the specified iterator,
- * or return -1 if there is no such index.
- * java.util.ListIterator#lastIndexOf(Object o)
- */
- public static int lastIndexOf(ListIterator<?> iterator, Object value) {
- return list(iterator).lastIndexOf(value);
- }
-
- /**
- * Return the index of the last occurrence of the
- * specified element in the specified array,
- * or return -1 if there is no such index.
- * java.util.Arrays#lastIndexOf(Object[] array, Object o)
- */
- public static int lastIndexOf(Object[] array, Object value) {
- int len = array.length;
- if (value == null) {
- for (int i = len; i-- > 0; ) {
- if (array[i] == null) {
- return i;
- }
- }
- } else {
- for (int i = len; i-- > 0; ) {
- if (value.equals(array[i])) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /**
- * Return the index of the last occurrence of the
- * specified element in the specified array,
- * or return -1 if there is no such index.
- * java.util.Arrays#lastIndexOf(char[] array, char value)
- */
- public static int lastIndexOf(char[] array, char value) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == value) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Return the index of the last occurrence of the
- * specified element in the specified array,
- * or return -1 if there is no such index.
- * java.util.Arrays#lastIndexOf(int[] array, int value)
- */
- public static int lastIndexOf(int[] array, int value) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == value) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Return a list corresponding to the specified iterator.
- * java.util.Iterator#toList()
- */
- public static <E> List<E> list(Iterator<? extends E> iterator) {
- List<E> list = new ArrayList<E>();
- while (iterator.hasNext()) {
- list.add(iterator.next());
- }
- return list;
- }
-
- /**
- * Return a list corresponding to the specified array.
- * Unlike java.util.Arrays.asList(Object[]), the list
- * is modifiable and is not backed by the array.
- */
- public static <E> List<E> list(E... array) {
- List<E> list = new ArrayList<E>(array.length);
- for (E item : array) {
- list.add(item);
- }
- return list;
- }
-
- /**
- * Return a list iterator for the specified array.
- * java.util.Arrays#listIterator(Object[] array)
- */
- public static <E> ListIterator<E> listIterator(E... array) {
- return listIterator(array, 0);
- }
-
- /**
- * Return a list iterator for the specified array
- * starting at the specified position in the array.
- * java.util.Arrays#listIterator(Object[] array, int index)
- */
- public static <E> ListIterator<E> listIterator(E[] array, int index) {
- return Arrays.asList(array).listIterator(index);
- }
-
- /**
- * Return the character from the specified array with the maximum value.
- * java.util.Arrays#max(char[] array)
- */
- public static char max(char... array) {
- int len = array.length;
- if (len == 0) {
- throw new IndexOutOfBoundsException();
- }
- char max = array[0];
- // start at 1
- for (int i = 1; i < len; i++) {
- char next = array[i];
- if (next > max) {
- max = next;
- }
- }
- return max;
- }
-
- /**
- * Return the integer from the specified array with the maximum value.
- * java.util.Arrays#max(int[] array)
- */
- public static int max(int... array) {
- int len = array.length;
- if (len == 0) {
- throw new IndexOutOfBoundsException();
- }
- int max = array[0];
- // start at 1
- for (int i = 1; i < len; i++) {
- int next = array[i];
- if (next > max) {
- max = next;
- }
- }
- return max;
- }
-
- /**
- * Return the character from the specified array with the minimum value.
- * java.util.Arrays#min(char[] array)
- */
- public static char min(char... array) {
- int len = array.length;
- if (len == 0) {
- throw new IndexOutOfBoundsException();
- }
- char min = array[0];
- // start at 1
- for (int i = 1; i < len; i++) {
- char next = array[i];
- if (next < min) {
- min = next;
- }
- }
- return min;
- }
-
- /**
- * Return the integer from the specified array with the minimum value.
- * java.util.Arrays#min(int[] array)
- */
- public static int min(int... array) {
- int len = array.length;
- if (len == 0) {
- throw new IndexOutOfBoundsException();
- }
- int min = array[0];
- // start at 1
- for (int i = 1; i < len; i++) {
- int next = array[i];
- if (next < min) {
- min = next;
- }
- }
- return min;
- }
-
- /**
- * Replace all occurrences of the specified old value with
- * the specified new value.
- * java.util.Arrays#replaceAll(Object[] array, Object oldValue, Object newValue)
- */
- public static <E> E[] replaceAll(E[] array, Object oldValue, E newValue) {
- if (oldValue == null) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == null) {
- array[i] = newValue;
- }
- }
- } else {
- for (int i = array.length; i-- > 0; ) {
- if (oldValue.equals(array[i])) {
- array[i] = newValue;
- }
- }
- }
- return array;
- }
-
- /**
- * Replace all occurrences of the specified old value with
- * the specified new value.
- * java.util.Arrays#replaceAll(int[] array, int oldValue, int newValue)
- */
- public static int[] replaceAll(int[] array, int oldValue, int newValue) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == oldValue) {
- array[i] = newValue;
- }
- }
- return array;
- }
-
- /**
- * Replace all occurrences of the specified old value with
- * the specified new value.
- * java.util.Arrays#replaceAll(char[] array, char oldValue, char newValue)
- */
- public static char[] replaceAll(char[] array, char oldValue, char newValue) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == oldValue) {
- array[i] = newValue;
- }
- }
- return array;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * java.util.Arrays#remove(Object[] array, Object value)
- */
- public static <E> E[] remove(E[] array, Object value) {
- return removeElementAtIndex(array, indexOf(array, value));
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * java.util.Arrays#remove(char[] array, char value)
- */
- public static char[] remove(char[] array, char value) {
- return removeElementAtIndex(array, indexOf(array, value));
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * java.util.Arrays#remove(int[] array, int value)
- */
- public static int[] remove(int[] array, int value) {
- return removeElementAtIndex(array, indexOf(array, value));
- }
-
- /**
- * Remove all the elements returned by the specified iterator
- * from the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#removeAll(java.util.Iterator iterator)
- */
- public static boolean removeAll(Collection<?> collection, Iterator<?> iterator) {
- boolean modified = false;
- while (iterator.hasNext()) {
- modified |= removeAllOccurrences(collection, iterator.next());
- }
- return modified;
- }
-
- /**
- * Remove all the elements in the specified array
- * from the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#removeAll(Object[] array)
- */
- public static boolean removeAll(Collection<?> collection, Object[] array) {
- boolean modified = false;
- for (int i = array.length; i-- > 0; ) {
- modified |= removeAllOccurrences(collection, array[i]);
- }
- return modified;
- }
-
- /**
- * Remove from the specified array all the elements in
- * the specified collection and return the result.
- * java.util.Arrays#removeAll(Object[] array, Collection collection)
- */
- public static <E> E[] removeAll(E[] array, Collection<?> collection) {
- E[] result = array;
- // go backwards since we will be pulling elements
- // out of 'result' and it will get shorter as we go
- for (int i = array.length; i-- > 0; ) {
- E item = array[i];
- if (collection.contains(item)) {
- result = removeElementAtIndex(result, i);
- }
- }
- return result;
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * java.util.Arrays#removeAll(Object[] array1, Object[] array2)
- */
- public static <E> E[] removeAll(E[] array1, Object[] array2) {
- // convert to a bag to take advantage of hashed look-up
- return removeAll(array1, bag(array2));
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * java.util.Arrays#removeAll(char[] array1, char[] array2)
- */
- public static char[] removeAll(char[] array1, char[] array2) {
- char[] result1 = array1;
- // go backwards since we will be pulling elements
- // out of 'result1' and it will get shorter as we go
- for (int i = array1.length; i-- > 0; ) {
- char item = array1[i];
- if (contains(array2, item)) {
- result1 = removeElementAtIndex(result1, i);
- }
- }
- return result1;
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * java.util.Arrays#removeAll(int[] array1, int[] array2)
- */
- public static int[] removeAll(int[] array1, int[] array2) {
- int[] result1 = array1;
- // go backwards since we will be pulling elements
- // out of 'result1' and it will get shorter as we go
- for (int i = array1.length; i-- > 0; ) {
- int item = array1[i];
- if (contains(array2, item)) {
- result1 = removeElementAtIndex(result1, i);
- }
- }
- return result1;
- }
-
- /**
- * Remove all occurrences of the specified element
- * from the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#removeAllOccurrences(Object value)
- */
- public static boolean removeAllOccurrences(Collection<?> collection, Object value) {
- boolean modified = false;
- Iterator<?> stream = collection.iterator();
- if (value == null) {
- while (stream.hasNext()) {
- if (stream.next() == null) {
- stream.remove();
- modified = true;
- }
- }
- } else {
- while (stream.hasNext()) {
- if (value.equals(stream.next())) {
- stream.remove();
- modified = true;
- }
- }
- }
- return modified;
- }
-
- /**
- * Remove from the specified array all occurrences of
- * the specified element and return the result.
- * java.util.Arrays#removeAllOccurrences(Object[] array, Object value)
- */
- public static <E> E[] removeAllOccurrences(E[] array, Object value) {
- E[] result = array;
- if (value == null) {
- // go backwards since we will be pulling elements
- // out of 'result' and it will get shorter as we go
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == null) {
- result = removeElementAtIndex(result, i);
- }
- }
- } else {
- // go backwards since we will be pulling elements
- // out of 'result' and it will get shorter as we go
- for (int i = array.length; i-- > 0; ) {
- if (value.equals(array[i])) {
- result = removeElementAtIndex(result, i);
- }
- }
- }
- return result;
- }
-
- /**
- * Remove from the specified array all occurrences of
- * the specified element and return the result.
- * java.util.Arrays#removeAllOccurrences(char[] array, char value)
- */
- public static char[] removeAllOccurrences(char[] array, char value) {
- char[] result = array;
- // go backwards since we will be pulling elements
- // out of 'result' and it will get shorter as we go
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == value) {
- result = removeElementAtIndex(result, i);
- }
- }
- return result;
- }
-
- /**
- * Remove from the specified array all occurrences of
- * the specified element and return the result.
- * java.util.Arrays#removeAllOccurrences(int[] array, int value)
- */
- public static int[] removeAllOccurrences(int[] array, int value) {
- int[] result = array;
- // go backwards since we will be pulling elements
- // out of 'result' and it will get shorter as we go
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == value) {
- result = removeElementAtIndex(result, i);
- }
- }
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * java.util.Arrays#removeElementAtIndex(Object[] array, int index)
- */
- @SuppressWarnings("unchecked")
- public static <E> E[] removeElementAtIndex(E[] array, int index) {
- int len = array.length;
- E[] result = (E[]) Array.newInstance(array.getClass().getComponentType(), len - 1);
- System.arraycopy(array, 0, result, 0, index);
- System.arraycopy(array, index + 1, result, index, len - index - 1);
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * java.util.Arrays#removeElementAtIndex(char[] array, int index)
- */
- public static char[] removeElementAtIndex(char[] array, int index) {
- int len = array.length;
- char[] result = new char[len - 1];
- System.arraycopy(array, 0, result, 0, index);
- System.arraycopy(array, index + 1, result, index, len - index - 1);
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * java.util.Arrays#removeElementAtIndex(int[] array, int index)
- */
- public static int[] removeElementAtIndex(int[] array, int index) {
- int len = array.length;
- int[] result = new int[len - 1];
- System.arraycopy(array, 0, result, 0, index);
- System.arraycopy(array, index + 1, result, index, len - index - 1);
- return result;
- }
-
- /**
- * Remove any duplicate elements from the specified array,
- * while maintaining the order.
- */
- @SuppressWarnings("unchecked")
- public static <E> E[] removeDuplicateElements(E... array) {
- List<E> list = removeDuplicateElements(Arrays.asList(array));
- return list.toArray((E[]) Array.newInstance(array.getClass().getComponentType(), list.size()));
- }
-
- /**
- * Remove any duplicate elements from the specified list,
- * while maintaining the order.
- */
- public static <E> List<E> removeDuplicateElements(List<E> list) {
- List<E> result = new ArrayList<E>(list.size());
- Set<E> set = new HashSet<E>(list.size()); // take advantage of hashed look-up
- for (E item : list) {
- if (set.add(item)) {
- result.add(item);
- }
- }
- return result;
- }
-
- /**
- * Retain only the elements in the specified iterator
- * in the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#retainAll(java.util.Iterator iterator)
- */
- public static boolean retainAll(Collection<?> collection, Iterator<?> iterator) {
- return collection.retainAll(collection(iterator));
- }
-
- /**
- * Retain only the elements in the specified array
- * in the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#retainAll(Object[] array)
- */
- public static boolean retainAll(Collection<?> collection, Object[] array) {
- return collection.retainAll(set(array));
- }
-
- /**
- * Retain in the specified array all the elements in
- * the specified collection and return the result.
- * java.util.Arrays#retainAll(Object[] array, Collection collection)
- */
- public static <E> E[] retainAll(E[] array, Collection<?> collection) {
- E[] result = array;
- // go backwards since we will be pulling elements
- // out of 'result' and it will get shorter as we go
- for (int i = array.length; i-- > 0; ) {
- if ( ! collection.contains(array[i])) {
- result = removeElementAtIndex(result, i);
- }
- }
- return result;
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * java.util.Arrays#retainAll(Object[] array1, Object[] array2)
- */
- public static <E> E[] retainAll(E[] array1, Object[] array2) {
- // convert to a bag to take advantage of hashed look-up
- return retainAll(array1, bag(array2));
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * java.util.Arrays#retainAll(char[] array1, char[] array2)
- */
- public static char[] retainAll(char[] array1, char[] array2) {
- char[] result1 = array1;
- // go backwards since we will be pulling elements
- // out of 'result1' and it will get shorter as we go
- for (int i = array1.length; i-- > 0; ) {
- char item = array1[i];
- if ( ! contains(array2, item)) {
- result1 = removeElementAtIndex(result1, i);
- }
- }
- return result1;
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * java.util.Arrays#removeAll(int[] array1, int[] array2)
- */
- public static int[] retainAll(int[] array1, int[] array2) {
- int[] result1 = array1;
- // go backwards since we will be pulling elements
- // out of 'result1' and it will get shorter as we go
- for (int i = array1.length; i-- > 0; ) {
- int item = array1[i];
- if ( ! contains(array2, item)) {
- result1 = removeElementAtIndex(result1, i);
- }
- }
- return result1;
- }
-
- /**
- * Return the array reversed.
- * java.util.Arrays.reverse(Object[] array)
- */
- public static <E> E[] reverse(E... array) {
- int len = array.length;
- for (int i = 0, mid = len >> 1, j = len - 1; i < mid; i++, j--) {
- swap(array, i, j);
- }
- return array;
- }
-
- /**
- * Return the array reversed.
- * java.util.Arrays.reverse(char[] array)
- */
- public static char[] reverse(char... array) {
- int len = array.length;
- for (int i = 0, mid = len >> 1, j = len - 1; i < mid; i++, j--) {
- swap(array, i, j);
- }
- return array;
- }
-
- /**
- * Return the array reversed.
- * java.util.Arrays.reverse(int[] array)
- */
- public static int[] reverse(int... array) {
- int len = array.length;
- for (int i = 0, mid = len >> 1, j = len - 1; i < mid; i++, j--) {
- swap(array, i, j);
- }
- return array;
- }
-
- /**
- * Return a list with entries in reverse order from those
- * returned by the specified iterator.
- */
- public static <E> List<E> reverseList(Iterator<? extends E> iterator) {
- return reverse(list(iterator));
- }
-
- /**
- * Return the rotated array after rotating it one position.
- * java.util.Arrays.rotate(Object[] array)
- */
- public static <E> E[] rotate(E... array) {
- return rotate(array, 1);
- }
-
- /**
- * Return the rotated array after rotating it the specified distance.
- * java.util.Arrays.rotate(Object[] array, int distance)
- */
- public static <E> E[] rotate(E[] array, int distance) {
- int len = array.length;
- if (len == 0) {
- return array;
- }
- distance = distance % len;
- if (distance < 0) {
- distance += len;
- }
- if (distance == 0) {
- return array;
- }
- for (int cycleStart = 0, nMoved = 0; nMoved != len; cycleStart++) {
- E displaced = array[cycleStart];
- int i = cycleStart;
- do {
- i += distance;
- if (i >= len) {
- i -= len;
- }
- E temp = array[i];
- array[i] = displaced;
- displaced = temp;
- nMoved ++;
- } while (i != cycleStart);
- }
- return array;
- }
-
- /**
- * Return the rotated array after rotating it one position.
- * java.util.Arrays.rotate(char[] array)
- */
- public static char[] rotate(char... array) {
- return rotate(array, 1);
- }
-
- /**
- * Return the rotated array after rotating it the specified distance.
- * java.util.Arrays.rotate(char[] array, int distance)
- */
- public static char[] rotate(char[] array, int distance) {
- int len = array.length;
- if (len == 0) {
- return array;
- }
- distance = distance % len;
- if (distance < 0) {
- distance += len;
- }
- if (distance == 0) {
- return array;
- }
- for (int cycleStart = 0, nMoved = 0; nMoved != len; cycleStart++) {
- char displaced = array[cycleStart];
- int i = cycleStart;
- do {
- i += distance;
- if (i >= len) {
- i -= len;
- }
- char temp = array[i];
- array[i] = displaced;
- displaced = temp;
- nMoved ++;
- } while (i != cycleStart);
- }
- return array;
- }
-
- /**
- * Return the rotated array after rotating it one position.
- * java.util.Arrays.rotate(int[] array)
- */
- public static int[] rotate(int... array) {
- return rotate(array, 1);
- }
-
- /**
- * Return the rotated array after rotating it the specified distance.
- * java.util.Arrays.rotate(int[] array, int distance)
- */
- public static int[] rotate(int[] array, int distance) {
- int len = array.length;
- if (len == 0) {
- return array;
- }
- distance = distance % len;
- if (distance < 0) {
- distance += len;
- }
- if (distance == 0) {
- return array;
- }
- for (int cycleStart = 0, nMoved = 0; nMoved != len; cycleStart++) {
- int displaced = array[cycleStart];
- int i = cycleStart;
- do {
- i += distance;
- if (i >= len) {
- i -= len;
- }
- int temp = array[i];
- array[i] = displaced;
- displaced = temp;
- nMoved ++;
- } while (i != cycleStart);
- }
- return array;
- }
-
- /**
- * Return a set corresponding to the specified iterator.
- * java.util.HashSet(java.util.Iterator iterator)
- */
- public static <E> Set<E> set(Iterator<? extends E> iterator) {
- Set<E> set = new HashSet<E>();
- while (iterator.hasNext()) {
- set.add(iterator.next());
- }
- return set;
- }
-
- /**
- * Return a set corresponding to the specified array.
- * java.util.HashSet(Object[] array)
- */
- public static <E> Set<E> set(E... array) {
- Set<E> set = new HashSet<E>(2 * array.length);
- for (E item : array) {
- set.add(item);
- }
- return set;
- }
-
- private static final Random RANDOM = new Random();
-
- /**
- * Return the array after "shuffling" it.
- * java.util.Arrays#shuffle(Object[] array)
- */
- public static <E> E[] shuffle(E... array) {
- return shuffle(array, RANDOM);
- }
-
- /**
- * Return the array after "shuffling" it.
- * java.util.Arrays#shuffle(Object[] array, Random r)
- */
- public static <E> E[] shuffle(E[] array, Random random) {
- int len = array.length;
- for (int i = len; i-- > 0; ) {
- swap(array, i, random.nextInt(len));
- }
- return array;
- }
-
- /**
- * Return the array after "shuffling" it.
- * java.util.Arrays#shuffle(char[] array)
- */
- public static char[] shuffle(char... array) {
- return shuffle(array, RANDOM);
- }
-
- /**
- * Return the array after "shuffling" it.
- * java.util.Arrays#shuffle(char[] array, Random r)
- */
- public static char[] shuffle(char[] array, Random random) {
- int len = array.length;
- for (int i = len; i-- > 0; ) {
- swap(array, i, random.nextInt(len));
- }
- return array;
- }
-
- /**
- * Return the array after "shuffling" it.
- * java.util.Arrays#shuffle(int[] array)
- */
- public static int[] shuffle(int... array) {
- return shuffle(array, RANDOM);
- }
-
- /**
- * Return the array after "shuffling" it.
- * java.util.Arrays#shuffle(int[] array, Random r)
- */
- public static int[] shuffle(int[] array, Random random) {
- int len = array.length;
- for (int i = len; i-- > 0; ) {
- swap(array, i, random.nextInt(len));
- }
- return array;
- }
-
- /**
- * Return an iterator that returns only the single,
- * specified object.
- * Object#toIterator() ?!
- */
- public static <E> Iterator<E> singletonIterator(E value) {
- return new SingleElementIterator<E>(value);
- }
-
- /**
- * Return the number of elements returned by the specified iterator.
- * java.util.Iterator#size()
- */
- public static int size(Iterator<?> iterator) {
- int size = 0;
- while (iterator.hasNext()) {
- iterator.next();
- size++;
- }
- return size;
- }
-
- /**
- * Return a sorted set corresponding to the specified iterator.
- * java.util.TreeSet(java.util.Iterator iterator)
- */
- public static <E extends Comparable<? super E>> SortedSet<E> sortedSet(Iterator<? extends E> iterator) {
- return sortedSet(iterator, null);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterator
- * and comparator.
- * java.util.TreeSet(java.util.Iterator iterator, java.util.Comparator c)
- */
- public static <E> SortedSet<E> sortedSet(Iterator<? extends E> iterator, Comparator<? super E> comparator) {
- SortedSet<E> sortedSet = new TreeSet<E>(comparator);
- sortedSet.addAll(list(iterator));
- return sortedSet;
- }
-
- /**
- * Return a sorted set corresponding to the specified array.
- * java.util.TreeSet(Object[] array)
- */
- public static <E extends Comparable<? super E>> SortedSet<E> sortedSet(E... array) {
- return sortedSet(array, null);
- }
-
- /**
- * Return a sorted set corresponding to the specified array
- * and comparator.
- * java.util.TreeSet(Object[] array, java.util.Comparator c)
- */
- public static <E> SortedSet<E> sortedSet(E[] array, Comparator<? super E> comparator) {
- SortedSet<E> sortedSet = new TreeSet<E>(comparator);
- sortedSet.addAll(Arrays.asList(array));
- return sortedSet;
- }
-
- /**
- * Return the array after the specified elements have been "swapped".
- * java.util.Arrays#swap(Object[] array, int i, int j)
- */
- public static <E> E[] swap(E[] array, int i, int j) {
- E temp = array[i];
- array[i] = array[j];
- array[j] = temp;
- return array;
- }
-
- /**
- * Return the array after the specified elements have been "swapped".
- * java.util.Arrays#swap(char[] array, int i, int j)
- */
- public static char[] swap(char[] array, int i, int j) {
- char temp = array[i];
- array[i] = array[j];
- array[j] = temp;
- return array;
- }
-
- /**
- * Return the array after the specified elements have been "swapped".
- * java.util.Arrays#swap(int[] array, int i, int j)
- */
- public static int[] swap(int[] array, int i, int j) {
- int temp = array[i];
- array[i] = array[j];
- array[j] = temp;
- return array;
- }
-
- /**
- * Return a vector corresponding to the specified iterator.
- * This is useful for legacy code that requires a java.util.Vector.
- * java.util.Vector(java.util.Iterator iterator)
- */
- public static <E> Vector<E> vector(Iterator<? extends E> iterator) {
- Vector<E> v = new Vector<E>();
- while (iterator.hasNext()) {
- v.addElement(iterator.next());
- }
- return v;
- }
-
- /**
- * Return a vector corresponding to the specified array.
- * This is useful for legacy code that requires a java.util.Vector.
- * java.util.Vector(Object[] array)
- */
- public static <E> Vector<E> vector(E... array) {
- int len = array.length;
- Vector<E> v = new Vector<E>(len);
- for (E item : array) {
- v.addElement(item);
- }
- return v;
- }
-
-
- //********** java.util.Collections enhancements **********
-
- /**
- * Return the destination list after the source list has been copied into it.
- * @see java.util.Collections#copy(java.util.List, java.util.List)
- */
- public static <E> List<? super E> copy(List<? super E> dest, List<? extends E> src) {
- Collections.copy(dest, src);
- return dest;
- }
-
- /**
- * Return the list after it has been "filled".
- * @see java.util.Collections#fill(java.util.List, java.lang.Object)
- */
- public static <E> List<? super E> fill(List<? super E> list, E value) {
- Collections.fill(list, value);
- return list;
- }
-
- /**
- * Return the list after it has been "reversed".
- * @see java.util.Collections#reverse(java.util.List)
- */
- public static <E> List<E> reverse(List<E> list) {
- Collections.reverse(list);
- return list;
- }
-
- /**
- * Return the list after it has been "rotated" by one position.
- * @see java.util.Collections#rotate(java.util.List, int)
- */
- public static <E> List<E> rotate(List<E> list) {
- return rotate(list, 1);
- }
-
- /**
- * Return the list after it has been "rotated".
- * @see java.util.Collections#rotate(java.util.List, int)
- */
- public static <E> List<E> rotate(List<E> list, int distance) {
- Collections.rotate(list, distance);
- return list;
- }
-
- /**
- * Return the list after it has been "shuffled".
- * @see java.util.Collections#shuffle(java.util.List)
- */
- public static <E> List<E> shuffle(List<E> list) {
- Collections.shuffle(list);
- return list;
- }
-
- /**
- * Return the list after it has been "shuffled".
- * @see java.util.Collections#shuffle(java.util.List, java.util.Random)
- */
- public static <E> List<E> shuffle(List<E> list, Random random) {
- Collections.shuffle(list, random);
- return list;
- }
-
- /**
- * Return the list after it has been "sorted".
- * @see java.util.Collections#sort(java.util.List)
- */
- public static <E extends Comparable<? super E>> List<E> sort(List<E> list) {
- Collections.sort(list);
- return list;
- }
-
- /**
- * Return the list after it has been "sorted".
- * @see java.util.Collections#sort(java.util.List, java.util.Comparator)
- */
- public static <E> List<E> sort(List<E> list, Comparator<? super E> comparator) {
- Collections.sort(list, comparator);
- return list;
- }
-
- /**
- * Return the iterator after it has been "sorted".
- */
- public static <E extends Comparable<? super E>> Iterator<E> sort(Iterator<E> iterator) {
- return sort(iterator, null);
- }
-
- /**
- * Return the list after it has been "sorted".
- */
- public static <E> Iterator<E> sort(Iterator<E> iterator, Comparator<? super E> comparator) {
- return sort(list(iterator), comparator).iterator();
- }
-
- /**
- * Return the list after the specified elements have been "swapped".
- * @see java.util.Collections#swap(java.util.List, int, int)
- */
- public static <E> List<E> swap(List<E> list, int i, int j) {
- Collections.swap(list, i, j);
- return list;
- }
-
-
- //********** java.util.Arrays enhancements **********
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(boolean[], boolean)
- */
- public static boolean[] fill(boolean[] array, boolean value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(boolean[], int, int, boolean)
- */
- public static boolean[] fill(boolean[] array, int fromIndex, int toIndex, boolean value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(byte[], byte)
- */
- public static byte[] fill(byte[] array, byte value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(byte[], int, int, byte)
- */
- public static byte[] fill(byte[] array, int fromIndex, int toIndex, byte value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(char[], char)
- */
- public static char[] fill(char[] array, char value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(char[], int, int, char)
- */
- public static char[] fill(char[] array, int fromIndex, int toIndex, char value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(double[], double)
- */
- public static double[] fill(double[] array, double value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(double[], int, int, double)
- */
- public static double[] fill(double[] array, int fromIndex, int toIndex, double value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(float[], float)
- */
- public static float[] fill(float[] array, float value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(float[], int, int, float)
- */
- public static float[] fill(float[] array, int fromIndex, int toIndex, float value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(int[], int)
- */
- public static int[] fill(int[] array, int value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(int[], int, int, int)
- */
- public static int[] fill(int[] array, int fromIndex, int toIndex, int value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(Object[], Object)
- */
- public static <E> E[] fill(E[] array, E value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(Object[], int, int, Object)
- */
- public static <E> E[] fill(E[] array, int fromIndex, int toIndex, E value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(long[], long)
- */
- public static long[] fill(long[] array, long value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(long[], int, int, long)
- */
- public static long[] fill(long[] array, int fromIndex, int toIndex, long value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(short[], short)
- */
- public static short[] fill(short[] array, short value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see java.util.Arrays#fill(short[], int, int, short)
- */
- public static short[] fill(short[] array, int fromIndex, int toIndex, short value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(byte[])
- */
- public static byte[] sort(byte... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(byte[], int, int)
- */
- public static byte[] sort(byte[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(char[])
- */
- public static char[] sort(char... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(char[], int, int)
- */
- public static char[] sort(char[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(double[])
- */
- public static double[] sort(double... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(double[], int, int)
- */
- public static double[] sort(double[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(float[])
- */
- public static float[] sort(float... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(float[], int, int)
- */
- public static float[] sort(float[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(int[])
- */
- public static int[] sort(int... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(int[], int, int)
- */
- public static int[] sort(int[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(Object[])
- */
- public static <E> E[] sort(E... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(Object[], java.util.Comparator)
- */
- public static <E> E[] sort(E[] array, Comparator<? super E> comparator) {
- Arrays.sort(array, comparator);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(Object[], int, int)
- */
- public static <E> E[] sort(E[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(Object[], int, int, java.util.Comparator)
- */
- public static <E> E[] sort(E[] array, int fromIndex, int toIndex, Comparator<? super E> comparator) {
- Arrays.sort(array, fromIndex, toIndex, comparator);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(long[])
- */
- public static long[] sort(long... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(long[], int, int)
- */
- public static long[] sort(long[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(short[])
- */
- public static short[] sort(short... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see java.util.Arrays#sort(short[], int, int)
- */
- public static short[] sort(short[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
-
- //********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private CollectionTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java
deleted file mode 100644
index 39c3efed1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java
+++ /dev/null
@@ -1,1006 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.nio.channels.FileChannel;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Assorted file tools:
- * - delete entire trees of directories and files
- * - build iterators on entire trees of directories and files
- * - build a temporary directory
- * - "canonize" files
- */
-public final class FileTools {
-
- public static final String USER_HOME_DIRECTORY_NAME = System.getProperty("user.home");
- public static final String USER_TEMPORARY_DIRECTORY_NAME = System.getProperty("java.io.tmpdir");
- public static String DEFAULT_TEMPORARY_DIRECTORY_NAME = "tmpdir";
- public static final String CURRENT_WORKING_DIRECTORY_NAME = System.getProperty("user.dir");
-
- /** A list of some invalid file name characters.
- : is the filename separator in MacOS and the drive indicator in DOS
- * is a DOS wildcard character
- | is a DOS redirection character
- & is our own escape character
- / is the filename separator in Unix and the command option tag in DOS
- \ is the filename separator in DOS/Windows and the escape character in Unix
- ; is ???
- ? is a DOS wildcard character
- [ is ???
- ] is ???
- = is ???
- + is ???
- < is a DOS redirection character
- > is a DOS redirection character
- " is used by DOS to delimit file names with spaces
- , is ???
- */
- public static final char[] INVALID_FILENAME_CHARACTERS = { ':', '*', '|', '&', '/', '\\', ';', '?', '[', ']', '=', '+', '<', '>', '"', ',' };
-
- /** This encoder will convert strings into valid file names. */
- public static final XMLStringEncoder FILE_NAME_ENCODER = new XMLStringEncoder(INVALID_FILENAME_CHARACTERS);
-
- /** Windows files that are redirected to devices etc. */
- private static final String[] WINDOWS_RESERVED_FILE_NAMES = {
- "con",
- "aux",
- "com1", "com2", "com3", "com4", "com5", "com6", "com7", "com8", "com9",
- "lpt1", "lpt2", "lpt3", "lpt4", "lpt5", "lpt6", "lpt7", "lpt8", "lpt9",
- "prn",
- "nul"
- };
-
- /** The default length of a shortened file name. */
- public static final int MAXIMUM_SHORTENED_FILE_NAME_LENGTH = 60;
-
-
- // ********** deleting directories **********
-
- /**
- * Delete the specified directory and all of its contents.
- * <em>USE WITH CARE.</em>
- * File#deleteAll()?
- */
- public static void deleteDirectory(String directoryName) {
- deleteDirectory(new File(directoryName));
- }
-
- /**
- * Delete the specified directory and all of its contents.
- * <em>USE WITH CARE.</em>
- * File#deleteAll()?
- */
- public static void deleteDirectory(File directory) {
- deleteDirectoryContents(directory);
- if ( ! directory.delete()) {
- throw new RuntimeException("unable to delete directory: " + directory.getAbsolutePath());
- }
- }
-
- /**
- * Delete the contents of the specified directory
- * (but not the directory itself).
- * <em>USE WITH CARE.</em>
- * File#deleteFiles()
- */
- public static void deleteDirectoryContents(String directoryName) {
- deleteDirectoryContents(new File(directoryName));
- }
-
- /**
- * Delete the contents of the specified directory
- * (but not the directory itself).
- * <em>USE WITH CARE.</em>
- * File#deleteFiles()
- */
- public static void deleteDirectoryContents(File directory) {
- for (File file : directory.listFiles()) {
- if (file.isDirectory()) {
- deleteDirectory(file); // recurse through subdirectories
- } else {
- if ( ! file.delete()) {
- throw new RuntimeException("unable to delete file: " + file.getAbsolutePath());
- }
- }
- }
- }
-
-
- // ********** copying files **********
-
- /**
- * Copies the content of the source file to the destination file.
- * File#copy(File destinationFile)
- */
- public static void copyToFile(File sourceFile, File destinationFile)
- throws IOException
- {
- FileChannel sourceChannel = new FileInputStream(sourceFile).getChannel();
- FileChannel destinationChannel = new FileOutputStream(destinationFile).getChannel();
- try {
- destinationChannel.transferFrom(sourceChannel, 0, sourceChannel.size());
- } finally {
- sourceChannel.close();
- destinationChannel.close();
- }
- }
-
- /**
- * Copies the content of the source file to a file by
- * the same name in the destination directory.
- * File#copyToDirectory(File destinationDirectory)
- */
- public static void copyToDirectory(File sourceFile, File destinationDirectory)
- throws IOException
- {
- File destinationFile = new File(destinationDirectory, sourceFile.getName());
- destinationFile.createNewFile();
- copyToFile(sourceFile, destinationFile);
- }
-
-
- // ********** iteratoring over files and directories **********
-
- /**
- * Return an iterator on all the files in the specified directory.
- * The iterator will skip over subdirectories.
- * File#files()
- */
- public static Iterator<File> filesIn(String directoryName) {
- return filesIn(new File(directoryName));
- }
-
- /**
- * Return an iterator on all the files in the specified directory.
- * The iterator will skip over subdirectories.
- * File#files()
- */
- public static Iterator<File> filesIn(File directory) {
- return filesIn(directory.listFiles());
- }
-
- private static Iterator<File> filesIn(File[] files) {
- return new FilteringIterator<File>(new ArrayIterator<File>(files)) {
- @Override
- protected boolean accept(Object next) {
- return ((File) next).isFile();
- }
- };
- }
-
- /**
- * Return an iterator on all the subdirectories
- * in the specified directory.
- * File#subDirectories()
- */
- public static Iterator<File> directoriesIn(String directoryName) {
- return directoriesIn(new File(directoryName));
- }
-
- /**
- * Return an iterator on all the subdirectories
- * in the specified directory.
- * File#subDirectories()
- */
- public static Iterator<File> directoriesIn(File directory) {
- return directoriesIn(directory.listFiles());
- }
-
- private static Iterator<File> directoriesIn(File[] files) {
- return new FilteringIterator<File>(new ArrayIterator<File>(files)) {
- @Override
- protected boolean accept(Object next) {
- return ((File) next).isDirectory();
- }
- };
- }
-
- /**
- * Return an iterator on all the files under the specified
- * directory, recursing into subdirectories.
- * The iterator will skip over the subdirectories themselves.
- * File#filesRecurse()
- */
- public static Iterator<File> filesInTree(String directoryName) {
- return filesInTree(new File(directoryName));
- }
-
- /**
- * Return an iterator on all the files under the specified
- * directory, recursing into subdirectories.
- * The iterator will skip over the subdirectories themselves.
- * File#filesRecurse()
- */
- public static Iterator<File> filesInTree(File directory) {
- return filesInTreeAsSet(directory).iterator();
- }
-
- private static Set<File> filesInTreeAsSet(File directory) {
- Set<File> files = new HashSet<File>(10000);
- addFilesInTreeTo(directory, files);
- return files;
- }
-
- private static void addFilesInTreeTo(File directory, Collection<File> allFiles) {
- for (File file : directory.listFiles()) {
- if (file.isFile()) {
- allFiles.add(file);
- } else if (file.isDirectory()) {
- addFilesInTreeTo(file, allFiles);
- }
- }
- }
-
- /**
- * Return an iterator on all the directories under the specified
- * directory, recursing into subdirectories.
- * File#subDirectoriesRecurse()
- */
- public static Iterator<File> directoriesInTree(String directoryName) {
- return directoriesInTree(new File(directoryName));
- }
-
- /**
- * Return an iterator on all the directories under the specified
- * directory, recursing into subdirectories.
- * File#subDirectoriesRecurse()
- */
- @SuppressWarnings("unchecked")
- public static Iterator<File> directoriesInTree(File directory) {
- File[] files = directory.listFiles();
- return new CompositeIterator<File>(directoriesIn(files), directoriesInTrees(directoriesIn(files)));
- }
-
- private static Iterator<File> directoriesInTrees(Iterator<File> directories) {
- return new CompositeIterator<File>(
- new TransformationIterator<File, Iterator<File>>(directories) {
- @Override
- protected Iterator<File> transform(File next) {
- return FileTools.directoriesInTree(next);
- }
- }
- );
- }
-
-
- // ********** short file name manipulation **********
-
- /**
- * Strip the extension from the specified file name
- * and return the result. If the file name has no
- * extension, it is returned unchanged
- * File#basePath()
- */
- public static String stripExtension(String fileName) {
- int index = fileName.lastIndexOf('.');
- if (index == -1) {
- return fileName;
- }
- return fileName.substring(0, index);
- }
-
- /**
- * Strip the extension from the specified file's name
- * and return the result. If the file's name has no
- * extension, it is returned unchanged
- * File#basePath()
- */
- public static String stripExtension(File file) {
- return stripExtension(file.getPath());
- }
-
- /**
- * Return the extension, including the dot, of the specified file name.
- * If the file name has no extension, return an empty string.
- * File#extension()
- */
- public static String extension(String fileName) {
- int index = fileName.lastIndexOf('.');
- if (index == -1) {
- return "";
- }
- return fileName.substring(index);
- }
-
- /**
- * Return the extension, including the dot, of the specified file's name.
- * If the file's name has no extension, return an empty string.
- * File#extension()
- */
- public static String extension(File file) {
- return extension(file.getPath());
- }
-
-
- // ********** temporary directories **********
-
- /**
- * Build and return an empty temporary directory with the specified
- * name. If the directory already exists, it will be cleared out.
- * This directory will be a subdirectory of the Java temporary directory,
- * as indicated by the System property "java.io.tmpdir".
- */
- public static File emptyTemporaryDirectory(String name) {
- File dir = new File(userTemporaryDirectory(), name);
- if (dir.exists()) {
- deleteDirectoryContents(dir);
- } else {
- dir.mkdirs();
- }
- return dir;
- }
-
- /**
- * Build and return an empty temporary directory with a
- * name of "tmpdir". If the directory already exists, it will be cleared out.
- * This directory will be a subdirectory of the Java temporary directory,
- * as indicated by the System property "java.io.tmpdir".
- */
- public static File emptyTemporaryDirectory() {
- return emptyTemporaryDirectory(DEFAULT_TEMPORARY_DIRECTORY_NAME);
- }
-
- /**
- * Build and return a temporary directory with the specified
- * name. If the directory already exists, it will be left unchanged;
- * if it does not already exist, it will be created.
- * This directory will be a subdirectory of the Java temporary directory,
- * as indicated by the System property "java.io.tmpdir".
- */
- public static File temporaryDirectory(String name) {
- File dir = new File(userTemporaryDirectory(), name);
- if ( ! dir.exists()) {
- dir.mkdirs();
- }
- return dir;
- }
-
- /**
- * Build and return a temporary directory with a name of
- * "tmpdir". If the directory already exists, it will be left unchanged;
- * if it does not already exist, it will be created.
- * This directory will be a subdirectory of the Java temporary directory,
- * as indicated by the System property "java.io.tmpdir".
- */
- public static File temporaryDirectory() {
- return temporaryDirectory(DEFAULT_TEMPORARY_DIRECTORY_NAME);
- }
-
- /**
- * Build and return a *new* temporary directory with the specified
- * prefix. The prefix will be appended with a number that
- * is incremented, starting with 1, until a non-pre-existing directory
- * is found and successfully created. This directory will be a
- * subdirectory of the Java temporary directory, as indicated by
- * the System property "java.io.tmpdir".
- */
- public static File newTemporaryDirectory(String prefix) {
- if ( ! prefix.endsWith(".")) {
- prefix = prefix + ".";
- }
- File dir;
- int i = 0;
- do {
- i++;
- dir = new File(userTemporaryDirectory(), prefix + i);
- } while ( ! dir.mkdirs());
- return dir;
- }
-
- /**
- * Build and return a *new* temporary directory with a
- * prefix of "tmpdir". This prefix will be appended with a number that
- * is incremented, starting with 1, until a non-pre-existing directory
- * is found and successfully created. This directory will be a
- * subdirectory of the Java temporary directory, as indicated by
- * the System property "java.io.tmpdir".
- */
- public static File newTemporaryDirectory() {
- return newTemporaryDirectory(DEFAULT_TEMPORARY_DIRECTORY_NAME);
- }
-
-
- // ********** resource files **********
-
- /**
- * Build and return a file for the specified resource.
- * The resource name must be fully-qualified, i.e. it cannot be relative
- * to the package name/directory.
- * NB: There is a bug in jdk1.4.x the prevents us from getting
- * a resource that has spaces (or other special characters) in
- * its name.... (see Sun's Java bug 4466485)
- */
- public static File resourceFile(String resourceName) throws URISyntaxException {
- if ( ! resourceName.startsWith("/")) {
- throw new IllegalArgumentException(resourceName);
- }
- return resourceFile(resourceName, FileTools.class);
- }
-
- /**
- * Build and return a file for the specified resource.
- * NB: There is a bug in jdk1.4.x the prevents us from getting
- * a resource that has spaces (or other special characters) in
- * its name.... (see Sun's Java bug 4466485)
- */
- public static File resourceFile(String resourceName, Class<?> javaClass) throws URISyntaxException {
- URL url = javaClass.getResource(resourceName);
- return buildFile(url);
- }
-
- /**
- * Build and return a file for the specified URL.
- * NB: There is a bug in jdk1.4.x the prevents us from getting
- * a resource that has spaces (or other special characters) in
- * its name.... (see Sun's Java bug 4466485)
- */
- public static File buildFile(URL url) throws URISyntaxException {
- return buildFile(url.getFile());
- }
-
- /**
- * Build and return a file for the specified file name.
- * NB: There is a bug in jdk1.4.x the prevents us from getting
- * a resource that has spaces (or other special characters) in
- * its name.... (see Sun's Java bug 4466485)
- */
- public static File buildFile(String fileName) throws URISyntaxException {
- URI uri = new URI(fileName);
- File file = new File(uri.getPath());
- return file;
- }
-
-
- // ********** "canonical" files **********
-
- /**
- * Convert the specified file into a "canonical" file.
- */
- public static File canonicalFile(File file) {
- try {
- return file.getCanonicalFile();
- } catch (IOException ioexception) {
- // settle for the absolute file
- return file.getAbsoluteFile();
- }
- }
-
- /**
- * Build an iterator that will convert the specified files
- * into "canonical" files.
- */
- public static Iterator<File> canonicalFiles(Iterator<File> files) {
- return new TransformationIterator<File, File>(files) {
- @Override
- protected File transform(File next) {
- return canonicalFile(next);
- }
- };
- }
-
- /**
- * Build an iterator that will convert the specified files
- * into "canonical" files.
- */
- public static Iterator<File> canonicalFiles(Collection<File> files) {
- return canonicalFiles(files.iterator());
- }
-
- /**
- * Convert the specified file name into a "canonical" file name.
- */
- public static String canonicalFileName(String fileName) {
- return canonicalFile(new File(fileName)).getAbsolutePath();
- }
-
- /**
- * Build an iterator that will convert the specified file names
- * into "canonical" file names.
- */
- public static Iterator<String> canonicalFileNames(Iterator<String> fileNames) {
- return new TransformationIterator<String, String>(fileNames) {
- @Override
- protected String transform(String next) {
- return canonicalFileName(next);
- }
- };
- }
-
- /**
- * Build an iterator that will convert the specified file names
- * into "canonical" file names.
- */
- public static Iterator<String> canonicalFileNames(Collection<String> fileNames) {
- return canonicalFileNames(fileNames.iterator());
- }
-
-
- // ********** file name validation **********
-
- /**
- * Return whether the specified file name is invalid.
- */
- public static boolean fileNameIsInvalid(String filename) {
- return ! fileNameIsValid(filename);
- }
-
- /**
- * Return whether the specified file name is valid.
- */
- public static boolean fileNameIsValid(String filename) {
- int len = filename.length();
- for (int i = 0; i < len; i++) {
- char filenameChar = filename.charAt(i);
- if (CollectionTools.contains(INVALID_FILENAME_CHARACTERS, filenameChar)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Convert the illegal characters in the specified file name to
- * the specified character and return the result.
- */
- public static String convertToValidFileName(String filename, char replacementChar) {
- int len = filename.length();
- StringBuffer sb = new StringBuffer(len);
- for (int i = 0; i < len; i++) {
- char filenameChar = filename.charAt(i);
- if (CollectionTools.contains(INVALID_FILENAME_CHARACTERS, filenameChar)) {
- sb.append(replacementChar);
- } else {
- sb.append(filenameChar);
- }
- }
- return sb.toString();
- }
-
- /**
- * Convert the illegal characters in the specified file name to
- * periods ('.') and return the result.
- */
- public static String convertToValidFileName(String filename) {
- return convertToValidFileName(filename, '.');
- }
-
- /**
- * Return whether the specified file name is "reserved"
- * (i.e. it cannot be used for "user" files). Windows reserves
- * a number of file names (e.g. CON, AUX, PRN).
- */
- public static boolean fileNameIsReserved(String fileName) {
- if (executingOnWindows()) {
- return CollectionTools.contains(WINDOWS_RESERVED_FILE_NAMES, fileName.toLowerCase());
- }
- return false; // Unix does not have any "reserved" file names (I think...)
- }
-
- /**
- * Return whether the specified file contains any "reserved"
- * components.
- * Windows reserves a number of file names (e.g. CON, AUX, PRN);
- * and these file names cannot be used for either the names of
- * files or directories.
- */
- public static boolean fileHasAnyReservedComponents(File file) {
- File temp = file;
- while (temp != null) {
- if (fileNameIsReserved(temp.getName())) {
- return true;
- }
- temp = temp.getParentFile();
- }
- return false;
- }
-
-
- // ********** shortened file names **********
-
- /**
- * Return a shorter version of the absolute file name for the specified file.
- * The shorter version will not be longer than the maximum length.
- * The first directory (usually the drive letter) and the file name or the
- * last directory will always be added to the generated string regardless of
- * the maximum length allowed.
- */
- public static String shortenFileName(URL url) {
- return shortenFileName(url, MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- /**
- * Return a shorter version of the absolute file name for the specified file.
- * The shorter version will not be longer than the maximum length.
- * The first directory (usually the drive letter) and the file name or the
- * last directory will always be added to the generated string regardless of
- * the maximum length allowed.
- */
- public static String shortenFileName(URL url, int maxLength) {
- File file;
- try {
- file = buildFile(url);
- } catch (URISyntaxException e) {
- file = new File(url.getFile());
- }
- return shortenFileName(file, maxLength);
- }
-
- /**
- * Return a shorter version of the absolute file name for the specified file.
- * The shorter version will not be longer than the maximum length.
- * The first directory (usually the drive letter) and the file name or the
- * last directory will always be added to the generated string regardless of
- * the maximum length allowed.
- */
- public static String shortenFileName(File file) {
- return shortenFileName(file, MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- /**
- * Return a shorter version of the absolute file name for the specified file.
- * The shorter version will not be longer than the maximum length.
- * The first directory (usually the drive letter) and the file name or the
- * last directory will always be added to the generated string regardless of
- * the maximum length allowed.
- */
- public static String shortenFileName(File file, int maxLength) {
- String absoluteFileName = canonicalFile(file).getAbsolutePath();
- if (absoluteFileName.length() <= maxLength) {
- // no need to shorten
- return absoluteFileName;
- }
-
- // break down the path into its components
- String fs = File.separator;
- String[] paths = absoluteFileName.split("\\" + fs);
-
- if (paths.length <= 1) {
- // e.g. "C:\"
- return paths[0];
- }
-
- if (paths.length == 2) {
- // e.g. "C:\MyReallyLongFileName.ext" or "C:\MyReallyLongDirectoryName"
- // return the complete file name since this is a minimum requirement,
- // regardless of the maximum length allowed
- return absoluteFileName;
- }
-
- StringBuffer sb = new StringBuffer();
- sb.append(paths[0]); // always add the first directory, which is usually the drive letter
-
- // Keep the index of insertion into the string buffer
- int insertIndex = sb.length();
-
- sb.append(fs);
- sb.append(paths[paths.length - 1]); // append the file name or the last directory
-
- maxLength -= 4; // -4 for "/..."
-
- int currentLength = sb.length() - 4; // -4 for "/..."
- int leftIndex = 1; // 1 to skip the root directory
- int rightIndex = paths.length - 2; // -1 for the file name or the last directory
-
- boolean canAddFromLeft = true;
- boolean canAddFromRight = true;
-
- // Add each directory, the insertion is going in both direction: left and
- // right, once a side can't be added, the other side is still continuing
- // until both can't add anymore
- while (true) {
- if (!canAddFromLeft && !canAddFromRight)
- break;
-
- if (canAddFromRight) {
- String rightDirectory = paths[rightIndex];
- int rightLength = rightDirectory.length();
-
- // Add the directory on the right side of the loop
- if (currentLength + rightLength + 1 <= maxLength) {
- sb.insert(insertIndex, fs);
- sb.insert(insertIndex + 1, rightDirectory);
-
- currentLength += rightLength + 1;
- rightIndex--;
-
- // The right side is now overlapping the left side, that means
- // we can't add from the right side anymore
- if (leftIndex >= rightIndex) {
- canAddFromRight = false;
- }
- } else {
- canAddFromRight = false;
- }
- }
-
- if (canAddFromLeft) {
- String leftDirectory = paths[leftIndex];
- int leftLength = leftDirectory.length();
-
- // Add the directory on the left side of the loop
- if (currentLength + leftLength + 1 <= maxLength) {
- sb.insert(insertIndex, fs);
- sb.insert(insertIndex + 1, leftDirectory);
-
- insertIndex += leftLength + 1;
- currentLength += leftLength + 1;
- leftIndex++;
-
- // The left side is now overlapping the right side, that means
- // we can't add from the left side anymore
- if (leftIndex >= rightIndex) {
- canAddFromLeft = false;
- }
- } else {
- canAddFromLeft = false;
- }
- }
- }
-
- if (leftIndex <= rightIndex) {
- sb.insert(insertIndex, fs);
- sb.insert(insertIndex + 1, "...");
- }
-
- return sb.toString();
- }
-
-
- // ********** system properties **********
-
- /**
- * Return a file representing the user's home directory.
- */
- public static File userHomeDirectory() {
- return new File(USER_HOME_DIRECTORY_NAME);
- }
-
- /**
- * Return a file representing the user's temporary directory.
- */
- public static File userTemporaryDirectory() {
- return new File(USER_TEMPORARY_DIRECTORY_NAME);
- }
-
- /**
- * Return a file representing the current working directory.
- */
- public static File currentWorkingDirectory() {
- return new File(CURRENT_WORKING_DIRECTORY_NAME);
- }
-
-
- // ********** miscellaneous **********
-
- private static boolean executingOnWindows() {
- return executingOn("Windows");
- }
-
-// private static boolean executingOnLinux() {
-// return executingOn("Linux");
-// }
-//
- private static boolean executingOn(String osName) {
- return System.getProperty("os.name").indexOf(osName) != -1;
- }
-
- /**
- * Return only the files that fit the filter.
- * File#files(FileFilter fileFilter)
- */
- public static Iterator<File> filter(Iterator<File> files, final FileFilter fileFilter) {
- return new FilteringIterator<File>(files) {
- @Override
- protected boolean accept(Object next) {
- return fileFilter.accept((File) next);
- }
- };
- }
-
- /**
- * Return a file that is a re-specification of the specified
- * file, relative to the specified directory.
- * Linux/Unix/Mac:
- * convertToRelativeFile(/foo/bar/baz.java, /foo)
- * => bar/baz.java
- * Windows:
- * convertToRelativeFile(C:\foo\bar\baz.java, C:\foo)
- * => bar/baz.java
- * The file can be either a file or a directory; the directory
- * *should* be a directory.
- * If the file is already relative or it cannot be made relative
- * to the directory, it will be returned unchanged.
- *
- * NB: This method has been tested on Windows and Linux,
- * but not Mac (but the Mac is Unix-based these days, so
- * it shouldn't be a problem...).
- */
- public static File convertToRelativeFile(final File file, final File dir) {
- // check whether the file is already relative
- if ( ! file.isAbsolute()) {
- return file; // return unchanged
- }
-
- File cFile = canonicalFile(file);
- File cDir = canonicalFile(dir);
-
- // the two are the same directory
- if (cFile.equals(cDir)) {
- return new File(".");
- }
-
- File[] filePathFiles = pathFiles(cFile);
- File[] dirPathFiles = pathFiles(cDir);
-
- // Windows only (?): the roots are different - e.g. D:\ vs. C:\
- if ( ! dirPathFiles[0].equals(filePathFiles[0])) {
- return file; // return unchanged
- }
-
- // at this point we know the root is the same, now find how much is in common
- int i = 0; // this will point at the first miscompare
- while ((i < dirPathFiles.length) && (i < filePathFiles.length)) {
- if (dirPathFiles[i].equals(filePathFiles[i])) {
- i++;
- } else {
- break;
- }
- }
- // save our current position
- int firstMismatch = i;
-
- // check whether the file is ABOVE the directory: ../..
- if (firstMismatch == filePathFiles.length) {
- return relativeParentFile(dirPathFiles.length - firstMismatch);
- }
-
- // build a new file from the path beyond the matching portions
- File diff = new File(filePathFiles[i].getName());
- while (++i < filePathFiles.length) {
- diff = new File(diff, filePathFiles[i].getName());
- }
-
- // check whether the file is BELOW the directory: subdir1/subdir2/file.ext
- if (firstMismatch == dirPathFiles.length) {
- return diff;
- }
-
- // the file must be a PEER of the directory: ../../subdir1/subdir2/file.ext
- return new File(relativeParentFile(dirPathFiles.length - firstMismatch), diff.getPath());
- }
-
- /**
- * Return a file that is a re-specification of the specified
- * file, relative to the current working directory.
- * Linux/Unix/Mac (CWD = /foo):
- * convertToRelativeFile(/foo/bar/baz.java)
- * => bar/baz.java
- * Windows (CWD = C:\foo):
- * convertToRelativeFile(C:\foo\bar\baz.java)
- * => bar/baz.java
- * The file can be either a file or a directory.
- * If the file is already relative or it cannot be made relative
- * to the directory, it will be returned unchanged.
- *
- * NB: This method has been tested on Windows and Linux,
- * but not Mac (but the Mac is Unix-based these days, so
- * it shouldn't be a problem...).
- */
- public static File convertToRelativeFile(final File file) {
- return convertToRelativeFile(file, currentWorkingDirectory());
- }
-
- /**
- * Return an array of files representing the path to the specified
- * file. For example:
- * C:/foo/bar/baz.txt =>
- * { C:/, C:/foo, C:/foo/bar, C:/foo/bar/baz.txt }
- */
- private static File[] pathFiles(File file) {
- List<File> path = new ArrayList<File>();
- for (File f = file; f != null; f = f.getParentFile()) {
- path.add(f);
- }
- Collections.reverse(path);
- return path.toArray(new File[path.size()]);
- }
-
- /**
- * Return a file with the specified (non-zero) number of relative
- * file names, e.g. xxx(3) => ../../..
- */
- private static File relativeParentFile(int len) {
- if (len <= 0) {
- throw new IllegalArgumentException("length must be greater than zero: " + len);
- }
- File result = new File("..");
- for (int i = len - 1; i-- > 0; ) {
- result = new File(result, "..");
- }
- return result;
- }
-
- /**
- * Return a file that is a re-specification of the specified
- * file, absolute to the specified directory.
- * Linux/Unix/Mac:
- * convertToAbsoluteFile(bar/baz.java, /foo)
- * => /foo/bar/baz.java
- * Windows:
- * convertToAbsoluteFile(bar/baz.java, C:\foo)
- * => C:\foo\bar\baz.java
- * The file can be either a file or a directory; the directory
- * *should* be a directory.
- * If the file is already absolute, it will be returned unchanged.
- *
- * NB: This method has been tested on Windows and Linux,
- * but not Mac (but the Mac is Unix-based these days, so
- * it shouldn't be a problem...).
- */
- public static File convertToAbsoluteFile(final File file, final File dir) {
- // check whether the file is already absolute
- if (file.isAbsolute()) {
- return file; // return unchanged
- }
- return canonicalFile(new File(dir, file.getPath()));
- }
-
- /**
- * Return a file that is a re-specification of the specified
- * file, absolute to the current working directory.
- * Linux/Unix/Mac (CWD = /foo):
- * convertToAbsoluteFile(bar/baz.java)
- * => /foo/bar/baz.java
- * Windows (CWD = C:\foo):
- * convertToAbsoluteFile(bar/baz.java)
- * => C:\foo\bar\baz.java
- * The file can be either a file or a directory.
- * If the file is already absolute, it will be returned unchanged.
- *
- * NB: This method has been tested on Windows and Linux,
- * but not Mac (but the Mac is Unix-based these days, so
- * it shouldn't be a problem...).
- */
- public static File convertToAbsoluteFile(final File file) {
- return convertToAbsoluteFile(file, currentWorkingDirectory());
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private FileTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Filter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Filter.java
deleted file mode 100644
index 20f95e0c33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Filter.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-/**
- * Used by various "pluggable" classes to filter objects.
- */
-public interface Filter<T> {
-
- /**
- * Return whether the specified object is "accepted" by the
- * filter. The semantics of "accept" is determined by the
- * contract between the client and the server.
- */
- boolean accept(T o);
-
-
- final class Null<S> implements Filter<S> {
- @SuppressWarnings("unchecked")
- public static final Filter INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R> Filter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- // nothing is filtered - everything is accepted
- public boolean accept(S next) {
- return true;
- }
- @Override
- public String toString() {
- return "Filter.Null";
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java
deleted file mode 100644
index 5017cf944d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java
+++ /dev/null
@@ -1,733 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.io.Serializable;
-import java.util.AbstractCollection;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * This class implements the <code>Bag</code> interface, backed by a
- * hash table. It makes no guarantees as to the iteration order of
- * the bag's elements; in particular, it does not guarantee that the order
- * will remain constant over time. This class permits the <code>null</code>
- * element.
- * <p>
- * This class offers constant time performance for the basic operations
- * (<code>add</code>, <code>remove</code>, <code>contains</code> and
- * <code>size</code>), assuming the hash function disperses the elements
- * properly among the buckets. Iterating over this bag requires time
- * proportional to the sum of the bag's size (the number of elements) plus the
- * "capacity" of the backing hash table (the number of buckets). Thus, it is
- * important not to set the initial capacity too high (or the load factor too
- * low) if iteration performance is important.
- * <p>
- * <b>Note that this implementation is not synchronized.</b> If multiple
- * threads access a bag concurrently, and at least one of the threads modifies
- * the bag, it <i>must</i> be synchronized externally. This is typically
- * accomplished by synchronizing on some object that naturally encapsulates
- * the bag. If no such object exists, the bag should be "wrapped" using the
- * <code>Collections.synchronizedCollection</code> method. This is
- * best done at creation time, to prevent accidental unsynchronized access
- * to the bag:
- * <pre>
- * Collection c = Collections.synchronizedCollection(new HashBag(...));
- * </pre>
- * <p>
- * The iterators returned by this class's <code>iterator</code> method are
- * <i>fail-fast</i>: if the bag is modified at any time after the iterator is
- * created, in any way except through the iterator's own <code>remove</code>
- * method, the iterator throws a <code>ConcurrentModificationException</code>.
- * Thus, in the face of concurrent modification, the iterator fails quickly
- * and cleanly, rather than risking arbitrary, non-deterministic behavior at
- * an undetermined time in the future.
- *
- * @see Collections#synchronizedCollection(Collection)
- */
-
-public class HashBag<E> extends AbstractCollection<E>
- implements Bag<E>, Cloneable, Serializable {
-
- /** The hash table. */
- transient Entry<E>[] table;
-
- /** The total number of entries in the bag. */
- transient int count = 0;
-
- /** The number of unique entries in the bag. */
- transient int uniqueCount = 0;
-
- /**
- * The hash table is rehashed when its size exceeds this threshold. (The
- * value of this field is (int)(capacity * loadFactor).)
- *
- * @serial
- */
- private int threshold;
-
- /**
- * The load factor for the hash table.
- *
- * @serial
- */
- private float loadFactor;
-
- /**
- * The number of times this bag has been structurally modified.
- * Structural modifications are those that change the number of entries in
- * the bag or otherwise modify its internal structure (e.g. rehash).
- * This field is used to make iterators on this bag fail-fast.
- *
- * @see java.util.ConcurrentModificationException
- */
- transient int modCount = 0;
-
- /**
- * Constructs a new, empty bag with the
- * default capacity, which is 11, and load factor, which is 0.75.
- */
- public HashBag() {
- this(11, 0.75f);
- }
-
- /**
- * Constructs a new, empty bag with the specified initial capacity
- * and default load factor, which is 0.75.
- *
- * @param initialCapacity the initial capacity of the backing map.
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero.
- */
- public HashBag(int initialCapacity) {
- this(initialCapacity, 0.75f);
- }
-
- /**
- * Constructs a new, empty bag with
- * the specified initial capacity and the specified load factor.
- *
- * @param initialCapacity the initial capacity of the backing map.
- * @param loadFactor the load factor of the backing map.
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero, or if the load factor is nonpositive.
- */
- @SuppressWarnings("unchecked")
- public HashBag(int initialCapacity, float loadFactor) {
- if (initialCapacity < 0) {
- throw new IllegalArgumentException("Illegal Initial Capacity: " + initialCapacity);
- }
- if (loadFactor <= 0 || Float.isNaN(loadFactor)) {
- throw new IllegalArgumentException("Illegal Load factor: " + loadFactor);
- }
- if (initialCapacity == 0) {
- initialCapacity = 1;
- }
- this.loadFactor = loadFactor;
- this.table = new Entry[initialCapacity];
- this.threshold = (int) (initialCapacity * loadFactor);
- }
-
- /**
- * Constructs a new bag containing the elements in the specified
- * collection. The capacity of the bag is
- * twice the size of the specified collection or 11 (whichever is
- * greater), and the default load factor, which is 0.75, is used.
- *
- * @param c the collection whose elements are to be placed into this bag.
- */
- public HashBag(Collection<? extends E> c) {
- this(Math.max(2*c.size(), 11));
- this.addAll(c);
- }
-
- /**
- * This implementation simply returns the maintained count.
- */
- @Override
- public int size() {
- return this.count;
- }
-
- /**
- * This implementation simply compares the maintained count to zero.
- */
- @Override
- public boolean isEmpty() {
- return this.count == 0;
- }
-
- /**
- * This implementation searches for the object in the hash table by calculating
- * the object's hash code and examining the entries in the corresponding hash
- * table bucket.
- */
- @Override
- public boolean contains(Object o) {
- Entry<E>[] tab = this.table;
- if (o == null) {
- for (Entry<E> e = tab[0]; e != null; e = e.next) {
- if (e.object == null) {
- return true;
- }
- }
- } else {
- int hash = o.hashCode();
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && o.equals(e.object)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Return the number of times the specified object occurs in the bag.
- */
- public int count(Object o) {
- Entry<E>[] tab = this.table;
- if (o == null) {
- for (Entry<E> e = tab[0]; e != null; e = e.next) {
- if (e.object == null) {
- return e.count;
- }
- }
- } else {
- int hash = o.hashCode();
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && o.equals(e.object)) {
- return e.count;
- }
- }
- }
- return 0;
- }
-
- /**
- * Rehashes the contents of this bag into a new hash table
- * with a larger capacity. This method is called when the
- * number of different elements in this map exceeds its
- * capacity and load factor.
- */
- @SuppressWarnings("unchecked")
- private void rehash() {
- Entry<E>[] oldMap = this.table;
- int oldCapacity = oldMap.length;
-
- int newCapacity = oldCapacity * 2 + 1;
- Entry<E>[] newMap = new Entry[newCapacity];
-
- this.modCount++;
- this.threshold = (int) (newCapacity * this.loadFactor);
- this.table = newMap;
-
- for (int i = oldCapacity; i-- > 0; ) {
- for (Entry<E> old = oldMap[i]; old != null; ) {
- Entry<E> e = old;
- old = old.next;
-
- int index = (e.hash & 0x7FFFFFFF) % newCapacity;
- e.next = newMap[index];
- newMap[index] = e;
- }
- }
- }
-
- /**
- * This implementation searches for the object in the hash table by calculating
- * the object's hash code and examining the entries in the corresponding hash
- * table bucket.
- */
- @Override
- @SuppressWarnings("unchecked")
- public boolean add(E o) {
- this.modCount++;
- Entry<E>[] tab = this.table;
- int hash = 0;
- int index = 0;
-
- // if the object is already in the bag, simply bump its count
- if (o == null) {
- for (Entry<E> e = tab[0]; e != null; e = e.next) {
- if (e.object == null) {
- e.count++;
- this.count++;
- return true;
- }
- }
- } else {
- hash = o.hashCode();
- index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && o.equals(e.object)) {
- e.count++;
- this.count++;
- return true;
- }
- }
- }
-
- // rehash the table if the threshold is exceeded
- if (this.uniqueCount >= this.threshold) {
- this.rehash();
- tab = this.table;
- index = (hash & 0x7FFFFFFF) % tab.length;
- }
-
- // create the new entry and put it in the table
- Entry<E> e = new Entry(hash, o, tab[index]);
- tab[index] = e;
- this.count++;
- this.uniqueCount++;
- return true;
- }
-
- /**
- * This implementation searches for the object in the hash table by calculating
- * the object's hash code and examining the entries in the corresponding hash
- * table bucket.
- */
- @Override
- public boolean remove(Object o) {
- Entry<E>[] tab = this.table;
- if (o == null) {
- for (Entry<E> e = tab[0], prev = null; e != null; prev = e, e = e.next) {
- if (e.object == null) {
- this.modCount++;
- e.count--;
- // if we are removing the last one, remove the entry from the table
- if (e.count == 0) {
- if (prev == null) {
- tab[0] = e.next;
- } else {
- prev.next = e.next;
- }
- this.uniqueCount--;
- }
- this.count--;
- return true;
- }
- }
- } else {
- int hash = o.hashCode();
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index], prev = null; e != null; prev = e, e = e.next) {
- if ((e.hash == hash) && o.equals(e.object)) {
- this.modCount++;
- e.count--;
- // if we are removing the last one, remove the entry from the table
- if (e.count == 0) {
- if (prev == null) {
- tab[index] = e.next;
- } else {
- prev.next = e.next;
- }
- this.uniqueCount--;
- }
- this.count--;
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * This implementation simply clears out all of the hash table buckets.
- */
- @Override
- public void clear() {
- Entry<E>[] tab = this.table;
- this.modCount++;
- for (int i = tab.length; --i >= 0; ) {
- tab[i] = null;
- }
- this.count = 0;
- this.uniqueCount = 0;
- }
-
- /**
- * Returns a shallow copy of this bag: the elements
- * themselves are not cloned.
- *
- * @return a shallow copy of this bag.
- */
- @Override
- @SuppressWarnings("unchecked")
- public HashBag<E> clone() {
- try {
- HashBag<E> clone = (HashBag<E>) super.clone();
- clone.table = new Entry[this.table.length];
- for (int i = this.table.length; i-- > 0; ) {
- clone.table[i] = (this.table[i] == null)
- ? null : (Entry) this.table[i].clone();
- }
- clone.modCount = 0;
- return clone;
- } catch (CloneNotSupportedException e) {
- throw new InternalError();
- }
- }
-
- /**
- * Hash table collision list entry.
- */
- private static class Entry<E> {
- int hash;
- E object;
- int count;
- Entry<E> next;
-
- Entry(int hash, E object, Entry<E> next) {
- this(hash, object, 1, next);
- }
-
- private Entry(int hash, E object, int count, Entry<E> next) {
- this.hash = hash;
- this.object = object;
- this.count = count;
- this.next = next;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- protected Entry<E> clone() {
- return new Entry(this.hash, this.object, this.count,
- (this.next == null ? null : this.next.clone()));
- }
-
- @Override
- public String toString() {
- return this.object + "=>" + this.count;
- }
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterator<E> iterator() {
- if (this.count == 0) {
- return EMPTY_ITERATOR;
- }
- return new HashIterator();
- }
-
- /**
- * Return an iterator that returns each item in the bag
- * once and only once, irrespective of how many times
- * the item was added to the bag.
- */
- @SuppressWarnings("unchecked")
- public Iterator<E> uniqueIterator() {
- if (this.count == 0) {
- return EMPTY_ITERATOR;
- }
- return new UniqueIterator();
- }
-
- /**
- * Empty iterator that does just about nothing.
- */
- @SuppressWarnings("unchecked")
- private static final Iterator EMPTY_ITERATOR = new EmptyIterator();
-
- @SuppressWarnings("unchecked")
- private static class EmptyIterator implements Iterator {
-
- EmptyIterator() {
- super();
- }
-
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- throw new NoSuchElementException();
- }
-
- public void remove() {
- throw new IllegalStateException();
- }
- }
-
- private class HashIterator implements Iterator<E> {
- Entry<E>[] localTable = HashBag.this.table;
- int index = this.localTable.length; // start at the end of the table
- Entry<E> nextEntry = null;
- int nextEntryCount = 0;
- Entry<E> lastReturnedEntry = null;
-
- /**
- * The modCount value that the iterator believes that the backing
- * Bag should have. If this expectation is violated, the iterator
- * has detected a concurrent modification.
- */
- private int expectedModCount = HashBag.this.modCount;
-
- HashIterator() {
- super();
- }
-
- public boolean hasNext() {
- Entry<E> e = this.nextEntry;
- int i = this.index;
- Entry<E>[] tab = this.localTable;
- // Use locals for faster loop iteration
- while ((e == null) && (i > 0)) {
- e = tab[--i]; // move backwards through the table
- }
- this.nextEntry = e;
- this.index = i;
- return e != null;
- }
-
- public E next() {
- if (HashBag.this.modCount != this.expectedModCount) {
- throw new ConcurrentModificationException();
- }
- Entry<E> et = this.nextEntry;
- int i = this.index;
- Entry<E>[] tab = this.localTable;
- // Use locals for faster loop iteration
- while ((et == null) && (i > 0)) {
- et = tab[--i]; // move backwards through the table
- }
- this.nextEntry = et;
- this.index = i;
- if (et == null) {
- throw new NoSuchElementException();
- }
- Entry<E> e = this.lastReturnedEntry = this.nextEntry;
- this.nextEntryCount++;
- if (this.nextEntryCount == e.count) {
- this.nextEntry = e.next;
- this.nextEntryCount = 0;
- }
- return e.object;
- }
-
- public void remove() {
- if (this.lastReturnedEntry == null) {
- throw new IllegalStateException();
- }
- if (HashBag.this.modCount != this.expectedModCount) {
- throw new ConcurrentModificationException();
- }
- Entry<E>[] tab = this.localTable;
- int slot = (this.lastReturnedEntry.hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[slot], prev = null; e != null; prev = e, e = e.next) {
- if (e == this.lastReturnedEntry) {
- HashBag.this.modCount++;
- this.expectedModCount++;
- e.count--;
- if (e.count == 0) {
- // if we are removing the last one, remove the entry from the table
- if (prev == null) {
- tab[slot] = e.next;
- } else {
- prev.next = e.next;
- }
- HashBag.this.uniqueCount--;
- } else {
- // slide back the count to account for the just-removed element
- this.nextEntryCount--;
- }
- HashBag.this.count--;
- this.lastReturnedEntry = null; // it cannot be removed again
- return;
- }
- }
- throw new ConcurrentModificationException();
- }
-
- }
-
-
- private class UniqueIterator implements Iterator<E> {
- Entry<E>[] localTable = HashBag.this.table;
- int index = this.localTable.length; // start at the end of the table
- Entry<E> nextEntry = null;
- Entry<E> lastReturnedEntry = null;
-
- /**
- * The modCount value that the iterator believes that the backing
- * Bag should have. If this expectation is violated, the iterator
- * has detected a concurrent modification.
- */
- private int expectedModCount = HashBag.this.modCount;
-
- UniqueIterator() {
- super();
- }
-
- public boolean hasNext() {
- Entry<E> e = this.nextEntry;
- int i = this.index;
- Entry<E>[] tab = this.localTable;
- // Use locals for faster loop iteration
- while ((e == null) && (i > 0)) {
- e = tab[--i]; // move backwards through the table
- }
- this.nextEntry = e;
- this.index = i;
- return e != null;
- }
-
- public E next() {
- if (HashBag.this.modCount != this.expectedModCount) {
- throw new ConcurrentModificationException();
- }
- Entry<E> et = this.nextEntry;
- int i = this.index;
- Entry<E>[] tab = this.localTable;
- // Use locals for faster loop iteration
- while ((et == null) && (i > 0)) {
- et = tab[--i]; // move backwards through the table
- }
- this.nextEntry = et;
- this.index = i;
- if (et == null) {
- throw new NoSuchElementException();
- }
- Entry<E> e = this.lastReturnedEntry = this.nextEntry;
- this.nextEntry = e.next;
- return e.object;
- }
-
- public void remove() {
- if (this.lastReturnedEntry == null) {
- throw new IllegalStateException();
- }
- if (HashBag.this.modCount != this.expectedModCount) {
- throw new ConcurrentModificationException();
- }
- Entry<E>[] tab = this.localTable;
- int slot = (this.lastReturnedEntry.hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[slot], prev = null; e != null; prev = e, e = e.next) {
- if (e == this.lastReturnedEntry) {
- HashBag.this.modCount++;
- this.expectedModCount++;
- // remove the entry from the table
- if (prev == null) {
- tab[slot] = e.next;
- } else {
- prev.next = e.next;
- }
- HashBag.this.uniqueCount--;
- HashBag.this.count -= this.lastReturnedEntry.count;
- this.lastReturnedEntry = null; // it cannot be removed again
- return;
- }
- }
- throw new ConcurrentModificationException();
- }
-
- }
-
-
- @Override
- @SuppressWarnings("unchecked")
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ( ! (o instanceof Bag)) {
- return false;
- }
- Bag<E> b = (Bag<E>) o;
- if (b.size() != this.size()) {
- return false;
- }
- Bag<E> clone = this.clone();
- for (E e : b) {
- if ( ! clone.remove(e)) {
- return false;
- }
- }
- return clone.isEmpty();
- }
-
- @Override
- public int hashCode() {
- int h = 0;
- for (Iterator<E> stream = this.iterator(); stream.hasNext(); ) {
- Object next = stream.next();
- if (next != null) {
- h += next.hashCode();
- }
- }
- return h;
- }
-
- /**
- * Save the state of this bag to a stream (i.e. serialize it).
- *
- * @serialData Emit the capacity of the bag (int),
- * followed by the number of unique elements in the bag (int),
- * followed by all of the bag's elements (each an Object) and
- * their counts (each an int), in no particular order.
- */
- private synchronized void writeObject(java.io.ObjectOutputStream s)
- throws java.io.IOException {
- // write out the threshold, load factor, and any hidden stuff
- s.defaultWriteObject();
-
- // write out number of buckets
- s.writeInt(this.table.length);
-
- // write out number of unique elements
- s.writeInt(this.uniqueCount);
-
- Entry<E>[] tab = this.table;
- // write out elements and counts (alternating)
- for (Entry<E> entry : tab) {
- while (entry != null) {
- s.writeObject(entry.object);
- s.writeInt(entry.count);
- entry = entry.next;
- }
- }
- }
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Reconstitute the bag from a stream (i.e. deserialize it).
- */
- @SuppressWarnings("unchecked")
- private synchronized void readObject(java.io.ObjectInputStream s)
- throws java.io.IOException, ClassNotFoundException {
- // read in the threshold, loadfactor, and any hidden stuff
- s.defaultReadObject();
-
- // read in number of buckets and allocate the bucket array
- this.table = new Entry[s.readInt()];
-
- // read in number of unique elements
- int unique = s.readInt();
-
- // read the elements and counts, and put the elements in the bag
- for (int i = 0; i < unique; i++) {
- E element = (E) s.readObject();
- int elementCount = s.readInt();
- for (int j = 0; j < elementCount; j++) {
- this.add(element);
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IndentingPrintWriter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IndentingPrintWriter.java
deleted file mode 100644
index c510c86ebb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IndentingPrintWriter.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.io.PrintWriter;
-import java.io.Writer;
-
-/**
- * Extend PrintWriter to automatically indent new lines.
- */
-public class IndentingPrintWriter extends PrintWriter {
-
- private final String indent;
- private int indentLevel;
- private boolean needsIndent;
-
- public static String DEFAULT_INDENT = "\t";
-
-
- /**
- * Construct a writer that indents with tabs.
- */
- public IndentingPrintWriter(Writer out) {
- this(out, DEFAULT_INDENT);
- }
-
- /**
- * Construct a writer that indents with the specified string.
- */
- public IndentingPrintWriter(Writer out, String indent) {
- super(out);
- this.indent = indent;
- this.indentLevel = 0;
- this.needsIndent = true;
- }
-
- /**
- * Set flag so following line is indented.
- */
- @Override
- public void println() {
- synchronized (this.lock) {
- super.println();
- this.needsIndent = true;
- }
- }
-
- /**
- * Print the appropriate indent.
- */
- private void printIndent() {
- if (this.needsIndent) {
- this.needsIndent = false;
- for (int i = this.indentLevel; i-- > 0; ) {
- this.print(this.indent);
- }
- }
- }
-
- /**
- * Write a portion of an array of characters.
- */
- @Override
- public void write(char buf[], int off, int len) {
- synchronized (this.lock) {
- this.printIndent();
- super.write(buf, off, len);
- }
- }
-
- /**
- * Write a single character.
- */
- @Override
- public void write(int c) {
- synchronized (this.lock) {
- this.printIndent();
- super.write(c);
- }
- }
-
- /**
- * Write a portion of a string.
- */
- @Override
- public void write(String s, int off, int len) {
- synchronized (this.lock) {
- this.printIndent();
- super.write(s, off, len);
- }
- }
-
- /**
- * Bump the indent level.
- */
- public void indent() {
- this.incrementIndentLevel();
- }
-
- /**
- * Decrement the indent level.
- */
- public void undent() {
- this.decrementIndentLevel();
- }
-
- /**
- * Bump the indent level.
- */
- public void incrementIndentLevel() {
- synchronized (this.lock) {
- this.indentLevel++;
- }
- }
-
- /**
- * Decrement the indent level.
- */
- public void decrementIndentLevel() {
- synchronized (this.lock) {
- this.indentLevel--;
- }
- }
-
- /**
- * Return the current indent level.
- */
- public int getIndentLevel() {
- return this.indentLevel;
- }
-
- /**
- * Allow the indent level to be set directly.
- */
- public void setIndentLevel(int indentLevel) {
- synchronized (this.lock) {
- this.indentLevel = indentLevel;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCTools.java
deleted file mode 100644
index 23c4f6d39e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCTools.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.sql.Types;
-import java.util.HashMap;
-
-/**
- * Helper methods for dealing with the JDBC API.
- */
-public final class JDBCTools{
-
-
- /**
- * Return the JDBC type corresponding to the specified class.
- * @see java.sql.Types
- */
- public static JDBCType jdbcTypeForClassNamed(String className) {
- JavaToJDBCTypeMapping mapping = javaToJDBCTypeMapping(className);
- return (mapping == null) ? DEFAULT_JDBC_TYPE : mapping.getJDBCType();
- }
-
- /**
- * Return the JDBC type corresponding to the specified class.
- * @see java.sql.Types
- */
- public static JDBCType jdbcTypeFor(Class<?> javaClass) {
- return jdbcTypeForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the JDBC type corresponding to the specified class.
- * @see java.sql.Types
- */
- public static JDBCType jdbcTypeFor(JavaType javaType) {
- return jdbcTypeForClassNamed(javaType.javaClassName());
- }
-
- /**
- * Return the Java type corresponding to the specified JDBC type.
- * @see java.sql.Types
- */
- public static JavaType javaTypeForJDBCTypeNamed(String jdbcTypeName) {
- JDBCToJavaTypeMapping mapping = jdbcToJavaTypeMapping(jdbcTypeName);
- return (mapping == null) ? DEFAULT_JAVA_TYPE : mapping.getJavaType();
- }
-
- /**
- * Return the Java type corresponding to the specified JDBC type.
- * @see java.sql.Types
- */
- public static JavaType javaTypeFor(JDBCType jdbcType) {
- return javaTypeForJDBCTypeNamed(jdbcType.getName());
- }
-
- /**
- * Return the Java type corresponding to the specified JDBC type.
- * @see java.sql.Types
- */
- public static JavaType javaTypeForJDBCTypeCode(int jdbcTypeCode) {
- return javaTypeFor(JDBCType.type(jdbcTypeCode));
- }
-
-
- // ********** internal stuff **********
-
-
- // ********** JDBC => Java **********
-
- /**
- * JDBC => Java type mappings, keyed by JDBC type name (e.g. "VARCHAR")
- */
- private static HashMap<String, JDBCToJavaTypeMapping> JDBC_TO_JAVA_TYPE_MAPPINGS; // pseudo 'final' - lazy-initialized
- private static final JavaType DEFAULT_JAVA_TYPE = new JavaType(java.lang.Object.class); // TODO Object is the default?
-
-
- private static JDBCToJavaTypeMapping jdbcToJavaTypeMapping(String jdbcTypeName) {
- return jdbcToJavaTypeMappings().get(jdbcTypeName);
- }
-
- private static synchronized HashMap<String, JDBCToJavaTypeMapping> jdbcToJavaTypeMappings() {
- if (JDBC_TO_JAVA_TYPE_MAPPINGS == null) {
- JDBC_TO_JAVA_TYPE_MAPPINGS = buildJDBCToJavaTypeMappings();
- }
- return JDBC_TO_JAVA_TYPE_MAPPINGS;
- }
-
- private static HashMap<String, JDBCToJavaTypeMapping> buildJDBCToJavaTypeMappings() {
- HashMap<String, JDBCToJavaTypeMapping> mappings = new HashMap<String, JDBCToJavaTypeMapping>();
- addJDBCToJavaTypeMappingsTo(mappings);
- return mappings;
- }
-
- /**
- * hard code the default mappings from the JDBC types to the
- * appropriate Java types
- * @see java.sql.Types
- * see "JDBC 3.0 Specification" Appendix B
- */
- private static void addJDBCToJavaTypeMappingsTo(HashMap<String, JDBCToJavaTypeMapping> mappings) {
- addJDBCToJavaTypeMappingTo(Types.ARRAY, java.sql.Array.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.BIGINT, long.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.BINARY, byte[].class, mappings);
- addJDBCToJavaTypeMappingTo(Types.BIT, boolean.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.BLOB, java.sql.Blob.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.BOOLEAN, boolean.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.CHAR, java.lang.String.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.CLOB, java.sql.Clob.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.DATALINK, java.net.URL.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.DATE, java.sql.Date.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.DECIMAL, java.math.BigDecimal.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.DISTINCT, java.lang.Object.class, mappings); // ???
- addJDBCToJavaTypeMappingTo(Types.DOUBLE, double.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.FLOAT, double.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.INTEGER, int.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.JAVA_OBJECT, java.lang.Object.class, mappings); // ???
- addJDBCToJavaTypeMappingTo(Types.LONGVARBINARY, byte[].class, mappings);
- addJDBCToJavaTypeMappingTo(Types.LONGVARCHAR, java.lang.String.class, mappings);
- // not sure why this is defined in java.sql.Types
-// addJDBCMappingTo(Types.NULL, java.lang.Object.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.NUMERIC, java.math.BigDecimal.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.OTHER, java.lang.Object.class, mappings); // ???
- addJDBCToJavaTypeMappingTo(Types.REAL, float.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.REF, java.sql.Ref.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.SMALLINT, short.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.STRUCT, java.sql.Struct.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.TIME, java.sql.Time.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.TIMESTAMP, java.sql.Timestamp.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.TINYINT, byte.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.VARBINARY, byte[].class, mappings);
- addJDBCToJavaTypeMappingTo(Types.VARCHAR, java.lang.String.class, mappings);
- }
-
- private static void addJDBCToJavaTypeMappingTo(int jdbcTypeCode, Class<?> javaClass, HashMap<String, JDBCToJavaTypeMapping> mappings) {
- // check for duplicates
- JDBCType jdbcType = JDBCType.type(jdbcTypeCode);
- Object prev = mappings.put(jdbcType.getName(), buildJDBCToJavaTypeMapping(jdbcType, javaClass));
- if (prev != null) {
- throw new IllegalArgumentException("duplicate JDBC type: " + jdbcType.getName());
- }
- }
-
- private static JDBCToJavaTypeMapping buildJDBCToJavaTypeMapping(JDBCType jdbcType, Class<?> javaClass) {
- return new JDBCToJavaTypeMapping(jdbcType, new JavaType(javaClass));
- }
-
-
- // ********** Java => JDBC **********
-
- /**
- * Java => JDBC type mappings, keyed by Java class name (e.g. "java.lang.Object")
- */
- private static HashMap<String, JavaToJDBCTypeMapping> JAVA_TO_JDBC_TYPE_MAPPINGS; // pseudo 'final' - lazy-initialized
- private static final JDBCType DEFAULT_JDBC_TYPE = JDBCType.type(Types.VARCHAR); // TODO VARCHAR is the default?
-
-
- private static JavaToJDBCTypeMapping javaToJDBCTypeMapping(String className) {
- return javaToJDBCTypeMappings().get(className);
- }
-
- private static synchronized HashMap<String, JavaToJDBCTypeMapping> javaToJDBCTypeMappings() {
- if (JAVA_TO_JDBC_TYPE_MAPPINGS == null) {
- JAVA_TO_JDBC_TYPE_MAPPINGS = buildJavaToJDBCTypeMappings();
- }
- return JAVA_TO_JDBC_TYPE_MAPPINGS;
- }
-
- private static HashMap<String, JavaToJDBCTypeMapping> buildJavaToJDBCTypeMappings() {
- HashMap<String, JavaToJDBCTypeMapping> mappings = new HashMap<String, JavaToJDBCTypeMapping>();
- addJavaToJDBCTypeMappingsTo(mappings);
- return mappings;
- }
-
- /**
- * hard code the default mappings from the Java types to the
- * appropriate JDBC types
- * @see java.sql.Types
- * see "JDBC 3.0 Specification" Appendix B
- */
- private static void addJavaToJDBCTypeMappingsTo(HashMap<String, JavaToJDBCTypeMapping> mappings) {
- // primitives
- addJavaToJDBCTypeMappingTo(boolean.class, Types.BIT, mappings);
- addJavaToJDBCTypeMappingTo(byte.class, Types.TINYINT, mappings);
- addJavaToJDBCTypeMappingTo(double.class, Types.DOUBLE, mappings);
- addJavaToJDBCTypeMappingTo(float.class, Types.REAL, mappings);
- addJavaToJDBCTypeMappingTo(int.class, Types.INTEGER, mappings);
- addJavaToJDBCTypeMappingTo(long.class, Types.BIGINT, mappings);
- addJavaToJDBCTypeMappingTo(short.class, Types.SMALLINT, mappings);
-
- // reference classes
- addJavaToJDBCTypeMappingTo(java.lang.Boolean.class, Types.BIT, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Byte.class, Types.TINYINT, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Double.class, Types.DOUBLE, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Float.class, Types.REAL, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Integer.class, Types.INTEGER, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Long.class, Types.BIGINT, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Short.class, Types.SMALLINT, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.String.class, Types.VARCHAR, mappings);
- addJavaToJDBCTypeMappingTo(java.math.BigDecimal.class, Types.NUMERIC, mappings);
- addJavaToJDBCTypeMappingTo(java.net.URL.class, Types.DATALINK, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Array.class, Types.ARRAY, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Blob.class, Types.BLOB, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Clob.class, Types.CLOB, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Date.class, Types.DATE, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Ref.class, Types.REF, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Struct.class, Types.STRUCT, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Time.class, Types.TIME, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Timestamp.class, Types.TIMESTAMP, mappings);
-
- // arrays
- addJavaToJDBCTypeMappingTo(byte[].class, Types.VARBINARY, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Byte[].class, Types.VARBINARY, mappings);
- }
-
- private static void addJavaToJDBCTypeMappingTo(Class<?> javaClass, int jdbcTypeCode, HashMap<String, JavaToJDBCTypeMapping> mappings) {
- // check for duplicates
- Object prev = mappings.put(javaClass.getName(), buildJavaToJDBCTypeMapping(javaClass, jdbcTypeCode));
- if (prev != null) {
- throw new IllegalArgumentException("duplicate Java class: " + ((JavaToJDBCTypeMapping) prev).getJavaType().declaration());
- }
- }
-
- private static JavaToJDBCTypeMapping buildJavaToJDBCTypeMapping(Class<?> javaClass, int jdbcTypeCode) {
- return new JavaToJDBCTypeMapping(new JavaType(javaClass), JDBCType.type(jdbcTypeCode));
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private JDBCTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-
- // ********** member classes **********
-
- /**
- * JDBC => Java
- */
- private static class JDBCToJavaTypeMapping {
- private final JDBCType jdbcType;
- private final JavaType javaType;
-
- JDBCToJavaTypeMapping(JDBCType jdbcType, JavaType javaType) {
- super();
- this.jdbcType = jdbcType;
- this.javaType = javaType;
- }
-
- public JDBCType getJDBCType() {
- return this.jdbcType;
- }
-
- public JavaType getJavaType() {
- return this.javaType;
- }
-
- public boolean maps(int jdbcTypeCode) {
- return this.jdbcType.getCode() == jdbcTypeCode;
- }
-
- public boolean maps(String jdbcTypeName) {
- return this.jdbcType.getName().equals(jdbcTypeName);
- }
-
- public boolean maps(JDBCType type) {
- return this.jdbcType == type;
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- this.appendTo(sb);
- return sb.toString();
- }
-
- public void appendTo(StringBuffer sb) {
- this.jdbcType.appendTo(sb);
- sb.append(" => ");
- this.javaType.appendDeclarationTo(sb);
- }
-
- }
-
- /**
- * Java => JDBC
- */
- private static class JavaToJDBCTypeMapping {
- private final JavaType javaType;
- private final JDBCType jdbcType;
-
- JavaToJDBCTypeMapping(JavaType javaType, JDBCType jdbcType) {
- super();
- this.javaType = javaType;
- this.jdbcType = jdbcType;
- }
-
- public JavaType getJavaType() {
- return this.javaType;
- }
-
- public JDBCType getJDBCType() {
- return this.jdbcType;
- }
-
- public boolean maps(JavaType jt) {
- return this.javaType.equals(jt);
- }
-
- public boolean maps(String elementTypeName, int arrayDepth) {
- return this.javaType.equals(elementTypeName, arrayDepth);
- }
-
- public boolean maps(String javaClassName) {
- return this.javaType.describes(javaClassName);
- }
-
- public boolean maps(Class<?> javaClass) {
- return this.javaType.describes(javaClass);
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- this.appendTo(sb);
- return sb.toString();
- }
-
- public void appendTo(StringBuffer sb) {
- this.javaType.appendDeclarationTo(sb);
- sb.append(" => ");
- this.jdbcType.appendTo(sb);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCType.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCType.java
deleted file mode 100644
index fccea11fec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCType.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.io.Serializable;
-import java.lang.reflect.Field;
-import java.sql.Types;
-import java.text.Collator;
-
-/**
- * Associate the Java constant and the JDBC type name.
- * These are derived from java.sql.Types.
- *
- * @see java.sql.Types
- */
-public final class JDBCType
- implements Comparable<JDBCType>, Cloneable, Serializable
-{
-
- /**
- * the constant name (e.g. VARCHAR)
- */
- private final String name;
-
- /**
- * the JDBC code used by JDBC drivers
- */
- private final int code;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a JDBC type with the specified name and type code.
- * This is private because all the possible JDBC types are built and
- * stored in the static array TYPES.
- * @see #types()
- */
- private JDBCType(String name, int code) {
- super();
- this.name = name;
- this.code = code;
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the name of the type, as defined in java.sql.Types.
- */
- public String getName() {
- return this.name;
- }
-
-
- /**
- * Return the type code, as defined in java.sql.Types.
- */
- public int getCode() {
- return this.code;
- }
-
-
- // ********** printing and displaying **********
-
- public void appendTo(StringBuffer sb) {
- sb.append(this.name);
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append(ClassTools.shortClassNameForObject(this));
- sb.append('(');
- this.appendTo(sb);
- sb.append(')');
- return sb.toString();
- }
-
- @Override
- public JDBCType clone() {
- try {
- return (JDBCType) super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- public int compareTo(JDBCType type) {
- return Collator.getInstance().compare(this.name, type.name);
- }
-
-
- // ********** static stuff **********
-
- /**
- * all the JDBC type defined in java.sql.Types
- */
- private static JDBCType[] TYPES; // pseudo 'final' - lazy-initialized
-
-
- public synchronized static JDBCType[] types() {
- if (TYPES == null) {
- TYPES = buildTypes();
- }
- return TYPES;
- }
-
- /**
- * Return the JDBC type for the specified type code (e.g. Types.VARCHAR).
- * @see java.sql.Types
- */
- public static JDBCType type(int code) {
- JDBCType[] types = types();
- for (int i = types.length; i-- > 0; ) {
- if (types[i].getCode() == code) {
- return types[i];
- }
- }
- throw new IllegalArgumentException("invalid JDBC type code: " + code);
- }
-
- /**
- * Return the JDBC type for the specified type name (e.g. "VARCHAR").
- * @see java.sql.Types
- */
- public static JDBCType type(String name) {
- JDBCType[] types = types();
- for (int i = types.length; i-- > 0; ) {
- if (types[i].getName().equals(name)) {
- return types[i];
- }
- }
- throw new IllegalArgumentException("invalid JDBC type name: " + name);
- }
-
- /**
- * build up the JDBC types via reflection
- * @see java.sql.Types
- */
- private static JDBCType[] buildTypes() {
- Field[] fields = Types.class.getDeclaredFields();
- int len = fields.length;
- JDBCType[] types = new JDBCType[len];
- for (int i = len; i-- > 0; ) {
- String name = fields[i].getName();
- int code;
- try {
- code = ((Integer) fields[i].get(null)).intValue();
- } catch (IllegalAccessException ex) {
- throw new RuntimeException(ex); // shouldn't happen...
- }
- types[i] = new JDBCType(name, code);
- }
- return types;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JavaType.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JavaType.java
deleted file mode 100644
index 682cda61df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JavaType.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.text.Collator;
-
-/**
- * This class describes a Java type; i.e. its "element type"
- * and its "array depth". The element type is referenced by name,
- * allowing us to reference classes that are not (or cannot be) loaded.
- */
-public final class JavaType
- implements Comparable<JavaType>, Cloneable, Serializable
-{
-
- /**
- * store the type as a name, so we can reference classes
- * that are not loaded
- */
- private final String elementTypeName;
-
- /**
- * non-array types have an array depth of zero
- */
- private final int arrayDepth;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a Java type with the specified element type and array depth.
- */
- public JavaType(String elementTypeName, int arrayDepth) {
- super();
- if ((elementTypeName == null) || (elementTypeName.length() == 0)) {
- throw new IllegalArgumentException("The element type name is required.");
- }
- if (ClassTools.arrayDepthForClassNamed(elementTypeName) != 0) { // e.g. "[Ljava.lang.Object;"
- throw new IllegalArgumentException("The element type must not be an array: " + elementTypeName + '.');
- }
- if (arrayDepth < 0) {
- throw new IllegalArgumentException("The array depth must be greater than or equal to zero: " + arrayDepth + '.');
- }
- if (elementTypeName.equals(void.class.getName()) && (arrayDepth != 0)) {
- throw new IllegalArgumentException("'void' must have an array depth of zero: " + arrayDepth + '.');
- }
- this.elementTypeName = elementTypeName;
- this.arrayDepth = arrayDepth;
- }
-
- /**
- * Construct a Java type for the specified class.
- * The class name can be in one of the following forms:
- * java.lang.Object
- * int
- * java.util.Map$Entry
- * [Ljava.lang.Object;
- * [I
- * [Ljava.util.Map$Entry;
- */
- public JavaType(String javaClassName) {
- this(ClassTools.elementTypeNameForClassNamed(javaClassName), ClassTools.arrayDepthForClassNamed(javaClassName));
- }
-
- /**
- * Construct a Java type for the specified class.
- */
- public JavaType(Class<?> javaClass) {
- this(javaClass.getName());
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the name of the type's "element type".
- * A member type will have one or more '$' characters in its name.
- */
- public String getElementTypeName() {
- return this.elementTypeName;
- }
-
- /**
- * Return the type's "array depth".
- */
- public int getArrayDepth() {
- return this.arrayDepth;
- }
-
-
- // ********** queries **********
-
- public boolean isArray() {
- return this.arrayDepth > 0;
- }
-
- public boolean isPrimitive() {
- return (this.arrayDepth == 0) && ClassTools.classNamedIsNonReference(this.elementTypeName);
- }
-
- /**
- * Return the class corresponding to the type's element type and array depth.
- */
- public Class<?> javaClass() throws ClassNotFoundException {
- return ClassTools.classForTypeDeclaration(this.elementTypeName, this.arrayDepth);
- }
-
- /**
- * Return the version of the type's name that matches that
- * returned by java.lang.Class#getName()
- * (e.g. "[[J", "[Ljava.lang.Object;", "java.util.Map$Entry").
- */
- public String javaClassName() {
- return ClassTools.classNameForTypeDeclaration(this.elementTypeName, this.arrayDepth);
- }
-
-
- // ********** comparison **********
-
- public boolean equals(String otherElementTypeName, int otherArrayDepth) {
- return (this.arrayDepth == otherArrayDepth)
- && this.elementTypeName.equals(otherElementTypeName);
- }
-
- public boolean describes(String className) {
- return this.equals(ClassTools.elementTypeNameForClassNamed(className), ClassTools.arrayDepthForClassNamed(className));
- }
-
- public boolean describes(Class<?> javaClass) {
- return this.describes(javaClass.getName());
- }
-
- public boolean equals(JavaType other) {
- return this.equals(other.elementTypeName, other.arrayDepth);
- }
-
- @Override
- public boolean equals(Object o) {
- return (o instanceof JavaType) ? this.equals((JavaType) o) : false;
- }
-
- @Override
- public int hashCode() {
- return this.elementTypeName.hashCode() ^ this.arrayDepth;
- }
-
- public int compareTo(JavaType jt) {
- int x = Collator.getInstance().compare(this.elementTypeName, jt.elementTypeName);
- return (x != 0) ? x : (this.arrayDepth - jt.arrayDepth);
- }
-
-
- // ********** printing and displaying **********
-
- /**
- * Return the version of the type's name that can be used in source code:
- * "[[J" => "long[][]"
- * "java.util.Map$Entry" => "java.util.Map.Entry"
- */
- public String declaration() {
- if (this.arrayDepth == 0) {
- return this.elementTypeNameDeclaration();
- }
- StringBuffer sb = new StringBuffer(this.elementTypeName.length() + (2 * this.arrayDepth));
- this.appendDeclarationTo(sb);
- return sb.toString();
- }
-
- /**
- * Append the version of the type's name that can be used in source code:
- * "[[J" => "long[][]"
- * "java.util.Map$Entry" => "java.util.Map.Entry"
- */
- public void appendDeclarationTo(StringBuffer sb) {
- sb.append(this.elementTypeNameDeclaration());
- for (int i = this.arrayDepth; i-- > 0; ) {
- sb.append("[]");
- }
- }
-
- /**
- * Print the version of the type's name that can be used in source code:
- * "[[J" => "long[][]"
- * "java.util.Map$Entry" => "java.util.Map.Entry"
- */
- public void printDeclarationOn(PrintWriter pw) {
- pw.print(this.elementTypeNameDeclaration());
- for (int i = this.arrayDepth; i-- > 0; ) {
- pw.print("[]");
- }
- }
-
- /**
- * The '$' version of the name is used in Class.forName(String),
- * but the '.' verions of the name is used in source code.
- * Very irritating....
- */
- private String elementTypeNameDeclaration() {
- return this.elementTypeName.replace('$', '.');
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append(ClassTools.shortClassNameForObject(this));
- sb.append('(');
- this.appendDeclarationTo(sb);
- sb.append(')');
- return sb.toString();
- }
-
- @Override
- public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java
deleted file mode 100644
index be13c70dcf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-
-/**
- * Various helper methods for generating names.
- */
-public final class NameTools {
-
- /**
- * Given a "root" name and a set of existing names, generate a unique,
- * Java-legal name that is either the "root" name or some variation on
- * the "root" name (e.g. "root2", "root3",...).
- * The names are case-sensitive.
- */
- public static String uniqueJavaNameFor(String rootName, Iterator<String> existingNames) {
- Collection<String> existingNames2 = CollectionTools.set(existingNames);
- existingNames2.addAll(JAVA_RESERVED_WORDS_SET);
- return uniqueNameFor(rootName, existingNames2, rootName);
- }
-
- /**
- * Given a "root" name and a set of existing names, generate a unique,
- * Java-legal name that is either the "root" name or some variation on
- * the "root" name (e.g. "root2", "root3",...).
- * The names are case-sensitive.
- */
- public static String uniqueJavaNameFor(String rootName, Collection<String> existingNames) {
- Collection<String> existingNames2 = new HashSet<String>(existingNames);
- existingNames2.addAll(JAVA_RESERVED_WORDS_SET);
- return uniqueNameFor(rootName, existingNames2, rootName);
- }
-
- /**
- * Given a "root" name and a set of existing names, generate a unique
- * name that is either the "root" name or some variation on the "root"
- * name (e.g. "root2", "root3",...). The names are case-sensitive.
- */
- public static String uniqueNameFor(String rootName, Iterator<String> existingNames) {
- return uniqueNameFor(rootName, CollectionTools.set(existingNames));
- }
-
- /**
- * Given a "root" name and a set of existing names, generate a unique
- * name that is either the "root" name or some variation on the "root"
- * name (e.g. "root2", "root3",...). The names are case-sensitive.
- */
- public static String uniqueNameFor(String rootName, Collection<String> existingNames) {
- return uniqueNameFor(rootName, existingNames, rootName);
- }
-
- /**
- * Given a "root" name and a set of existing names, generate a unique
- * name that is either the "root" name or some variation on the "root"
- * name (e.g. "root2", "root3",...). The names are NOT case-sensitive.
- */
- public static String uniqueNameForIgnoreCase(String rootName, Iterator<String> existingNames) {
- return uniqueNameForIgnoreCase(rootName, CollectionTools.set(existingNames));
- }
-
- /**
- * Given a "root" name and a set of existing names, generate a unique
- * name that is either the "root" name or some variation on the "root"
- * name (e.g. "root2", "root3",...). The names are NOT case-sensitive.
- */
- public static String uniqueNameForIgnoreCase(String rootName, Collection<String> existingNames) {
- return uniqueNameFor(rootName, convertToLowerCase(existingNames), rootName.toLowerCase());
- }
-
- /**
- * use the suffixed "template" name to perform the comparisons, but RETURN
- * the suffixed "root" name; this allows case-insensitive comparisons
- * (i.e. the "template" name has been morphed to the same case as
- * the "existing" names, while the "root" name has not, but the "root" name
- * is what the client wants morphed to be unique)
- */
- private static String uniqueNameFor(String rootName, Collection<String> existingNames, String templateName) {
- if ( ! existingNames.contains(templateName)) {
- return rootName;
- }
- String uniqueName = templateName;
- for (int suffix = 2; true; suffix++) {
- if ( ! existingNames.contains(uniqueName + suffix)) {
- return rootName.concat(String.valueOf(suffix));
- }
- }
- }
-
- /**
- * Convert the specified collection of strings to a collection of the same
- * strings converted to lower case.
- */
- private static Collection<String> convertToLowerCase(Collection<String> strings) {
- Collection<String> result = new HashBag<String>(strings.size());
- for (String string : strings) {
- result.add(string.toLowerCase());
- }
- return result;
- }
-
- /**
- * Build a fully-qualified name for the specified database object.
- * Variations:
- * catalog.schema.name
- * catalog..name
- * schema.name
- * name
- */
- public static String buildQualifiedDatabaseObjectName(String catalog, String schema, String name) {
- if (name == null) {
- throw new IllegalArgumentException();
- }
- if ((catalog == null) && (schema == null)) {
- return name;
- }
-
- StringBuffer sb = new StringBuffer(100);
- if (catalog != null) {
- sb.append(catalog);
- sb.append('.');
- }
- if (schema != null) {
- sb.append(schema);
- }
- sb.append('.');
- sb.append(name);
- return sb.toString();
- }
-
- /**
- * The set of reserved words in the Java programming language.
- * These words cannot be used as identifiers (i.e. names).
- * http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html
- */
- public static final String[] JAVA_RESERVED_WORDS = new String[] {
- "abstract",
- "assert", // jdk 1.4
- "boolean",
- "break",
- "byte",
- "case",
- "catch",
- "char",
- "class",
- "const", // unused
- "continue",
- "default",
- "do",
- "double",
- "else",
- "enum", // jdk 5.0
- "extends",
- "false",
- "final",
- "finally",
- "float",
- "for",
- "goto", // unused
- "if",
- "implements",
- "import",
- "instanceof",
- "int",
- "interface",
- "long",
- "native",
- "new",
- "null",
- "package",
- "private",
- "protected",
- "public",
- "return",
- "short",
- "static",
- "strictfp", // jdk 1.2
- "super",
- "switch",
- "synchronized",
- "this",
- "throw",
- "throws",
- "transient",
- "true",
- "try",
- "void",
- "volatile",
- "while"
- };
-
- /**
- * The set of reserved words in the Java programming language.
- * These words cannot be used as identifiers (i.e. names).
- * http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html
- */
- public static final Set<String> JAVA_RESERVED_WORDS_SET = CollectionTools.set(JAVA_RESERVED_WORDS);
-
- /**
- * Return the set of Java programming language reserved words.
- * These words cannot be used as identifiers (i.e. names).
- * http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html
- */
- public static Iterator<String> javaReservedWords() {
- return new ArrayIterator<String>(JAVA_RESERVED_WORDS);
- }
-
- /**
- * Convert the specified string to a valid Java identifier
- * by substituting an underscore '_' for any invalid characters
- * in the string and capitalizing the string if it is a Java
- * reserved word.
- */
- public static String convertToJavaIdentifier(String string) {
- return convertToJavaIdentifier(string, '_');
- }
-
- /**
- * Convert the specified string to a valid Java identifier
- * by substituting the specified character for any invalid characters
- * in the string and capitalizing the string if it is a Java
- * reserved word.
- */
- public static String convertToJavaIdentifier(String string, char c) {
- if (string.length() == 0) {
- return string;
- }
- if (JAVA_RESERVED_WORDS_SET.contains(string)) {
- // a reserved words is a valid identifier, we just need to tweak it a bit
- return StringTools.capitalize(string);
- }
- return new String(convertToJavaIdentifierInternal(string.toCharArray(), c));
- }
-
- /**
- * Convert the specified string to a valid Java identifier
- * by substituting an underscore '_' for any invalid characters
- * in the string and capitalizing the string if it is a Java
- * reserved word.
- */
- public static char[] convertToJavaIdentifier(char[] string) {
- return convertToJavaIdentifier(string, '_');
- }
-
- /**
- * Convert the specified string to a valid Java identifier
- * by substituting the specified character for any invalid characters
- * in the string and capitalizing the string if it is a Java
- * reserved word.
- */
- public static char[] convertToJavaIdentifier(char[] string, char c) {
- int length = string.length;
- if (length == 0) {
- return string;
- }
- if (JAVA_RESERVED_WORDS_SET.contains(new String(string))) {
- // a reserved words is a valid identifier, we just need to tweak it a bit
- return StringTools.capitalize(string);
- }
- return convertToJavaIdentifierInternal(string, c);
- }
-
- private static char[] convertToJavaIdentifierInternal(char[] string, char c) {
- if ( ! Character.isJavaIdentifierStart(string[0])) {
- if ( ! Character.isJavaIdentifierStart(c)) {
- throw new IllegalArgumentException("invalid Java identifier start char: '" + c + "'");
- }
- string[0] = c;
- }
- if ( ! Character.isJavaIdentifierPart(c)) {
- throw new IllegalArgumentException("invalid Java identifier part char: '" + c + "'");
- }
- for (int i = string.length; i-- > 1; ) { // NB: end with 1
- if ( ! Character.isJavaIdentifierPart(string[i])) {
- string[i] = c;
- }
- }
- return string;
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private NameTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Range.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Range.java
deleted file mode 100644
index 4dbe48618a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Range.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * This simple container class simply puts a bit of semantics
- * around a pair of numbers.
- */
-public class Range
- implements Cloneable, Serializable
-{
- /** The starting index of the range. */
- public final int start;
-
- /** The ending index of the range. */
- public final int end;
-
- /**
- * The size can be negative if the ending index
- * is less than the starting index.
- */
- public final int size;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct with the specified start and end,
- * both of which are immutable.
- */
- public Range(int start, int end) {
- super();
- this.start = start;
- this.end = end;
- this.size = end - start + 1;
- }
-
- /**
- * Return whether the range includes the specified
- * index.
- */
- public boolean includes(int index) {
- return (this.start <= index) && (index <= this.end);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if ( ! (o instanceof Range)) {
- return false;
- }
- Range otherRange = (Range) o;
- return (this.start == otherRange.start)
- && (this.end == otherRange.end);
- }
-
- @Override
- public int hashCode() {
- return this.start ^ this.end;
- }
-
- @Override
- public Range clone() {
- try {
- return (Range) super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public String toString() {
- return "[" + this.start + ", " + this.end + ']';
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReverseComparator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReverseComparator.java
deleted file mode 100644
index 16ff4584d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReverseComparator.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.io.Serializable;
-import java.util.Comparator;
-
-/**
- * This comparator will reverse the order of the specified comparator.
- * If the comparator is null, the natural ordering of the objects will be used.
- */
-public class ReverseComparator<E extends Comparable<? super E>>
- implements Comparator<E>, Serializable
-{
- private final Comparator<E> comparator;
-
- public ReverseComparator() {
- this(null);
- }
-
- public ReverseComparator(Comparator<E> comparator) {
- super();
- this.comparator = comparator;
- }
-
- @SuppressWarnings("unchecked")
- public int compare(E e1, E e2) {
- return (this.comparator == null) ?
- e2.compareTo(e1)
- :
- this.comparator.compare(e2, e1);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java
deleted file mode 100644
index c42674eada..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * Simple, abstract implementation of <code>Filter</code>
- * that holds on to a criterion object that can be used in the
- * <code>accept(Object)</code> or <code>reject(Object)</code>
- * methods. Subclasses can override either of these methods,
- * depending on which is easier to implement. Note that at least
- * one of these methods <em>must</em> be overridden or
- * an infinite loop will occur. If both of them are overridden,
- * only the <code>accept(Object)</code> method will be used.
- * <p>
- * Simplifies the implementation of straightforward inner classes.
- * Here is an example of a filter that can be used by a
- * <code>FilteringIterator</code> to return only those strings
- * in the nested iterator start with "prefix":
- * <pre>
- * Filter<String> filter = new SimpleFilter<String>("prefix") {
- * public boolean accept(String o) {
- * return o.startsWith((String) criterion);
- * }
- * };
- * </pre>
- */
-public abstract class SimpleFilter<T, S>
- implements Filter<T>, Cloneable, Serializable
-{
- protected final S criterion;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * More useful constructor. The specified criterion can
- * be used by a subclass to "accept" or "reject" objects.
- */
- protected SimpleFilter(S criterion) {
- super();
- this.criterion = criterion;
- }
-
- /**
- * Construct a simple filter with a null criterion
- */
- protected SimpleFilter() {
- this(null);
- }
-
- /**
- * Return whether the the specified object should be "rejected".
- * The semantics of "rejected" is determined by the client.
- */
- protected boolean reject(T o) {
- return ! this.accept(o);
- }
-
- /**
- * Return whether the the specified object should be "accepted".
- * The semantics of "accepted" is determined by the client.
- */
- public boolean accept(T o) {
- return ! this.reject(o);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public SimpleFilter<T, S> clone() {
- try {
- return (SimpleFilter<T, S>) super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof SimpleFilter)) {
- return false;
- }
- SimpleFilter<?, ?> other = (SimpleFilter<?, ?>) o;
- return (this.criterion == null) ?
- (other.criterion == null) : this.criterion.equals(other.criterion);
- }
-
- @Override
- public int hashCode() {
- return (this.criterion == null) ? 0 : this.criterion.hashCode();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.criterion);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java
deleted file mode 100644
index 5d17b69a15..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java
+++ /dev/null
@@ -1,2101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Convenience methods related to the java.lang.String class.
- */
-public final class StringTools {
-
- /** carriage return */
- public static final String CR = System.getProperty("line.separator");
-
- /** double quote */
- public static final char QUOTE = '"';
-
-
-
- // ********** padding/truncating **********
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#pad(int)
- */
- public static String pad(String string, int length) {
- return pad(string, length, ' ');
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOn(int, Writer)
- */
- public static void padOn(String string, int length, Writer writer) {
- padOn(string, length, ' ', writer);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOn(int, StringBuffer)
- */
- public static void padOn(String string, int length, StringBuffer sb) {
- padOn(string, length, ' ', sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#pad(int, char)
- */
- public static String pad(String string, int length, char c) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- return string;
- }
- return padInternal(string, length, c);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOn(int, char, Writer)
- */
- public static void padOn(String string, int length, char c, Writer writer) {
- padOn(string.toCharArray(), length, c, writer);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOn(int, char, StringBuffer)
- */
- public static void padOn(String string, int length, char c, StringBuffer sb) {
- padOn(string.toCharArray(), length, c, sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#pad(int)
- */
- public static char[] pad(char[] string, int length) {
- return pad(string, length, ' ');
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOn(int, writer)
- */
- public static void padOn(char[] string, int length, Writer writer) {
- padOn(string, length, ' ', writer);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOn(int, StringBuffer)
- */
- public static void padOn(char[] string, int length, StringBuffer sb) {
- padOn(string, length, ' ', sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#pad(int, char)
- */
- public static char[] pad(char[] string, int length, char c) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- return string;
- }
- return padInternal(string, length, c);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOn(int, char, Writer)
- */
- public static void padOn(char[] string, int length, char c, Writer writer) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else {
- padOnInternal(string, length, c, writer);
- }
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOn(int, char, StringBuffer)
- */
- public static void padOn(char[] string, int length, char c, StringBuffer sb) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- padOnInternal(string, length, c, sb);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncate(int)
- */
- public static String padOrTruncate(String string, int length) {
- return padOrTruncate(string, length, ' ');
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncateOn(int, Writer)
- */
- public static void padOrTruncateOn(String string, int length, Writer writer) {
- padOrTruncateOn(string, length, ' ', writer);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncateOn(int, StringBuffer)
- */
- public static void padOrTruncateOn(String string, int length, StringBuffer sb) {
- padOrTruncateOn(string, length, ' ', sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncate(int, char)
- */
- public static String padOrTruncate(String string, int length, char c) {
- int stringLength = string.length();
- if (stringLength == length) {
- return string;
- }
- if (stringLength > length) {
- return string.substring(0, length);
- }
- return padInternal(string, length, c);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncateOn(int, char, Writer)
- */
- public static void padOrTruncateOn(String string, int length, char c, Writer writer) {
- padOrTruncateOn(string.toCharArray(), length, c, writer);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncateOn(int, char, StringBuffer)
- */
- public static void padOrTruncateOn(String string, int length, char c, StringBuffer sb) {
- padOrTruncateOn(string.toCharArray(), length, c, sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncate(int)
- */
- public static char[] padOrTruncate(char[] string, int length) {
- return padOrTruncate(string, length, ' ');
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncateOn(int, Writer)
- */
- public static void padOrTruncateOn(char[] string, int length, Writer writer) {
- padOrTruncateOn(string, length, ' ', writer);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncateOn(int, StringBuffer)
- */
- public static void padOrTruncate(char[] string, int length, StringBuffer sb) {
- padOrTruncateOn(string, length, ' ', sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncate(int, char)
- */
- public static char[] padOrTruncate(char[] string, int length, char c) {
- int stringLength = string.length;
- if (stringLength == length) {
- return string;
- }
- if (stringLength > length) {
- char[] result = new char[length];
- System.arraycopy(string, 0, result, 0, length);
- return result;
- }
- return padInternal(string, length, c);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncateOn(int, char, Writer)
- */
- public static void padOrTruncateOn(char[] string, int length, char c, Writer writer) {
- int stringLength = string.length;
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else if (stringLength > length) {
- writeStringOn(string, 0, length, writer);
- } else {
- padOnInternal(string, length, c, writer);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncateOn(int, char, StringBuffer)
- */
- public static void padOrTruncateOn(char[] string, int length, char c, StringBuffer sb) {
- int stringLength = string.length;
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string, 0, length);
- } else {
- padOnInternal(string, length, c, sb);
- }
- }
-
- /**
- * Pad the specified string without validating the parms.
- */
- private static String padInternal(String string, int length, char c) {
- return new String(padInternal(string.toCharArray(), length, c));
- }
-
- /**
- * Pad the specified string without validating the parms.
- */
- private static char[] padInternal(char[] string, int length, char c) {
- char[] result = new char[length];
- int stringLength = string.length;
- System.arraycopy(string, 0, result, 0, stringLength);
- Arrays.fill(result, stringLength, length, c);
- return result;
- }
-
- /**
- * Pad the specified string without validating the parms.
- */
- private static void padOnInternal(char[] string, int length, char c, Writer writer) {
- writeStringOn(string, writer);
- writeStringOn(CollectionTools.fill(new char[length - string.length], c), writer);
- }
-
- /**
- * Pad the specified string without validating the parms.
- */
- private static void padOnInternal(char[] string, int length, char c, StringBuffer sb) {
- sb.append(string);
- sb.append(CollectionTools.fill(new char[length - string.length], c));
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPad(int)
- */
- public static String zeroPad(String string, int length) {
- return frontPad(string, length, '0');
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOn(int, Writer)
- */
- public static void zeroPadOn(String string, int length, Writer writer) {
- frontPadOn(string, length, '0', writer);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOn(int, StringBuffer)
- */
- public static void zeroPadOn(String string, int length, StringBuffer sb) {
- frontPadOn(string, length, '0', sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPad(int, char)
- */
- public static String frontPad(String string, int length, char c) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- return string;
- }
- return frontPadInternal(string, length, c);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOn(int, char, Writer)
- */
- public static void frontPadOn(String string, int length, char c, Writer writer) {
- frontPadOn(string.toCharArray(), length, c, writer);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOn(int, char, StringBuffer)
- */
- public static void frontPadOn(String string, int length, char c, StringBuffer sb) {
- frontPadOn(string.toCharArray(), length, c, sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPad(int)
- */
- public static char[] zeroPad(char[] string, int length) {
- return frontPad(string, length, '0');
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOn(int, Writer)
- */
- public static void zeroPadOn(char[] string, int length, Writer writer) {
- frontPadOn(string, length, '0', writer);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOn(int, StringBuffer)
- */
- public static void zeroPadOn(char[] string, int length, StringBuffer sb) {
- frontPadOn(string, length, '0', sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPad(int, char)
- */
- public static char[] frontPad(char[] string, int length, char c) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- return string;
- }
- return frontPadInternal(string, length, c);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOn(int, char, Writer)
- */
- public static void frontPadOn(char[] string, int length, char c, Writer writer) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else {
- frontPadOnInternal(string, length, c, writer);
- }
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOn(int, char, StringBuffer)
- */
- public static void frontPadOn(char[] string, int length, char c, StringBuffer sb) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- frontPadOnInternal(string, length, c, sb);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncate(int)
- */
- public static String zeroPadOrTruncate(String string, int length) {
- return frontPadOrTruncate(string, length, '0');
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncateOn(int, Writer)
- */
- public static void zeroPadOrTruncateOn(String string, int length, Writer writer) {
- frontPadOrTruncateOn(string, length, '0', writer);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncateOn(int, StringBuffer)
- */
- public static void zeroPadOrTruncateOn(String string, int length, StringBuffer sb) {
- frontPadOrTruncateOn(string, length, '0', sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncate(int, char)
- */
- public static String frontPadOrTruncate(String string, int length, char c) {
- int stringLength = string.length();
- if (stringLength == length) {
- return string;
- }
- if (stringLength > length) {
- return string.substring(stringLength - length);
- }
- return frontPadInternal(string, length, c);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncateOn(int, char, Writer)
- */
- public static void frontPadOrTruncateOn(String string, int length, char c, Writer writer) {
- frontPadOrTruncateOn(string.toCharArray(), length, c, writer);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncateOn(int, char, StringBuffer)
- */
- public static void frontPadOrTruncateOn(String string, int length, char c, StringBuffer sb) {
- frontPadOrTruncateOn(string.toCharArray(), length, c, sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncate(int)
- */
- public static char[] zeroPadOrTruncate(char[] string, int length) {
- return frontPadOrTruncate(string, length, '0');
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncateOn(int, Writer)
- */
- public static void zeroPadOrTruncateOn(char[] string, int length, Writer writer) {
- frontPadOrTruncateOn(string, length, '0', writer);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncateOn(int, StringBuffer)
- */
- public static void zeroPadOrTruncateOn(char[] string, int length, StringBuffer sb) {
- frontPadOrTruncateOn(string, length, '0', sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncate(int, char)
- */
- public static char[] frontPadOrTruncate(char[] string, int length, char c) {
- int stringLength = string.length;
- if (stringLength == length) {
- return string;
- }
- if (stringLength > length) {
- char[] result = new char[length];
- System.arraycopy(string, stringLength - length, result, 0, length);
- return result;
- }
- return frontPadInternal(string, length, c);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncateOn(int, char, Writer)
- */
- public static void frontPadOrTruncateOn(char[] string, int length, char c, Writer writer) {
- int stringLength = string.length;
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else if (stringLength > length) {
- writeStringOn(string, stringLength - length, length, writer);
- } else {
- frontPadOnInternal(string, length, c, writer);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncateOn(int, char, StringBuffer)
- */
- public static void frontPadOrTruncateOn(char[] string, int length, char c, StringBuffer sb) {
- int stringLength = string.length;
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string, stringLength - length, length);
- } else {
- frontPadOnInternal(string, length, c, sb);
- }
- }
-
- /**
- * Front-pad the specified string without validating the parms.
- */
- private static String frontPadInternal(String string, int length, char c) {
- return new String(frontPadInternal(string.toCharArray(), length, c));
- }
-
- /**
- * Zero-pad the specified string without validating the parms.
- */
- private static char[] frontPadInternal(char[] string, int length, char c) {
- char[] result = new char[length];
- int stringLength = string.length;
- int padLength = length - stringLength;
- System.arraycopy(string, 0, result, padLength, stringLength);
- Arrays.fill(result, 0, padLength, c);
- return result;
- }
-
- /**
- * Pad the specified string without validating the parms.
- */
- private static void frontPadOnInternal(char[] string, int length, char c, Writer writer) {
- writeStringOn(CollectionTools.fill(new char[length - string.length], c), writer);
- writeStringOn(string, writer);
- }
-
- /**
- * Pad the specified string without validating the parms.
- */
- private static void frontPadOnInternal(char[] string, int length, char c, StringBuffer sb) {
- sb.append(CollectionTools.fill(new char[length - string.length], c));
- sb.append(string);
- }
-
-
- // ********** wrapping/quoting **********
-
- /**
- * Wrap the specified string with double quotes.
- */
- public static String quote(String string) {
- return wrap(string, QUOTE);
- }
-
- /**
- * Wrap the specified string with double quotes.
- */
- public static void quoteOn(String string, Writer writer) {
- wrapOn(string, QUOTE, writer);
- }
-
- /**
- * Wrap the specified string with double quotes.
- */
- public static void quoteOn(String string, StringBuffer sb) {
- wrapOn(string, QUOTE, sb);
- }
-
- /**
- * Wrap each of the specified strings with double quotes.
- */
- public static Iterator<String> quote(Iterator<String> strings) {
- return new TransformationIterator<String, String>(strings) {
- @Override
- protected String transform(String string) {
- return StringTools.quote(string);
- }
- };
- }
-
- /**
- * Wrap the specified string with the specified wrap; i.e. put a copy of
- * the wrap at the front and back of the resulting string.
- */
- public static String wrap(String string, char wrap) {
- return new String(wrap(string.toCharArray(), wrap));
- }
-
- /**
- * Wrap the specified string with the specified wrap; i.e. put a copy of
- * the wrap at the front and back of the resulting string.
- */
- public static void wrapOn(String string, char wrap, Writer writer) {
- wrapOn(string.toCharArray(), wrap, writer);
- }
-
- /**
- * Wrap the specified string with the specified wrap; i.e. put a copy of
- * the wrap at the front and back of the resulting string.
- */
- public static void wrapOn(String string, char wrap, StringBuffer sb) {
- wrapOn(string.toCharArray(), wrap, sb);
- }
-
- /**
- * Wrap each of the specified strings with the specified wrap; i.e. put a
- * copy of the wrap at the front and back of the resulting string.
- */
- public static Iterator<String> wrap(Iterator<String> strings, final char wrap) {
- return new TransformationIterator<String, String>(strings) {
- @Override
- protected String transform(String string) {
- return StringTools.wrap(string, wrap);
- }
- };
- }
-
- /**
- * Wrap the specified string with the specified wrap; i.e. put a copy of
- * the wrap at the front and back of the resulting string.
- */
- public static String wrap(String string, String wrap) {
- return new String(wrap(string.toCharArray(), wrap.toCharArray()));
- }
-
- /**
- * Wrap the specified string with the specified wrap; i.e. put a copy of
- * the wrap at the front and back of the resulting string.
- */
- public static void wrapOn(String string, String wrap, Writer writer) {
- wrapOn(string.toCharArray(), wrap.toCharArray(), writer);
- }
-
- /**
- * Wrap the specified string with the specified wrap; i.e. put a copy of
- * the wrap at the front and back of the resulting string.
- */
- public static void wrapOn(String string, String wrap, StringBuffer sb) {
- wrapOn(string.toCharArray(), wrap.toCharArray(), sb);
- }
-
- /**
- * Wrap each of the specified strings with the specified wrap; i.e. put a
- * copy of the wrap at the front and back of the resulting string.
- */
- public static Iterator<String> wrap(Iterator<String> strings, final String wrap) {
- return new TransformationIterator<String, String>(strings) {
- @Override
- protected String transform(String string) {
- return StringTools.wrap(string, wrap);
- }
- };
- }
-
- /**
- * Wrap the specified string with double quotes.
- */
- public static char[] quote(char[] string) {
- return wrap(string, QUOTE);
- }
-
- /**
- * Wrap the specified string with double quotes.
- */
- public static void quoteOn(char[] string, Writer writer) {
- wrapOn(string, QUOTE, writer);
- }
-
- /**
- * Wrap the specified string with double quotes.
- */
- public static void quoteOn(char[] string, StringBuffer sb) {
- wrapOn(string, QUOTE, sb);
- }
-
- /**
- * Wrap each of the specified strings with double quotes.
- */
- public static Iterator<char[]> quoteCharArrays(Iterator<char[]> strings) {
- return new TransformationIterator<char[], char[]>(strings) {
- @Override
- protected char[] transform(char[] string) {
- return StringTools.quote(string);
- }
- };
- }
-
- /**
- * Wrap the specified string with the specified wrap; i.e. put a copy of
- * the wrap at the front and back of the resulting string.
- */
- public static char[] wrap(char[] string, char wrap) {
- int len = string.length;
- char[] result = new char[len+2];
- result[0] = wrap;
- System.arraycopy(string, 0, result, 1, len);
- result[len+1] = wrap;
- return result;
- }
-
- /**
- * Wrap the specified string with the specified wrap; i.e. put a copy of
- * the wrap at the front and back of the resulting string.
- */
- public static void wrapOn(char[] string, char wrap, Writer writer) {
- writeCharOn(wrap, writer);
- writeStringOn(string, writer);
- writeCharOn(wrap, writer);
- }
-
- /**
- * Wrap the specified string with the specified wrap; i.e. put a copy of
- * the wrap at the front and back of the resulting string.
- */
- public static void wrapOn(char[] string, char wrap, StringBuffer sb) {
- sb.append(wrap);
- sb.append(string);
- sb.append(wrap);
- }
-
- /**
- * Wrap each of the specified strings with the specified wrap; i.e. put a
- * copy of the wrap at the front and back of the resulting string.
- */
- public static Iterator<char[]> wrapCharArrays(Iterator<char[]> strings, final char wrap) {
- return new TransformationIterator<char[], char[]>(strings) {
- @Override
- protected char[] transform(char[] string) {
- return StringTools.wrap(string, wrap);
- }
- };
- }
-
- /**
- * Wrap the specified string with the specified wrap; i.e. put a copy of
- * the wrap at the front and back of the resulting string.
- */
- public static char[] wrap(char[] string, char[] wrap) {
- int stringLength = string.length;
- int wrapLength = wrap.length;
- char[] result = new char[stringLength+(2*wrapLength)];
- System.arraycopy(wrap, 0, result, 0, wrapLength);
- System.arraycopy(string, 0, result, wrapLength, stringLength);
- System.arraycopy(wrap, 0, result, stringLength+wrapLength, wrapLength);
- return result;
- }
-
- /**
- * Wrap the specified string with the specified wrap; i.e. put a copy of
- * the wrap at the front and back of the resulting string.
- */
- public static void wrapOn(char[] string, char[] wrap, Writer writer) {
- writeStringOn(wrap, writer);
- writeStringOn(string, writer);
- writeStringOn(wrap, writer);
- }
-
- /**
- * Wrap the specified string with the specified wrap; i.e. put a copy of
- * the wrap at the front and back of the resulting string.
- */
- public static void wrapOn(char[] string, char[] wrap, StringBuffer sb) {
- sb.append(wrap);
- sb.append(string);
- sb.append(wrap);
- }
-
- /**
- * Wrap each of the specified strings with the specified wrap; i.e. put a
- * copy of the wrap at the front and back of the resulting string.
- */
- public static Iterator<char[]> wrapCharArrays(Iterator<char[]> strings, final char[] wrap) {
- return new TransformationIterator<char[], char[]>(strings) {
- @Override
- protected char[] transform(char[] string) {
- return StringTools.wrap(string, wrap);
- }
- };
- }
-
-
- // ********** removing characters **********
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and return the result.
- * String#removeFirstOccurrence(char)
- */
- public static String removeFirstOccurrence(String string, char c) {
- int index = string.indexOf(c);
- if (index == -1) {
- // character not found
- return string;
- }
- if (index == 0) {
- // character found at the front of string
- return string.substring(1);
- }
- int last = string.length() - 1;
- if (index == last) {
- // character found at the end of string
- return string.substring(0, last);
- }
- // character found somewhere in the middle of the string
- return string.substring(0, index).concat(string.substring(index + 1));
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and print the result on the specified stream.
- * String#removeFirstOccurrenceOn(char, Writer)
- */
- public static void removeFirstOccurrenceOn(String string, char c, Writer writer) {
- removeFirstOccurrenceOn(string.toCharArray(), c, writer);
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and print the result on the specified stream.
- * String#removeFirstOccurrenceOn(char, StringBuffer)
- */
- public static void removeFirstOccurrenceOn(String string, char c, StringBuffer sb) {
- removeFirstOccurrenceOn(string.toCharArray(), c, sb);
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and return the result.
- * String#removeFirstOccurrence(char)
- */
- public static char[] removeFirstOccurrence(char[] string, char c) {
- int index = CollectionTools.indexOf(string, c);
- if (index == -1) {
- // character not found
- return string;
- }
-
- int len = string.length - 1;
- char[] result = new char[len];
- if (index == 0) {
- // character found at the front of string
- System.arraycopy(string, 1, result, 0, len);
- } else if (index == len) {
- // character found at the end of string
- System.arraycopy(string, 0, result, 0, len);
- } else {
- // character found somewhere in the middle of the string
- System.arraycopy(string, 0, result, 0, index);
- System.arraycopy(string, index + 1, result, index, len - index);
- }
- return result;
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and print the result on the specified stream.
- * String#removeFirstOccurrenceOn(char, Writer)
- */
- public static void removeFirstOccurrenceOn(char[] string, char c, Writer writer) {
- int index = CollectionTools.indexOf(string, c);
- if (index == -1) {
- // character not found
- writeStringOn(string, writer);
- return;
- }
-
- int len = string.length - 1;
- if (index == 0) {
- // character found at the front of string
- writeStringOn(string, 1, len, writer);
- } else if (index == len) {
- // character found at the end of string
- writeStringOn(string, 0, len, writer);
- } else {
- // character found somewhere in the middle of the string
- writeStringOn(string, 0, index, writer);
- writeStringOn(string, index + 1, len - index, writer);
- }
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and print the result on the specified stream.
- * String#removeFirstOccurrenceOn(char, StringBuffer)
- */
- public static void removeFirstOccurrenceOn(char[] string, char c, StringBuffer sb) {
- int index = CollectionTools.indexOf(string, c);
- if (index == -1) {
- // character not found
- sb.append(string);
- return;
- }
-
- int len = string.length - 1;
- if (index == 0) {
- // character found at the front of string
- sb.append(string, 1, len);
- } else if (index == len) {
- // character found at the end of string
- sb.append(string, 0, len);
- } else {
- // character found somewhere in the middle of the string
- sb.append(string, 0, index);
- sb.append(string, index + 1, len - index);
- }
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and return the result.
- * String#removeAllOccurrences(char)
- */
- public static String removeAllOccurrences(String string, char c) {
- return new String(removeAllOccurrences(string.toCharArray(), c));
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and write the result to the specified stream.
- * String#removeAllOccurrencesOn(char, Writer)
- */
- public static void removeAllOccurrencesOn(String string, char c, Writer writer) {
- removeAllOccurrencesOn(string.toCharArray(), c, writer);
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and write the result to the specified stream.
- * String#removeAllOccurrencesOn(char, StringBuffer)
- */
- public static void removeAllOccurrencesOn(String string, char c, StringBuffer sb) {
- removeAllOccurrencesOn(string.toCharArray(), c, sb);
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and return the result.
- * String#removeAllOccurrences(char)
- */
- public static char[] removeAllOccurrences(char[] string, char c) {
- StringBuffer sb = new StringBuffer(string.length);
- removeAllOccurrencesOn(string, c, sb);
- int len = sb.length();
- char[] result = new char[len];
- sb.getChars(0, len, result, 0);
- return result;
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and write the result to the
- * specified writer.
- * String#removeAllOccurrencesOn(char, Writer)
- */
- public static void removeAllOccurrencesOn(char[] string, char c, Writer writer) {
- removeAllOccurrencesOnInternal(string, c, writer);
- }
-
- private static void removeAllOccurrencesOnInternal(char[] string, char c, Writer writer) {
- for (char d : string) {
- if (d != c) {
- writeCharOn(d, writer);
- }
- }
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and append the result to the
- * specified string buffer.
- * String#removeAllOccurrencesOn(char, StringBuffer)
- */
- public static void removeAllOccurrencesOn(char[] string, char c, StringBuffer sb) {
- for (char d : string) {
- if (d != c) {
- sb.append(d);
- }
- }
- }
-
- /**
- * Remove all the spaces from the specified string and return the result.
- * String#removeAllSpaces()
- */
- public static String removeAllSpaces(String string) {
- return removeAllOccurrences(string, ' ');
- }
-
-
- // ********** common prefix **********
-
- /**
- * Return the length of the common prefix shared by the specified strings.
- * String#commonPrefixLength(String)
- */
- public static int commonPrefixLength(String s1, String s2) {
- return commonPrefixLength(s1.toCharArray(), s2.toCharArray());
- }
-
- /**
- * Return the length of the common prefix shared by the specified strings.
- */
- public static int commonPrefixLength(char[] s1, char[] s2) {
- return commonPrefixLengthInternal(s1, s2, Math.min(s1.length, s2.length));
- }
-
- /**
- * Return the length of the common prefix shared by the specified strings;
- * but limit the length to the specified maximum.
- * String#commonPrefixLength(String, int)
- */
- public static int commonPrefixLength(String s1, String s2, int max) {
- return commonPrefixLength(s1.toCharArray(), s2.toCharArray(), max);
- }
-
- /**
- * Return the length of the common prefix shared by the specified strings;
- * but limit the length to the specified maximum.
- */
- public static int commonPrefixLength(char[] s1, char[] s2, int max) {
- return commonPrefixLengthInternal(s1, s2, Math.min(max, Math.min(s1.length, s2.length)));
- }
-
- /**
- * Return the length of the common prefix shared by the specified strings;
- * but limit the length to the specified maximum. Assume the specified
- * maximum is less than the lengths of the specified strings.
- */
- private static int commonPrefixLengthInternal(char[] s1, char[] s2, int max) {
- for (int i = 0; i < max; i++) {
- if (s1[i] != s2[i]) {
- return i;
- }
- }
- return max; // all the characters up to 'max' are the same
- }
-
-
- // ********** capitalization **********
-
- /**
- * no zero-length check or lower case check
- */
- private static char[] capitalizeInternal(char[] string) {
- string[0] = Character.toUpperCase(string[0]);
- return string;
- }
-
- /**
- * Modify and return the specified string with
- * its first letter capitalized.
- */
- public static char[] capitalize(char[] string) {
- if ((string.length == 0) || Character.isUpperCase(string[0])) {
- return string;
- }
- return capitalizeInternal(string);
- }
-
- /**
- * Return the specified string with its first letter capitalized.
- * String#capitalize()
- */
- public static String capitalize(String string) {
- if ((string.length() == 0) || Character.isUpperCase(string.charAt(0))) {
- return string;
- }
- return new String(capitalizeInternal(string.toCharArray()));
- }
-
- /**
- * no zero-length check or upper case check
- */
- private static void capitalizeOnInternal(char[] string, StringBuffer sb) {
- sb.append(Character.toUpperCase(string[0]));
- sb.append(string, 1, string.length - 1);
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter capitalized.
- */
- public static void capitalizeOn(char[] string, StringBuffer sb) {
- if (string.length == 0) {
- return;
- }
- if (Character.isUpperCase(string[0])) {
- sb.append(string);
- } else {
- capitalizeOnInternal(string, sb);
- }
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter capitalized.
- * String#capitalizeOn(StringBuffer)
- */
- public static void capitalizeOn(String string, StringBuffer sb) {
- if (string.length() == 0) {
- return;
- }
- if (Character.isUpperCase(string.charAt(0))) {
- sb.append(string);
- } else {
- capitalizeOnInternal(string.toCharArray(), sb);
- }
- }
-
- /**
- * no zero-length check or upper case check
- */
- private static void capitalizeOnInternal(char[] string, Writer writer) {
- writeCharOn(Character.toUpperCase(string[0]), writer);
- writeStringOn(string, 1, string.length - 1, writer);
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter capitalized.
- */
- public static void capitalizeOn(char[] string, Writer writer) {
- if (string.length == 0) {
- return;
- }
- if (Character.isUpperCase(string[0])) {
- writeStringOn(string, writer);
- } else {
- capitalizeOnInternal(string, writer);
- }
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter capitalized.
- * String#capitalizeOn(Writer)
- */
- public static void capitalizeOn(String string, Writer writer) {
- if (string.length() == 0) {
- return;
- }
- if (Character.isUpperCase(string.charAt(0))) {
- writeStringOn(string, writer);
- } else {
- capitalizeOnInternal(string.toCharArray(), writer);
- }
- }
-
- /**
- * no zero-length check or lower case check
- */
- private static char[] uncapitalizeInternal(char[] string) {
- string[0] = Character.toLowerCase(string[0]);
- return string;
- }
-
- private static boolean stringNeedNotBeUncapitalized(char[] string) {
- if (string.length == 0) {
- return true;
- }
- if (Character.isLowerCase(string[0])) {
- return true;
- }
- // if both the first and second characters are capitalized,
- // return the string unchanged
- if ((string.length > 1)
- && Character.isUpperCase(string[1])
- && Character.isUpperCase(string[0])){
- return true;
- }
- return false;
- }
-
- /**
- * Modify and return the specified string with its
- * first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- */
- public static char[] uncapitalize(char[] string) {
- if (stringNeedNotBeUncapitalized(string)) {
- return string;
- }
- return uncapitalizeInternal(string);
- }
-
- private static boolean stringNeedNotBeUncapitalized(String string) {
- if (string.length() == 0) {
- return true;
- }
- if (Character.isLowerCase(string.charAt(0))) {
- return true;
- }
- // if both the first and second characters are capitalized,
- // return the string unchanged
- if ((string.length() > 1)
- && Character.isUpperCase(string.charAt(1))
- && Character.isUpperCase(string.charAt(0))){
- return true;
- }
- return false;
- }
-
- /**
- * Return the specified string with its first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- * String#uncapitalize()
- */
- public static String uncapitalize(String string) {
- if (stringNeedNotBeUncapitalized(string)) {
- return string;
- }
- return new String(uncapitalizeInternal(string.toCharArray()));
- }
-
- /**
- * no zero-length check or lower case check
- */
- private static void uncapitalizeOnInternal(char[] string, StringBuffer sb) {
- sb.append(Character.toLowerCase(string[0]));
- sb.append(string, 1, string.length - 1);
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- */
- public static void uncapitalizeOn(char[] string, StringBuffer sb) {
- if (stringNeedNotBeUncapitalized(string)) {
- sb.append(string);
- } else {
- uncapitalizeOnInternal(string, sb);
- }
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- * String#uncapitalizeOn(StringBuffer)
- */
- public static void uncapitalizeOn(String string, StringBuffer sb) {
- if (stringNeedNotBeUncapitalized(string)) {
- sb.append(string);
- } else {
- uncapitalizeOnInternal(string.toCharArray(), sb);
- }
- }
-
- /**
- * no zero-length check or upper case check
- */
- private static void uncapitalizeOnInternal(char[] string, Writer writer) {
- writeCharOn(Character.toLowerCase(string[0]), writer);
- writeStringOn(string, 1, string.length - 1, writer);
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- */
- public static void uncapitalizeOn(char[] string, Writer writer) {
- if (stringNeedNotBeUncapitalized(string)) {
- writeStringOn(string, writer);
- } else {
- uncapitalizeOnInternal(string, writer);
- }
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- * String#uncapitalizeOn(Writer)
- */
- public static void uncapitalizeOn(String string, Writer writer) {
- if (stringNeedNotBeUncapitalized(string)) {
- writeStringOn(string, writer);
- } else {
- uncapitalizeOnInternal(string.toCharArray(), writer);
- }
- }
-
-
- // ********** #toString() helper methods **********
-
- /**
- * Build a "standard" #toString() result for the specified object
- * and additional information:
- * ClassName[00F3EE42] (add'l info)
- */
- public static String buildToStringFor(Object o, Object additionalInfo) {
- StringBuffer sb = new StringBuffer();
- buildSimpleToStringOn(o, sb);
- sb.append(" (");
- sb.append(additionalInfo);
- sb.append(')');
- return sb.toString();
- }
-
- /**
- * Build a "standard" simple #toString() result for the specified object:
- * ClassName[00F3EE42]
- */
- public static String buildToStringFor(Object o) {
- StringBuffer sb = new StringBuffer();
- buildSimpleToStringOn(o, sb);
- return sb.toString();
- }
-
- /**
- * Append a "standard" simple #toString() for the specified object to
- * the specified string buffer:
- * ClassName[00F3EE42]
- */
- public static void buildSimpleToStringOn(Object o, StringBuffer sb) {
- sb.append(ClassTools.toStringClassNameForObject(o));
- sb.append('[');
- // use System#identityHashCode(Object), since Object#hashCode() may be overridden
- sb.append(zeroPad(Integer.toHexString(System.identityHashCode(o)).toUpperCase(), 8));
- sb.append(']');
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether the specified string is null, empty, or contains
- * only whitespace characters.
- */
- public static boolean stringIsEmpty(String string) {
- if ((string == null) || (string.length() == 0)) {
- return true;
- }
- return stringIsEmptyInternal(string.toCharArray());
- }
-
- /**
- * Return whether the specified string is null, empty, or contains
- * only whitespace characters.
- */
- public static boolean stringIsEmpty(char[] string) {
- if ((string == null) || (string.length == 0)) {
- return true;
- }
- return stringIsEmptyInternal(string);
- }
-
- private static boolean stringIsEmptyInternal(char[] s) {
- for (int i = s.length; i-- > 0; ) {
- if ( ! Character.isWhitespace(s[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified strings are equal, ignoring case.
- * Check for nulls.
- */
- public static boolean stringsAreEqualIgnoreCase(String s1, String s2) {
- if ((s1 == null) && (s2 == null)) {
- return true; // both are null
- }
- if ((s1 == null) || (s2 == null)) {
- return false; // one is null but the other is not
- }
- return s1.equalsIgnoreCase(s2);
- }
-
- /**
- * Return whether the specified strings are equal, ignoring case.
- * Check for nulls.
- */
- public static boolean stringsAreEqualIgnoreCase(char[] s1, char[] s2) {
- if ((s1 == null) && (s2 == null)) {
- return true; // both are null
- }
- if ((s1 == null) || (s2 == null)) {
- return false; // one is null but the other is not
- }
- if (s1.length != s2.length) {
- return false;
- }
- for (int i = s1.length; i-- > 0; ) {
- if ( ! charactersAreEqualIgnoreCase(s1[i], s2[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified string starts with the specified prefix,
- * ignoring case.
- */
- public static boolean stringStartsWithIgnoreCase(char[] string, char[] prefix) {
- if (string.length < prefix.length) {
- return false;
- }
- for (int i = prefix.length; i-- > 0; ) {
- if ( ! charactersAreEqualIgnoreCase(string[i], prefix[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified string starts with the specified prefix,
- * ignoring case.
- */
- public static boolean stringStartsWithIgnoreCase(String string, String prefix) {
- return string.regionMatches(true, 0, prefix, 0, prefix.length());
- }
-
- /**
- * Return whether the specified characters are are equal, ignoring case.
- * @see java.lang.String#regionMatches(boolean, int, String, int, int)
- */
- public static boolean charactersAreEqualIgnoreCase(char c1, char c2) {
- // something about the Georgian alphabet requires us to check lower case also
- return (c1 == c2)
- || (Character.toUpperCase(c1) == Character.toUpperCase(c2))
- || (Character.toLowerCase(c1) == Character.toLowerCase(c2));
- }
-
- // ********** conversions **********
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static String convertCamelCaseToAllCaps(String camelCaseString) {
- return new String(convertCamelCaseToAllCaps(camelCaseString.toCharArray()));
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static char[] convertCamelCaseToAllCaps(char[] camelCaseString) {
- int len = camelCaseString.length;
- if (len == 0) {
- return camelCaseString;
- }
- StringBuffer sb = new StringBuffer(len * 2);
- convertCamelCaseToAllCapsOnInternal(camelCaseString, len, sb);
- return convertToCharArray(sb);
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static void convertCamelCaseToAllCapsOn(String camelCaseString, StringBuffer sb) {
- convertCamelCaseToAllCapsOn(camelCaseString.toCharArray(), sb);
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, StringBuffer sb) {
- int len = camelCaseString.length;
- if (len != 0) {
- convertCamelCaseToAllCapsOnInternal(camelCaseString, len, sb);
- }
- }
-
- private static void convertCamelCaseToAllCapsOnInternal(char[] camelCaseString, int len, StringBuffer sb) {
- char prev = 0; // assume 0 is not a valid char
- char c = 0;
- char next = camelCaseString[0];
- for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len!
- c = next;
- next = ((i == len) ? 0 : camelCaseString[i]);
- if (camelCaseWordBreak(prev, c, next)) {
- sb.append('_');
- }
- sb.append(Character.toUpperCase(c));
- prev = c;
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static void convertCamelCaseToAllCapsOn(String camelCaseString, Writer writer) {
- convertCamelCaseToAllCapsOn(camelCaseString.toCharArray(), writer);
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, Writer writer) {
- int len = camelCaseString.length;
- if (len != 0) {
- convertCamelCaseToAllCapsOnInternal(camelCaseString, len, writer);
- }
- }
-
- private static void convertCamelCaseToAllCapsOnInternal(char[] camelCaseString, int len, Writer writer) {
- char prev = 0; // assume 0 is not a valid char
- char c = 0;
- char next = camelCaseString[0];
- for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len!
- c = next;
- next = ((i == len) ? 0 : camelCaseString[i]);
- if (camelCaseWordBreak(prev, c, next)) {
- writeCharOn('_', writer);
- }
- writeCharOn(Character.toUpperCase(c), writer);
- prev = c;
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static String convertCamelCaseToAllCaps(String camelCaseString, int maxLength) {
- return new String(convertCamelCaseToAllCaps(camelCaseString.toCharArray(), maxLength));
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static char[] convertCamelCaseToAllCaps(char[] camelCaseString, int maxLength) {
- int len = camelCaseString.length;
- if ((len == 0) || (maxLength == 0)) {
- return camelCaseString;
- }
- StringBuffer sb = new StringBuffer(maxLength);
- convertCamelCaseToAllCapsOnInternal(camelCaseString, maxLength, len, sb);
- return convertToCharArray(sb);
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static void convertCamelCaseToAllCapsOn(String camelCaseString, int maxLength, StringBuffer sb) {
- convertCamelCaseToAllCapsOn(camelCaseString.toCharArray(), maxLength, sb);
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, int maxLength, StringBuffer sb) {
- int len = camelCaseString.length;
- if ((len != 0) && (maxLength != 0)) {
- convertCamelCaseToAllCapsOnInternal(camelCaseString, maxLength, len, sb);
- }
- }
-
- private static void convertCamelCaseToAllCapsOnInternal(char[] camelCaseString, int maxLength, int len, StringBuffer sb) {
- char prev = 0; // assume 0 is not a valid char
- char c = 0;
- char next = camelCaseString[0];
- for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len!
- c = next;
- next = ((i == len) ? 0 : camelCaseString[i]);
- if (camelCaseWordBreak(prev, c, next)) {
- sb.append('_');
- if (sb.length() == maxLength) {
- return;
- }
- }
- sb.append(Character.toUpperCase(c));
- if (sb.length() == maxLength) {
- return;
- }
- prev = c;
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static void convertCamelCaseToAllCapsOn(String camelCaseString, int maxLength, Writer writer) {
- convertCamelCaseToAllCapsOn(camelCaseString.toCharArray(), maxLength, writer);
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, int maxLength, Writer writer) {
- int len = camelCaseString.length;
- if ((len != 0) && (maxLength != 0)) {
- convertCamelCaseToAllCapsOnInternal(camelCaseString, maxLength, len, writer);
- }
- }
-
- private static void convertCamelCaseToAllCapsOnInternal(char[] camelCaseString, int maxLength, int len, Writer writer) {
- char prev = 0; // assume 0 is not a valid char
- char c = 0;
- char next = camelCaseString[0];
- int writerLength = 0;
- for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len!
- c = next;
- next = ((i == len) ? 0 : camelCaseString[i]);
- if (camelCaseWordBreak(prev, c, next)) {
- writeCharOn('_', writer);
- if (++writerLength == maxLength) {
- return;
- }
- }
- writeCharOn(Character.toUpperCase(c), writer);
- if (++writerLength == maxLength) {
- return;
- }
- prev = c;
- }
- }
-
- /**
- * Return whether the specified series of characters occur at
- * a "camel case" work break:
- * "*aa" -> false
- * "*AA" -> false
- * "*Aa" -> false
- * "AaA" -> false
- * "AAA" -> false
- * "aa*" -> false
- * "AaA" -> false
- * "aAa" -> true
- * "AA*" -> false
- * "AAa" -> true
- * where '*' == any char
- */
- private static boolean camelCaseWordBreak(char prev, char c, char next) {
- if (prev == 0) { // start of string
- return false;
- }
- if (Character.isLowerCase(c)) {
- return false;
- }
- if (Character.isLowerCase(prev)) {
- return true;
- }
- if (next == 0) { // end of string
- return false;
- }
- return Character.isLowerCase(next);
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "LargeProject"
- * Capitalize the first letter.
- */
- public static String convertUnderscoresToCamelCase(String underscoreString) {
- return new String(convertUnderscoresToCamelCase(underscoreString.toCharArray()));
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "LargeProject"
- * Capitalize the first letter.
- */
- public static char[] convertUnderscoresToCamelCase(char[] underscoreString) {
- return convertUnderscoresToCamelCase(underscoreString, true);
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static String convertUnderscoresToCamelCase(String underscoreString, boolean capitalizeFirstLetter) {
- return new String(convertUnderscoresToCamelCase(underscoreString.toCharArray(), capitalizeFirstLetter));
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static char[] convertUnderscoresToCamelCase(char[] underscoreString, boolean capitalizeFirstLetter) {
- int len = underscoreString.length;
- if (len == 0) {
- return underscoreString;
- }
- StringBuffer sb = new StringBuffer(len);
- convertUnderscoresToCamelCaseOnInternal(underscoreString, capitalizeFirstLetter, len, sb);
- return convertToCharArray(sb);
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static void convertUnderscoresToCamelCaseOn(String underscoreString, boolean capitalizeFirstLetter, StringBuffer sb) {
- convertUnderscoresToCamelCaseOn(underscoreString.toCharArray(), capitalizeFirstLetter, sb);
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static void convertUnderscoresToCamelCaseOn(char[] underscoreString, boolean capitalizeFirstLetter, StringBuffer sb) {
- int len = underscoreString.length;
- if (len != 0) {
- convertUnderscoresToCamelCaseOnInternal(underscoreString, capitalizeFirstLetter, len, sb);
- }
- }
-
- private static void convertUnderscoresToCamelCaseOnInternal(char[] underscoreString, boolean capitalizeFirstLetter, int len, StringBuffer sb) {
- char prev = 0;
- char c = 0;
- boolean first = true;
- for (int i = 0; i < len; i++) {
- prev = c;
- c = underscoreString[i];
- if (c == '_') {
- continue;
- }
- if (first) {
- first = false;
- if (capitalizeFirstLetter) {
- sb.append(Character.toUpperCase(c));
- } else {
- sb.append(Character.toLowerCase(c));
- }
- } else {
- if (prev == '_') {
- sb.append(Character.toUpperCase(c));
- } else {
- sb.append(Character.toLowerCase(c));
- }
- }
- }
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static void convertUnderscoresToCamelCaseOn(String underscoreString, boolean capitalizeFirstLetter, Writer writer) {
- convertUnderscoresToCamelCaseOn(underscoreString.toCharArray(), capitalizeFirstLetter, writer);
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static void convertUnderscoresToCamelCaseOn(char[] underscoreString, boolean capitalizeFirstLetter, Writer writer) {
- int len = underscoreString.length;
- if (len != 0) {
- convertUnderscoresToCamelCaseOnInternal(underscoreString, capitalizeFirstLetter, len, writer);
- }
- }
-
- private static void convertUnderscoresToCamelCaseOnInternal(char[] underscoreString, boolean capitalizeFirstLetter, int len, Writer writer) {
- char prev = 0;
- char c = 0;
- boolean first = true;
- for (int i = 0; i < len; i++) {
- prev = c;
- c = underscoreString[i];
- if (c == '_') {
- continue;
- }
- if (first) {
- first = false;
- if (capitalizeFirstLetter) {
- writeCharOn(Character.toUpperCase(c), writer);
- } else {
- writeCharOn(Character.toLowerCase(c), writer);
- }
- } else {
- if (prev == '_') {
- writeCharOn(Character.toUpperCase(c), writer);
- } else {
- writeCharOn(Character.toLowerCase(c), writer);
- }
- }
- }
- }
-
-
- // ********** convenience **********
-
- public static char[] convertToCharArray(StringBuffer sb) {
- int len = sb.length();
- char[] result = new char[len];
- sb.getChars(0, len, result, 0);
- return result;
- }
-
- /**
- * checked exceptions suck
- */
- private static void writeStringOn(char[] string, Writer writer) {
- try {
- writer.write(string);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * checked exceptions suck
- */
- private static void writeStringOn(char[] string, int off, int len, Writer writer) {
- try {
- writer.write(string, off, len);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * checked exceptions suck
- */
- private static void writeStringOn(String string, Writer writer) {
- try {
- writer.write(string);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * checked exceptions suck
- */
- private static void writeCharOn(char c, Writer writer) {
- try {
- writer.write(c);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private StringTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java
deleted file mode 100644
index 52c002487a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-/**
- * Used by various "pluggable" classes to transform objects.
- * Transform an object of type T1 to an object of type T2.
- */
-public interface Transformer<T1, T2> {
-
- /**
- * Return the transformed object.
- * The semantics of "transform" is determined by the
- * contract between the client and the server.
- */
- T2 transform(T1 o);
-
-
- final class Null<S1, S2> implements Transformer<S1, S2> {
- @SuppressWarnings("unchecked")
- public static final Transformer INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R1, R2> Transformer<R1, R2> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- // simply return the object, unchanged
- @SuppressWarnings("unchecked")
- public S2 transform(S1 o) {
- return (S2) o;
- }
- @Override
- public String toString() {
- return "Transformer.Null";
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/XMLStringEncoder.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/XMLStringEncoder.java
deleted file mode 100644
index fd637ebfa9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/XMLStringEncoder.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-
-/**
- * This encoder will replace any of a specified set of characters with an XML
- * "character reference": '/' => "&#x2f;"
- */
-public final class XMLStringEncoder {
-
- /** The set of characters to be converted into XML character references. */
- private final char[] chars;
-
- /** Cache the value of the highest character in the set above. */
- private final char maxChar;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Construct an encoder that converts the specified set of characters
- * into XML character references.
- */
- public XMLStringEncoder(char[] chars) {
- super();
- if (chars == null) {
- throw new NullPointerException();
- }
- // the ampersand must be included since it is the escape character
- if (CollectionTools.contains(chars, '&')) {
- this.chars = chars;
- } else {
- this.chars = CollectionTools.add(chars, '&');
- }
- this.maxChar = this.calculateMaxInvalidFileNameChar();
- }
-
- /**
- * Calculate the maximum value of the set of characters to be converted
- * into XML character references. This will be used to short-circuit the
- * search for a character in the set.
- * @see #charIsToBeEncoded(char)
- */
- private char calculateMaxInvalidFileNameChar() {
- char[] localChars = this.chars;
- char max = 0;
- for (int i = localChars.length; i-- > 0; ) {
- char c = localChars[i];
- if (max < c) {
- max = c;
- }
- }
- return max;
- }
-
-
- // ********** API **********
-
- /**
- * Return the specified string with any characters in the set
- * replaced with XML character references.
- */
- public String encode(String s) {
- int len = s.length();
- // allow for a few encoded characters
- StringBuffer sb = new StringBuffer(len + 20);
- for (int i = 0; i < len; i++) {
- this.appendCharacterTo(s.charAt(i), sb);
- }
- return sb.toString();
- }
-
- /**
- * Return the specified string with any XML character references
- * replaced by the characters themselves.
- */
- public String decode(String s) {
- StringBuffer sb = new StringBuffer(s.length());
- StringBuffer temp = new StringBuffer(); // performance tweak
- this.decodeTo(new StringReader(s), sb, temp);
- return sb.toString();
- }
-
-
- // ********** internal methods **********
-
- /**
- * Append the specified character to the string buffer,
- * converting it to an XML character reference if necessary.
- */
- private void appendCharacterTo(char c, StringBuffer sb) {
- if (this.charIsToBeEncoded(c)) {
- this.appendCharacterReferenceTo(c, sb);
- } else {
- sb.append(c);
- }
- }
-
- /**
- * Return whether the specified character is one of the characters
- * to be converted to XML character references.
- */
- private boolean charIsToBeEncoded(char c) {
- return (c <= this.maxChar) && CollectionTools.contains(this.chars, c);
- }
-
- /**
- * Append the specified character's XML character reference to the
- * specified string buffer (e.g. '/' => "&#x2f;").
- */
- private void appendCharacterReferenceTo(char c, StringBuffer sb) {
- sb.append("&#x");
- sb.append(Integer.toString(c, 16));
- sb.append(';');
- }
-
- private void decodeTo(Reader reader, StringBuffer sb, StringBuffer temp) {
- try {
- this.decodeTo_(reader, sb, temp);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private void decodeTo_(Reader reader, StringBuffer sb, StringBuffer temp) throws IOException {
- int c = reader.read();
- while (c != -1) {
- if (c == '&') {
- this.decodeCharacterReferenceTo(reader, sb, temp);
- } else {
- sb.append((char) c);
- }
- c = reader.read();
- }
- reader.close();
- }
-
- private void decodeCharacterReferenceTo(Reader reader, StringBuffer sb, StringBuffer temp) throws IOException {
- int c = reader.read();
- this.checkChar(c, '#');
- c = reader.read();
- this.checkChar(c, 'x');
-
- temp.setLength(0);
- c = reader.read();
- while (c != ';') {
- this.checkEndOfStream(c);
- temp.append((char) c);
- c = reader.read();
- }
- String charValue = temp.toString();
- if (charValue.length() == 0) {
- throw new IllegalStateException("missing numeric string");
- }
- sb.append((char) Integer.parseInt(charValue, 16));
- }
-
- private void checkChar(int c, int expected) {
- this.checkEndOfStream(c);
- if (c != expected) {
- throw new IllegalStateException("expected '" + (char) expected + "', but encountered '" + (char) c + "'");
- }
- }
-
- private void checkEndOfStream(int c) {
- if (c == -1) {
- throw new IllegalStateException("unexpected end of string");
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java
deleted file mode 100644
index 2874af48ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>ArrayIterator</code> provides an <code>Iterator</code>
- * for an array of objects of type E.
- */
-public class ArrayIterator<E>
- implements Iterator<E>
-{
- final E[] array; // private-protected
- int nextIndex; // private-protected
- private final int maxIndex;
-
- /**
- * Construct an iterator for the specified array.
- */
- public ArrayIterator(E... array) {
- this(array, 0, array.length);
- }
-
- /**
- * Construct an iterator for the specified array,
- * starting at the specified start index and continuing for
- * the specified length.
- */
- public ArrayIterator(E[] array, int start, int length) {
- if ((start < 0) || (start > array.length)) {
- throw new IllegalArgumentException("start: " + start);
- }
- if ((length < 0) || (length > array.length - start)) {
- throw new IllegalArgumentException("length: " + length);
- }
- this.array = array;
- this.nextIndex = start;
- this.maxIndex = start + length;
- }
-
- public boolean hasNext() {
- return this.nextIndex < this.maxIndex;
- }
-
- public E next() {
- if (this.hasNext()) {
- return this.array[this.nextIndex++];
- }
- throw new NoSuchElementException();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, CollectionTools.list(this.array));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java
deleted file mode 100644
index 5b70ed4721..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-/**
- * An <code>ArrayListIterator</code> provides a <code>ListIterator</code>
- * for an array of objects.
- *
- * The name might be a bit confusing:
- * This is a <code>ListIterator</code> for an <code>Array</code>;
- * <em>not</em> an <code>Iterator</code> for an <code>ArrayList</code>.
- */
-public class ArrayListIterator<E>
- extends ArrayIterator<E>
- implements ListIterator<E>
-{
- private final int minIndex;
-
- /**
- * Construct a list iterator for the specified array.
- */
- public ArrayListIterator(E... array) {
- this(array, 0, array.length);
- }
-
- /**
- * Construct a list iterator for the specified array,
- * starting at the specified start index and continuing for
- * the specified length.
- */
- public ArrayListIterator(E[] array, int start, int length) {
- super(array, start, length);
- this.minIndex = start;
- }
-
- public int nextIndex() {
- return this.nextIndex;
- }
-
- public int previousIndex() {
- return this.nextIndex - 1;
- }
-
- public boolean hasPrevious() {
- return this.nextIndex > this.minIndex;
- }
-
- public E previous() {
- if (this.hasPrevious()) {
- return this.array[--this.nextIndex];
- }
- throw new NoSuchElementException();
- }
-
- public void add(E e) {
- throw new UnsupportedOperationException();
- }
-
- public void set(E e) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return super.toString();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java
deleted file mode 100644
index 0f7594f115..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>ChainIterator</code> provides a pluggable <code>Iterator</code>
- * that loops over a chain of arbitrarily linked objects. The chain
- * should be null-terminated (i.e. a call to the <code>nextLink(Object)</code>
- * method should return <code>null</code> when it is passed the last
- * link of the chain).
- * To use, supply a starting link and supply a <code>Linker</code> or
- * subclass <code>ChainIterator</code> and override the
- * <code>nextLink(Object)</code> method.
- * The starting link will be the first object returned by the iterator.
- * If the starting link is <code>null</code>, the iterator will be empty.
- * Note that the iterator does not support <code>null</code> elements.
- */
-public class ChainIterator<E>
- implements Iterator<E>
-{
- private E nextLink;
- private final Linker<E> linker;
-
-
- /**
- * Construct an iterator with the specified starting link
- * and a linker that simply returns null, indicating the end of the chain.
- * Use this constructor if you want to override the
- * <code>nextLink(Object)</code> method instead of building
- * a <code>Linker</code>.
- */
- public ChainIterator(E startLink) {
- this(startLink, Linker.Null.<E>instance());
- }
-
- /**
- * Construct an iterator with the specified starting link
- * and linker.
- */
- public ChainIterator(E startLink, Linker<E> linker) {
- super();
- this.nextLink = startLink;
- this.linker = linker;
- }
-
- public boolean hasNext() {
- return this.nextLink != null;
- }
-
- public E next() {
- if (this.nextLink == null) {
- throw new NoSuchElementException();
- }
- E result = this.nextLink;
- this.nextLink = this.nextLink(this.nextLink);
- return result;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the next link in the chain.
- */
- protected E nextLink(E currentLink) {
- return this.linker.nextLink(currentLink);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.nextLink);
- }
-
-
- //********** inner classes **********
-
- /**
- * Used by <code>ChainIterator</code> to link
- * the elements in the chain.
- */
- public interface Linker<T> {
-
- /**
- * Return the next link in the chain.
- */
- T nextLink(T currentLink);
-
-
- final class Null<S> implements Linker<S> {
- @SuppressWarnings("unchecked")
- public static final Linker INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R> Linker<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- // simply return null, indicating the chain is ended
- public S nextLink(S currentLink) {
- return null;
- }
- @Override
- public String toString() {
- return "ChainIterator.Linker.Null";
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java
deleted file mode 100644
index a7df5c9b92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>CloneIterator</code> iterates over a copy of a collection,
- * allowing for concurrent access to the original collection.
- * <p>
- * The original collection passed to the <code>CloneIterator</code>'s
- * constructor should be synchronized; otherwise you run the risk of
- * a corrupted collection.
- * <p>
- * By default, a <code>CloneIterator</code> does not support the
- * <code>#remove()</code> operation; this is because it does not have
- * access to the original collection. But if the <code>CloneIterator</code>
- * is supplied with an <code>Mutator</code> it will delegate the
- * <code>#remove()</code> operation to the <code>Mutator</code>.
- * Alternatively, a subclass can override the <code>#remove(Object)</code>
- * method.
- */
-public class CloneIterator<E>
- implements Iterator<E>
-{
- private final Iterator<E> nestedIterator;
- private E current;
- private final Mutator<E> mutator;
- private boolean removeAllowed;
-
-
- // ********** constructors **********
-
- /**
- * Construct an iterator on a copy of the specified collection.
- * The <code>#remove()</code> method will not be supported,
- * unless a subclass overrides the <code>#remove(Object)</code>.
- */
- public CloneIterator(Collection<E> c) {
- this(c, Mutator.ReadOnly.<E>instance());
- }
-
- /**
- * Construct an iterator on a copy of the specified collection.
- * Use the specified mutator to remove objects from the
- * original collection.
- */
- @SuppressWarnings("unchecked")
- public CloneIterator(Collection<E> c, Mutator<E> mutator) {
- super();
- this.nestedIterator = new ArrayIterator<E>((E[]) c.toArray());
- this.current = null;
- this.mutator = mutator;
- this.removeAllowed = false;
- }
-
-
- // ********** Iterator implementation **********
-
- public boolean hasNext() {
- return this.nestedIterator.hasNext();
- }
-
- public E next() {
- this.current = this.nestedIterator.next();
- this.removeAllowed = true;
- return this.current;
- }
-
- public void remove() {
- if ( ! this.removeAllowed) {
- throw new IllegalStateException();
- }
- this.remove(this.current);
- this.removeAllowed = false;
- }
-
-
- // ********** internal methods **********
-
- /**
- * Remove the specified element from the original collection.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building an <code>Mutator</code>.
- */
- protected void remove(E e) {
- this.mutator.remove(e);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-
- //********** member interface **********
-
- /**
- * Used by <code>CloneIterator</code> to remove
- * elements from the original collection; since the iterator
- * does not have direct access to the original collection.
- */
- public interface Mutator<T> {
-
- /**
- * Remove the specified object from the original collection.
- */
- void remove(T current);
-
-
- final class ReadOnly<S> implements Mutator<S> {
- @SuppressWarnings("unchecked")
- public static final Mutator INSTANCE = new ReadOnly();
- @SuppressWarnings("unchecked")
- public static <R> Mutator<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private ReadOnly() {
- super();
- }
- // remove is not supported
- public void remove(Object current) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "CloneIterator.Mutator.ReadOnly";
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java
deleted file mode 100644
index 82d701b442..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>CloneListIterator</code> iterates over a copy of a list,
- * allowing for concurrent access to the original list.
- * <p>
- * The original list passed to the <code>CloneListIterator</code>'s
- * constructor should be synchronized; otherwise you run the risk of
- * a corrupted list.
- * <p>
- * By default, a <code>CloneListIterator</code> does not support the
- * modification operations; this is because it does not have
- * access to the original list. But if the <code>CloneListIterator</code>
- * is supplied with a <code>Mutator</code> it will delegate the
- * modification operations to the <code>Mutator</code>.
- * Alternatively, a subclass can override the modification methods.
- */
-public class CloneListIterator<E>
- implements ListIterator<E>
-{
- private final ListIterator<E> nestedListIterator;
- private int cursor;
- private String state;
- private final Mutator<E> mutator;
-
- private static final String UNKNOWN = "unknown";
- private static final String PREVIOUS = "previous";
- private static final String NEXT = "next";
-
-
- // ********** constructors **********
-
- /**
- * Construct a list iterator on a copy of the specified list.
- * The modification methods will not be supported,
- * unless a subclass overrides them.
- */
- public CloneListIterator(List<E> list) {
- this(list, Mutator.ReadOnly.<E>instance());
- }
-
- /**
- * Construct a list iterator on a copy of the specified list.
- * Use the specified list mutator to modify the original list.
- */
- @SuppressWarnings("unchecked")
- public CloneListIterator(List<E> list, Mutator<E> mutator) {
- super();
- // build a copy of the list and keep it in synch with original (if the mutator allows changes)
- // that way the nested list iterator will maintain some of our state
- this.nestedListIterator = CollectionTools.list((E[]) list.toArray()).listIterator();
- this.mutator = mutator;
- this.cursor = 0;
- this.state = UNKNOWN;
- }
-
-
- // ********** ListIterator implementation **********
-
- public boolean hasNext() {
- return this.nestedListIterator.hasNext();
- }
-
- public E next() {
- // allow the nested iterator to throw an exception before we modify the index
- E next = this.nestedListIterator.next();
- this.cursor++;
- this.state = NEXT;
- return next;
- }
-
- public void remove() {
- // allow the nested iterator to throw an exception before we modify the original list
- this.nestedListIterator.remove();
- if (this.state == PREVIOUS) {
- this.remove(this.cursor);
- } else {
- this.cursor--;
- this.remove(this.cursor);
- }
- }
-
- public int nextIndex() {
- return this.nestedListIterator.nextIndex();
- }
-
- public int previousIndex() {
- return this.nestedListIterator.previousIndex();
- }
-
- public boolean hasPrevious() {
- return this.nestedListIterator.hasPrevious();
- }
-
- public E previous() {
- // allow the nested iterator to throw an exception before we modify the index
- E previous = this.nestedListIterator.previous();
- this.cursor--;
- this.state = PREVIOUS;
- return previous;
- }
-
- public void add(E o) {
- // allow the nested iterator to throw an exception before we modify the original list
- this.nestedListIterator.add(o);
- this.add(this.cursor, o);
- this.cursor++;
- }
-
- public void set(E o) {
- // allow the nested iterator to throw an exception before we modify the original list
- this.nestedListIterator.set(o);
- if (this.state == PREVIOUS) {
- this.set(this.cursor, o);
- } else {
- this.set(this.cursor - 1, o);
- }
- }
-
-
- // ********** internal methods **********
-
- /**
- * Add the specified element to the original list.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a <code>Mutator</code>.
- */
- protected void add(int index, E o) {
- this.mutator.add(index, o);
- }
-
- /**
- * Remove the specified element from the original list.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a <code>Mutator</code>.
- */
- protected void remove(int index) {
- this.mutator.remove(index);
- }
-
- /**
- * Set the specified element in the original list.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a <code>Mutator</code>.
- */
- protected void set(int index, E o) {
- this.mutator.set(index, o);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-
- //********** member interface **********
-
- /**
- * Used by <code>CloneListIterator</code> to remove
- * elements from the original list; since the list iterator
- * does not have direct access to the original list.
- */
- public interface Mutator<T> {
-
- /**
- * Add the specified object to the original list.
- */
- void add(int index, T o);
-
- /**
- * Remove the specified object from the original list.
- */
- void remove(int index);
-
- /**
- * Set the specified object in the original list.
- */
- void set(int index, T o);
-
-
- final class ReadOnly<S> implements Mutator<S> {
- @SuppressWarnings("unchecked")
- public static final Mutator INSTANCE = new ReadOnly();
- @SuppressWarnings("unchecked")
- public static <R> Mutator<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private ReadOnly() {
- super();
- }
- // add is not supported
- public void add(int index, Object o) {
- throw new UnsupportedOperationException();
- }
- // remove is not supported
- public void remove(int index) {
- throw new UnsupportedOperationException();
- }
- // set is not supported
- public void set(int index, Object o) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "CloneListIterator.Mutator.ReadOnly";
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java
deleted file mode 100644
index 40ae0cb879..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>CompositeIterator</code> wraps a collection
- * of <code>Iterator</code>s and makes them appear to be a single
- * <code>Iterator</code>.
- */
-public class CompositeIterator<E>
- implements Iterator<E>
-{
- private final Iterator<? extends Iterator<? extends E>> iterators;
- private Iterator<? extends E> currentIterator;
- private Iterator<? extends E> lastIteratorToReturnNext;
-
-
- /**
- * Construct an iterator with the specified collection of iterators.
- */
- public CompositeIterator(Collection<? extends Iterator<? extends E>> iterators) {
- this(iterators.iterator());
- }
-
- /**
- * Construct an iterator with the specified collection of iterators.
- */
- public CompositeIterator(Iterator<? extends Iterator<? extends E>> iterators) {
- super();
- this.iterators = iterators;
- }
-
- /**
- * Construct an iterator with the specified object prepended
- * to the specified iterator.
- */
- @SuppressWarnings("unchecked")
- public CompositeIterator(E object, Iterator<? extends E> iterator) {
- this(new SingleElementIterator<E>(object), iterator);
- }
-
- /**
- * Construct an iterator with the specified object appended
- * to the specified iterator.
- */
- @SuppressWarnings("unchecked")
- public CompositeIterator(Iterator<? extends E> iterator, E object) {
- this(iterator, new SingleElementIterator<E>(object));
- }
-
- /**
- * Construct an iterator with the specified iterators.
- */
- public CompositeIterator(Iterator<? extends E>... iterators) {
- this(new ArrayIterator<Iterator<? extends E>>(iterators));
- }
-
- public boolean hasNext() {
- try {
- this.loadCurrentIterator();
- } catch (NoSuchElementException ex) {
- // this occurs if there are no iterators at all
- return false;
- }
- return this.currentIterator.hasNext();
- }
-
- public E next() {
- this.loadCurrentIterator();
- E result = this.currentIterator.next();
-
- // the statement above will throw a NoSuchElementException
- // if the current iterator is at the end of the line;
- // so if we get here, we can set 'lastIteratorToReturnNext'
- this.lastIteratorToReturnNext = this.currentIterator;
-
- return result;
- }
-
- public void remove() {
- if (this.lastIteratorToReturnNext == null) {
- // CompositeIterator#next() has never been called
- throw new IllegalStateException();
- }
- this.lastIteratorToReturnNext.remove();
- }
-
- /**
- * Load currentIterator with the first iterator that <code>hasNext()</code>
- * or the final iterator if all the elements have already been retrieved.
- */
- private void loadCurrentIterator() {
- if (this.currentIterator == null) {
- this.currentIterator = this.iterators.next();
- }
- while (( ! this.currentIterator.hasNext()) && this.iterators.hasNext()) {
- this.currentIterator = this.iterators.next();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterators);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java
deleted file mode 100644
index 324d3c2f68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>CompositeListIterator</code> wraps a list
- * of <code>ListIterator</code>s and makes them appear to be a single
- * <code>ListIterator</code>.
- */
-public class CompositeListIterator<E>
- implements ListIterator<E>
-{
- private final ListIterator<? extends ListIterator<E>> iterators;
- private ListIterator<E> nextIterator;
- private int nextIndex;
- /**
- * true if "next" was last returned; false if "previous" was last returned;
- * this determines the effect of remove(Object) on nextIndex
- */
- private boolean nextReturned;
- private ListIterator<E> lastIteratorToReturnElement;
-
-
- /**
- * Construct a list iterator with the specified list of list iterators.
- */
- public CompositeListIterator(List<? extends ListIterator<E>> iterators) {
- this(iterators.listIterator());
- }
-
- /**
- * Construct a list iterator with the specified list of list iterators.
- */
- public CompositeListIterator(ListIterator<? extends ListIterator<E>> iterators) {
- super();
- this.iterators = iterators;
- this.nextIndex = 0;
- this.nextReturned = false;
- }
-
- /**
- * Construct a list iterator with the specified object prepended
- * to the specified iterator.
- */
- @SuppressWarnings("unchecked")
- public CompositeListIterator(E object, ListIterator<E> iterator) {
- this(new SingleElementListIterator<E>(object), iterator);
- }
-
- /**
- * Construct a list iterator with the specified object appended
- * to the specified iterator.
- */
- @SuppressWarnings("unchecked")
- public CompositeListIterator(ListIterator<E> iterator, E object) {
- this(iterator, new SingleElementListIterator<E>(object));
- }
-
- /**
- * Construct a list iterator with the specified list iterators.
- */
- public CompositeListIterator(ListIterator<E>... iterators) {
- this(new ArrayListIterator<ListIterator<E>>(iterators));
- }
-
- public void add(E o) {
- this.checkNextIterator();
- this.nextIterator.add(o);
- this.nextIndex++;
- }
-
- public boolean hasNext() {
- try {
- this.loadNextIterator();
- } catch (NoSuchElementException ex) {
- // this occurs if there are no iterators at all
- return false;
- }
- return this.nextIterator.hasNext();
- }
-
- public boolean hasPrevious() {
- try {
- this.loadPreviousIterator();
- } catch (NoSuchElementException ex) {
- // this occurs if there are no iterators at all
- return false;
- }
- return this.nextIterator.hasPrevious();
- }
-
- public E next() {
- this.loadNextIterator();
- E result = this.nextIterator.next();
-
- // the statement above will throw a NoSuchElementException
- // if the current iterator is at the end of the line;
- // so if we get here, we can set the lastIteratorToReturnElement
- this.lastIteratorToReturnElement = this.nextIterator;
- this.nextIndex++;
- this.nextReturned = true;
-
- return result;
- }
-
- public int nextIndex() {
- return this.nextIndex;
- }
-
- public E previous() {
- this.loadPreviousIterator();
- E result = this.nextIterator.previous();
-
- // the statement above will throw a NoSuchElementException
- // if the current iterator is at the end of the line;
- // so if we get here, we can set the lastIteratorToReturnElement
- this.lastIteratorToReturnElement = this.nextIterator;
- this.nextIndex--;
- this.nextReturned = false;
-
- return result;
- }
-
- public int previousIndex() {
- return this.nextIndex - 1;
- }
-
- public void remove() {
- if (this.lastIteratorToReturnElement == null) {
- throw new IllegalStateException();
- }
- this.lastIteratorToReturnElement.remove();
- if (this.nextReturned) {
- // decrement the index because the "next" element has moved forward in the list
- this.nextIndex--;
- }
- }
-
- public void set(E e) {
- if (this.lastIteratorToReturnElement == null) {
- throw new IllegalStateException();
- }
- this.lastIteratorToReturnElement.set(e);
- }
-
- /**
- * Load nextIterator with the first iterator that <code>hasNext()</code>
- * or the final iterator if all the elements have already been retrieved.
- */
- private void loadNextIterator() {
- this.checkNextIterator();
- while (( ! this.nextIterator.hasNext()) && this.iterators.hasNext()) {
- this.nextIterator = this.iterators.next();
- }
- }
-
- /**
- * Load nextIterator with the first iterator that <code>hasPrevious()</code>
- * or the first iterator if all the elements have already been retrieved.
- */
- private void loadPreviousIterator() {
- this.checkNextIterator();
- while (( ! this.nextIterator.hasPrevious()) && this.iterators.hasPrevious()) {
- this.nextIterator = this.iterators.previous();
- }
- }
-
- /**
- * If nextIterator is null, load it with the first iterator.
- */
- private void checkNextIterator() {
- if (this.nextIterator == null) {
- this.nextIterator = this.iterators.next();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterators);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyEnumeration.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyEnumeration.java
deleted file mode 100644
index d1b989a946..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyEnumeration.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>NullEnumeration</code> is just that.
- */
-public final class EmptyEnumeration<E>
- implements Enumeration<E>
-{
-
- // singleton
- @SuppressWarnings("unchecked")
- private static EmptyEnumeration INSTANCE = new EmptyEnumeration();
-
- /**
- * Return the singleton.
- */
- @SuppressWarnings("unchecked")
- public static <T> Enumeration<T> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmptyEnumeration() {
- super();
- }
-
- public boolean hasMoreElements() {
- return false;
- }
-
- public E nextElement() {
- throw new NoSuchElementException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java
deleted file mode 100644
index b560d45fcf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>NullIterator</code> is just that.
- */
-public final class EmptyIterator<E>
- implements Iterator<E>
-{
-
- // singleton
- @SuppressWarnings("unchecked")
- private static EmptyIterator INSTANCE = new EmptyIterator();
-
- /**
- * Return the singleton.
- */
- @SuppressWarnings("unchecked")
- public static <T> Iterator<T> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmptyIterator() {
- super();
- }
-
- public boolean hasNext() {
- return false;
- }
-
- public E next() {
- throw new NoSuchElementException();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java
deleted file mode 100644
index 0863b24463..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>NullListIterator</code> is just that.
- */
-public final class EmptyListIterator<E>
- implements ListIterator<E>
-{
-
- // singleton
- @SuppressWarnings("unchecked")
- private static EmptyListIterator INSTANCE = new EmptyListIterator();
-
- /**
- * Return the singleton.
- */
- @SuppressWarnings("unchecked")
- public static <T> ListIterator<T> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmptyListIterator() {
- super();
- }
-
- public void add(E e) {
- throw new UnsupportedOperationException();
- }
-
- public boolean hasNext() {
- return false;
- }
-
- public boolean hasPrevious() {
- return false;
- }
-
- public E next() {
- throw new NoSuchElementException();
- }
-
- public int nextIndex() {
- return 0;
- }
-
- public E previous() {
- throw new NoSuchElementException();
- }
-
- public int previousIndex() {
- return -1;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- public void set(E e) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java
deleted file mode 100644
index a75710c4ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>EnumerationIterator</code> wraps an
- * <code>Enumeration</code> so that it can be treated like an
- * <code>Iterator</code>.
- */
-public class EnumerationIterator<E>
- implements Iterator<E>
-{
- private final Enumeration<? extends E> enumeration;
-
- /**
- * Construct an iterator that wraps the specified enumeration.
- */
- public EnumerationIterator(Enumeration<? extends E> enumeration) {
- this.enumeration = enumeration;
- }
-
- public boolean hasNext() {
- return this.enumeration.hasMoreElements();
- }
-
- public E next() {
- return this.enumeration.nextElement();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.enumeration);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java
deleted file mode 100644
index eb0c970933..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>FilteringIterator</code> wraps another <code>Iterator</code>
- * and uses a <code>Filter</code> to determine which elements in the
- * nested iterator are to be returned by calls to <code>next()</code>.
- * <p>
- * As an alternative to building a <code>Filter</code>, a subclass
- * of <code>FilteringIterator</code> can override the
- * <code>accept(Object)</code> method.
- * <p>
- * One, possibly undesirable, side-effect of using this iterator is that
- * the nested iterator's <code>next()</code> method will be invoked
- * <em>before</em> the filtered iterator's <code>next()</code>
- * method is invoked. This is because the "next" element must be
- * checked for whether it is to be accepted before the filtered iterator
- * can determine whether it has a "next" element (i.e. that the
- * <code>hasNext()</code> method should return <code>true</code>).
- * This also prevents a filtered iterator from supporting the optional
- * <code>remove()</code> method.
- */
-public class FilteringIterator<E>
- implements Iterator<E>
-{
- private final Iterator<?> nestedIterator;
- // trust that the filter is correct - i.e. it will only accept elements of type E
- @SuppressWarnings("unchecked")
- private final Filter filter;
- private E next;
- private boolean done;
-
-
- /**
- * Construct an iterator with the specified nested
- * iterator and a filter that simply accepts every object.
- * Use this constructor if you want to override the
- * <code>accept(Object)</code> method instead of building
- * a <code>Filter</code>.
- */
- public FilteringIterator(Iterator<?> nestedIterator) {
- this(nestedIterator, Filter.Null.instance());
- }
-
- /**
- * Construct an iterator with the specified nested
- * iterator and filter.
- */
- @SuppressWarnings("unchecked")
- public FilteringIterator(Iterator<?> nestedIterator, Filter filter) {
- super();
- this.nestedIterator = nestedIterator;
- this.filter = filter;
- this.loadNext();
- }
-
- public boolean hasNext() {
- return ! this.done;
- }
-
- public E next() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- E result = this.next;
- this.loadNext();
- return result;
- }
-
- /**
- * Because we need to pre-load the next element
- * to be returned, we cannot support the <code>remove()</code>
- * method.
- */
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Load next with the next valid entry from the nested
- * iterator. If there are none, next is set to <code>END</code>.
- */
- @SuppressWarnings("unchecked")
- private void loadNext() {
- this.done = true;
- while (this.nestedIterator.hasNext() && (this.done)) {
- Object o = this.nestedIterator.next();
- if (this.accept(o)) {
- // assume that if the object was accepted it is of type E
- this.next = (E) o;
- this.done = false;
- } else {
- this.next = null;
- this.done = true;
- }
- }
- }
-
- /**
- * Return whether the <code>FilteringIterator</code>
- * should return the specified next element from a call to the
- * <code>next()</code> method.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a <code>Filter</code>.
- */
- @SuppressWarnings("unchecked")
- protected boolean accept(Object o) {
- return this.filter.accept(o);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.nestedIterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java
deleted file mode 100644
index 1542cf16a2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>GraphIterator</code> is similar to a <code>TreeIterator</code>
- * except that it cannot be assumed that all nodes assume a strict tree
- * structure. For instance, in a tree, a node cannot be a descendent of
- * itself, but a graph may have a cyclical structure.
- *
- * A <code>GraphIterator</code> simplifies the traversal of a
- * graph of objects, where the objects' protocol(s) provides
- * a method for getting the next collection of nodes in the graph,
- * (or *neighbors*), but does not provide a method for getting *all*
- * of the nodes in the graph.
- * (e.g. a neighbor can return his neighbors, and those neighbors
- * can return their neighbors, which might also include the original
- * neighbor, but you only want to visit the original neighbor once.)
- * <p>
- * If a neighbor has already been visited (determined by using
- * <code>equals(Object)</code>), that neighbor is not visited again,
- * nor are the neighbors of that object.
- * <p>
- * It is up to the user of this class to ensure a *complete* graph.
- * <p>
- * To use, supply:<ul>
- * <li> either the initial node of the graph or an Iterator over an
- * initial collection of graph nodes
- * <li> a <code>MisterRogers</code> that tells who the neighbors are
- * of each node
- * (alternatively, subclass <code>GraphIterator</code>
- * and override the <code>neighbors(Object)</code> method)
- * </ul>
- * <p>
- * <code>remove()</code> is not supported. This method, if
- * desired, must be implemented by the user of this class.
- */
-public class GraphIterator<E>
- implements Iterator<E>
-{
- private final Collection<Iterator<? extends E>> iterators;
- private final Set<E> visitedNeighbors;
- private final MisterRogers<E> misterRogers;
-
- private Iterator<? extends E> currentIterator;
-
- private E nextNeighbor;
- private boolean done;
-
-
- /**
- * Construct an iterator with the specified collection of roots
- * and a mister rogers that simply returns an empty iterator
- * for each of the roots.
- * Use this constructor if you want to override the
- * <code>children(Object)</code> method instead of building
- * a <code>MisterRogers</code>.
- */
- public GraphIterator(E... roots) {
- this(new ArrayIterator<E>(roots));
- }
-
- /**
- * Construct an iterator with the specified collection of roots
- * and a mister rogers that simply returns an empty iterator
- * for each of the roots.
- * Use this constructor if you want to override the
- * <code>children(Object)</code> method instead of building
- * a <code>MisterRogers</code>.
- */
- public GraphIterator(Iterator<? extends E> roots) {
- this(roots, MisterRogers.Null.<E>instance());
- }
-
- /**
- * Construct an iterator with the specified root
- * and a mister rogers that simply returns an empty iterator
- * for the root.
- * Use this constructor if you want to override the
- * <code>children(Object)</code> method instead of building
- * a <code>MisterRogers</code>.
- */
- public GraphIterator(E root) {
- this(root, MisterRogers.Null.<E>instance());
- }
-
- /**
- * Construct an iterator with the specified root
- * and mister rogers.
- */
- public GraphIterator(E root, MisterRogers<E> misterRogers) {
- this(new SingleElementIterator<E>(root), misterRogers);
- }
-
- /**
- * Construct an iterator with the specified roots
- * and mister rogers.
- */
- public GraphIterator(Iterator<? extends E> roots, MisterRogers<E> misterRogers) {
- super();
- this.currentIterator = roots;
- // use a LinkedList since we will be pulling off the front and adding to the end
- this.iterators = new LinkedList<Iterator<? extends E>>();
- this.misterRogers = misterRogers;
- this.visitedNeighbors = new HashSet<E>();
- this.loadNextNeighbor();
- }
-
- /**
- * Load next neighbor with the next entry from the current iterator.
- * If the current iterator has none, load the next iterator.
- * If there are no more, the 'done' flag is set.
- */
- private void loadNextNeighbor() {
- if (this.currentIterator == EmptyIterator.instance()) {
- this.done = true;
- }
- else if (this.currentIterator.hasNext()) {
- E nextPossibleNeighbor = this.currentIterator.next();
- if (this.visitedNeighbors.contains(nextPossibleNeighbor)) {
- this.loadNextNeighbor(); // recurse
- } else {
- this.nextNeighbor = nextPossibleNeighbor;
- this.visitedNeighbors.add(nextPossibleNeighbor);
- this.iterators.add(this.neighbors(nextPossibleNeighbor));
- }
- }
- else {
- for (Iterator<? extends Iterator<? extends E>> stream = this.iterators.iterator(); ! this.currentIterator.hasNext() && stream.hasNext(); ) {
- this.currentIterator = stream.next();
- stream.remove();
- }
- if ( ! this.currentIterator.hasNext()) {
- this.currentIterator = EmptyIterator.instance();
- }
- this.loadNextNeighbor(); // recurse
- }
- }
-
- public boolean hasNext() {
- return ! this.done;
- }
-
- public E next() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- E next = this.nextNeighbor;
- this.loadNextNeighbor();
- return next;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the immediate neighbors of the specified object.
- */
- protected Iterator<? extends E> neighbors(E next) {
- return this.misterRogers.neighbors(next);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.currentIterator);
- }
-
-
- //********** inner classes **********
-
- /**
- * Used by <code>GraphIterator</code> to retrieve
- * the immediate neighbors of a node in the graph.
- * "These are the people in your neighborhood..."
- */
- public interface MisterRogers<T> {
-
- /**
- * Return the immediate neighbors of the specified object.
- */
- Iterator<? extends T> neighbors(T next);
-
-
- final class Null<S> implements MisterRogers<S> {
- @SuppressWarnings("unchecked")
- public static final MisterRogers INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R> MisterRogers<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- // return no neighbors
- public Iterator<S> neighbors(S next) {
- return EmptyIterator.instance();
- }
- @Override
- public String toString() {
- return "GraphIterator.MisterRogers.Null";
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/IteratorEnumeration.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/IteratorEnumeration.java
deleted file mode 100644
index 55a4f08b70..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/IteratorEnumeration.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>IteratorEnumeration</code> wraps an
- * <code>Iterator</code> so that it can be treated like an
- * <code>Enumeration</code>.
- */
-public class IteratorEnumeration<E>
- implements Enumeration<E>
-{
- private final Iterator<? extends E> iterator;
-
- /**
- * Construct an enumeration that wraps the specified iterator.
- */
- public IteratorEnumeration(Iterator<? extends E> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public boolean hasMoreElements() {
- return this.iterator.hasNext();
- }
-
- public E nextElement() {
- return this.iterator.next();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java
deleted file mode 100644
index 316aedcf63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>PeekableIterator</code> wraps another <code>Iterator</code>
- * and allows a <code>peek()</code> at the next element to be
- * returned by <code>next()</code>.
- * <p>
- * One, possibly undesirable, side-effect of using this iterator is that
- * the nested iterator's <code>next()</code> method will be invoked
- * <em>before</em> the peekable iterator's <code>next()</code>
- * method is invoked. This is because the "next" element must be
- * pre-loaded for the <code>peek()</code> method.
- * This also prevents a peekable iterator from supporting the optional
- * <code>remove()</code> method.
- */
-
-public class PeekableIterator<E>
- implements Iterator<E>
-{
- private final Iterator<? extends E> nestedIterator;
- private E next;
- private boolean done;
-
-
- /**
- * Construct a peekable iterator that wraps the specified nested
- * iterator.
- */
- public PeekableIterator(Iterator<? extends E> nestedIterator) {
- super();
- this.nestedIterator = nestedIterator;
- this.done = false;
- this.loadNext();
- }
-
- public boolean hasNext() {
- return ! this.done;
- }
-
- public E next() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- E result = this.next;
- this.loadNext();
- return result;
- }
-
- /**
- * Return the element that will be returned by the next call to the
- * <code>next()</code> method, without advancing past it.
- */
- public E peek() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- return this.next;
- }
-
- /**
- * Because we need to pre-load the next element
- * to be returned, we cannot support the <code>remove()</code>
- * method.
- */
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Load next with the next entry from the nested
- * iterator. If there are none, next is set to <code>END</code>.
- */
- private void loadNext() {
- if (this.nestedIterator.hasNext()) {
- this.next = this.nestedIterator.next();
- } else {
- this.next = null;
- this.done = true;
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.nestedIterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java
deleted file mode 100644
index df0a51333d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>ReadOnlyIterator</code> wraps another <code>Iterator</code>
- * and removes support for #remove().
- */
-public class ReadOnlyIterator<E>
- implements Iterator<E>
-{
- private final Iterator<? extends E> nestedIterator;
-
- /**
- * Construct an iterator on the specified collection that
- * disallows removes.
- */
- public ReadOnlyIterator(Collection<? extends E> c) {
- this(c.iterator());
- }
-
- /**
- * Construct an iterator with the specified nested iterator
- * and disallow removes.
- */
- public ReadOnlyIterator(Iterator<? extends E> nestedIterator) {
- super();
- this.nestedIterator = nestedIterator;
- }
-
- public boolean hasNext() {
- // delegate to the nested iterator
- return this.nestedIterator.hasNext();
- }
-
- public E next() {
- // delegate to the nested iterator
- return this.nestedIterator.next();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.nestedIterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java
deleted file mode 100644
index c3b2591f44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>ReadOnlyListIterator</code> wraps another
- * <code>ListIterator</code> and removes support for:
- * #remove()
- * #set(Object)
- * #add(Object)
- */
-public class ReadOnlyListIterator<E>
- implements ListIterator<E>
-{
- private final ListIterator<? extends E> nestedListIterator;
-
-
- /**
- * Construct an iterator on the specified list that
- * disallows removes, sets, and adds.
- */
- public ReadOnlyListIterator(List<? extends E> list) {
- this(list.listIterator());
- }
-
- /**
- * Construct an iterator on the specified list iterator that
- * disallows removes, sets, and adds.
- */
- public ReadOnlyListIterator(ListIterator<? extends E> nestedListIterator) {
- super();
- this.nestedListIterator = nestedListIterator;
- }
-
- public boolean hasNext() {
- // delegate to the nested iterator
- return this.nestedListIterator.hasNext();
- }
-
- public E next() {
- // delegate to the nested iterator
- return this.nestedListIterator.next();
- }
-
- public boolean hasPrevious() {
- // delegate to the nested iterator
- return this.nestedListIterator.hasPrevious();
- }
-
- public E previous() {
- // delegate to the nested iterator
- return this.nestedListIterator.previous();
- }
-
- public int nextIndex() {
- // delegate to the nested iterator
- return this.nestedListIterator.nextIndex();
- }
-
- public int previousIndex() {
- // delegate to the nested iterator
- return this.nestedListIterator.previousIndex();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- public void set(E o) {
- throw new UnsupportedOperationException();
- }
-
- public void add(E o) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.nestedListIterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java
deleted file mode 100644
index a8da8442ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>ResultSetIterator</code> wraps a <code>ResultSet</code>
- * and transforms its rows for client consumption. Subclasses can override
- * <code>#buildNext(ResultSet)</code> to build the expected object from
- * the current row of the result set.
- * <p>
- * To use, supply:<ul>
- * <li> a <code>ResultSet</code>
- * <li> an <code>Adapter</code> that converts a row in the <code>ResultSet</code>
- * into the desired object
- * (alternatively, subclass <code>ResultSetIterator</code>
- * and override the <code>buildNext(ResultSet)</code> method)
- * </ul>
- * <p>
- */
-public class ResultSetIterator<E>
- implements Iterator<E>
-{
- private final ResultSet resultSet;
- private final Adapter<E> adapter;
- private E next;
- private boolean done;
-
-
- /**
- * Construct an iterator on the specified result set that returns
- * the objects produced by the specified adapter.
- */
- public ResultSetIterator(ResultSet resultSet, Adapter<E> adapter) {
- super();
- this.resultSet = resultSet;
- this.adapter = adapter;
- this.done = false;
- this.next = this.buildNext();
- }
-
- /**
- * Construct an iterator on the specified result set that returns
- * the first object in each row of the result set.
- */
- public ResultSetIterator(ResultSet resultSet) {
- this(resultSet, Adapter.Default.<E>instance());
- }
-
- /**
- * Build the next object for the iterator to return.
- * Close the result set when we reach the end.
- */
- private E buildNext() {
- try {
- if (this.resultSet.next()) {
- return this.buildNext(this.resultSet);
- }
- this.resultSet.close();
- this.done = true;
- return null;
- } catch (SQLException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * By default, return the first object in the current row
- * of the result set. Any <code>SQLException</code>s will
- * be caught and wrapped in a <code>RuntimeException</code>.
- */
- protected E buildNext(ResultSet rs) throws SQLException {
- return this.adapter.buildNext(rs);
- }
-
- public boolean hasNext() {
- return ! this.done;
- }
-
- public E next() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- E temp = this.next;
- this.next = this.buildNext();
- return temp;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.resultSet);
- }
-
-
- // ********** interface **********
-
- /**
- * Used by <code>ResultSetIterator</code> to convert a
- * <code>ResultSet</code>'s current row into the next object
- * to be returned by the <code>Iterator</code>.
- */
- public interface Adapter<T> {
-
- /**
- * Return an object corresponding to the result set's
- * "current" row. Any <code>SQLException</code>s will
- * be caught and wrapped in a <code>RuntimeException</code>.
- * @see java.sql.ResultSet
- */
- T buildNext(ResultSet rs) throws SQLException;
-
-
- final class Default<S> implements Adapter<S> {
- @SuppressWarnings("unchecked")
- public static final Adapter INSTANCE = new Default();
- @SuppressWarnings("unchecked")
- public static <R> Adapter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- // return the first object in the current row of the result set
- @SuppressWarnings("unchecked")
- public S buildNext(ResultSet rs) throws SQLException {
- // result set columns are indexed starting with 1
- return (S) rs.getObject(1);
- }
- @Override
- public String toString() {
- return "ResultSetIterator.Adapter.Default";
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java
deleted file mode 100644
index 75fd9d80fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>SingleElementIterator</code> holds a single element
- * and returns it with the first call to <code>next()</code>, at
- * which point it will return <code>false</code> to any subsequent
- * call to <code>hasNext()</code>.
- * <p>
- * A <code>SingleElementIterator</code> is equivalent to the
- * <code>Iterator</code> returned by:
- * <code>java.util.Collections.singleton(element).iterator()</code>
- */
-public class SingleElementIterator<E>
- implements Iterator<E>
-{
- private final E element;
- private boolean done;
-
-
- /**
- * Construct an iterator that returns only the specified element.
- */
- public SingleElementIterator(E element) {
- super();
- this.element = element;
- this.done = false;
- }
-
- public boolean hasNext() {
- return ! this.done;
- }
-
- public E next() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- this.done = true;
- return this.element;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.element);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java
deleted file mode 100644
index 799cb72aef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>SingleElementListIterator</code> holds a single element
- * and returns it with the first call to <code>next()</code>, at
- * which point it will return <code>false</code> to any subsequent
- * call to <code>hasNext()</code>. Likewise, it will return <code>false</code>
- * to a call to <code>hasPrevious()</code> until a call to <code>next()</code>,
- * at which point a call to <code>previous()</code> will return the
- * single element.
- * <p>
- * A <code>SingleElementListIterator</code> is equivalent to the
- * <code>Iterator</code> returned by:
- * <code>java.util.Collections.singletonList(element).listIterator()</code>
- */
-public class SingleElementListIterator<E>
- implements ListIterator<E>
-{
- private final E element;
- private boolean hasNext;
-
-
- /**
- * Construct a list iterator that returns only the specified element.
- */
- public SingleElementListIterator(E element) {
- super();
- this.element = element;
- this.hasNext = true;
- }
-
- public boolean hasNext() {
- return this.hasNext;
- }
-
- public E next() {
- if (this.hasNext) {
- this.hasNext = false;
- return this.element;
- }
- throw new NoSuchElementException();
- }
-
- public int nextIndex() {
- return this.hasNext ? 0 : 1;
- }
-
- public boolean hasPrevious() {
- return ! this.hasNext;
- }
-
- public E previous() {
- if (this.hasNext) {
- throw new NoSuchElementException();
- }
- this.hasNext = true;
- return this.element;
- }
-
- public int previousIndex() {
- return this.hasNext ? -1 : 0;
- }
-
- public void add(E e) {
- throw new UnsupportedOperationException();
- }
-
- public void set(E e) {
- throw new UnsupportedOperationException();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.element);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java
deleted file mode 100644
index cffb59a2e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-
-
-/**
- * A <code>TransformationIterator</code> wraps another <code>Iterator</code>
- * and transforms its results for client consumption. To use, supply a
- * <code>Transformer</code> or subclass <code>TransformationIterator</code>
- * and override the <code>transform(Object)</code> method.
- * Objects of type E1 are transformed into objects of type E2;
- * i.e. the iterator returns objects of type E2.
- */
-public class TransformationIterator<E1, E2>
- implements Iterator<E2>
-{
- private final Iterator<? extends E1> nestedIterator;
- private final Transformer<E1, ? extends E2> transformer;
-
-
- /**
- * Construct an iterator with the specified nested iterator
- * and a transformer that simply returns the object, unchanged.
- * Use this constructor if you want to override the
- * <code>transform(Object)</code> method instead of building
- * a <code>Transformer</code>.
- */
- public TransformationIterator(Iterator<? extends E1> nestedIterator) {
- this(nestedIterator, Transformer.Null.<E1, E2>instance());
- }
-
- /**
- * Construct an iterator with the specified nested iterator
- * and transformer.
- */
- public TransformationIterator(Iterator<? extends E1> nestedIterator, Transformer<E1, ? extends E2> transformer) {
- super();
- this.nestedIterator = nestedIterator;
- this.transformer = transformer;
- }
-
- public boolean hasNext() {
- // delegate to the nested iterator
- return this.nestedIterator.hasNext();
- }
-
- public E2 next() {
- // transform the object returned by the nested iterator before returning it
- return this.transform(this.nestedIterator.next());
- }
-
- public void remove() {
- // delegate to the nested iterator
- this.nestedIterator.remove();
- }
-
- /**
- * Transform the specified object and return the result.
- */
- protected E2 transform(E1 next) {
- return this.transformer.transform(next);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.nestedIterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java
deleted file mode 100644
index 329f3ff142..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-
-/**
- * A <code>TransformationListIterator</code> wraps another <code>ListIterator</code>
- * and transforms it results for client consumption. To use, supply a
- * <code>Transformer</code> or subclass <code>TransformationIterator</code>
- * and override the <code>transform(Object)</code> method.
- *
- * The methods <code>set(Object)</code> and <code>add(Object)</code>
- * are left unsupported in this class.
- */
-public class TransformationListIterator<E1, E2>
- implements ListIterator<E2>
-{
- private final ListIterator<? extends E1> nestedIterator;
- private final Transformer<E1, ? extends E2> transformer;
-
-
- /**
- * Construct an iterator with the specified nested iterator
- * and a transformer that simply returns the object, unchanged.
- * Use this constructor if you want to override the
- * <code>transform(Object)</code> method instead of building
- * a <code>Transformer</code>.
- */
- public TransformationListIterator(ListIterator<? extends E1> nestedIterator) {
- this(nestedIterator, Transformer.Null.<E1, E2>instance());
- }
-
- /**
- * Construct an iterator with the specified nested iterator
- * and transformer.
- */
- public TransformationListIterator(ListIterator<? extends E1> nestedIterator, Transformer<E1, ? extends E2> transformer) {
- super();
- this.nestedIterator = nestedIterator;
- this.transformer = transformer;
- }
-
- public boolean hasNext() {
- // delegate to the nested iterator
- return this.nestedIterator.hasNext();
- }
-
- public E2 next() {
- // transform the object returned by the nested iterator before returning it
- return this.transform(this.nestedIterator.next());
- }
-
- public int nextIndex() {
- // delegate to the nested iterator
- return this.nestedIterator.nextIndex();
- }
-
- public boolean hasPrevious() {
- // delegate to the nested iterator
- return this.nestedIterator.hasPrevious();
- }
-
- public E2 previous() {
- // transform the object returned by the nested iterator before returning it
- return this.transform(this.nestedIterator.previous());
- }
-
- public int previousIndex() {
- // delegate to the nested iterator
- return this.nestedIterator.previousIndex();
- }
-
- public void add(E2 o) {
- throw new UnsupportedOperationException();
- }
-
- public void set(E2 o) {
- throw new UnsupportedOperationException();
- }
-
- public void remove() {
- // delegate to the nested iterator
- this.nestedIterator.remove();
- }
-
- /**
- * Transform the specified object and return the result.
- */
- protected E2 transform(E1 next) {
- return this.transformer.transform(next);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.nestedIterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java
deleted file mode 100644
index 432c54a7a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.internal.iterators;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>TreeIterator</code> simplifies the traversal of a
- * tree of objects, where the objects' protocol(s) provides
- * a method for getting the immediate children of the given
- * node but does not provide a method for getting all the
- * descendants (children, grandchildren, etc.) of the given node.
- * <p>
- * To use, supply:<ul>
- * <li> either the root element of the tree or, if the tree has
- * multiple roots, an <code>Iterator</code> over the set of roots
- * <li> a <code>Midwife</code> that delivers the children
- * of each child
- * (alternatively, subclass <code>TreeIterator</code>
- * and override the <code>children(Object)</code> method)
- * </ul>
- * <p>
- */
-public class TreeIterator<E>
- implements Iterator<E>
-{
- private final Collection<Iterator<? extends E>> iterators;
- private final Midwife<E> midwife;
- private Iterator<? extends E> currentIterator;
-
-
- /**
- * Construct an iterator with the specified collection of roots
- * and a midwife that simply returns an empty iterator
- * for each of the roots.
- * Use this constructor if you want to override the
- * <code>children(Object)</code> method instead of building
- * a <code>Midwife</code>.
- */
- public TreeIterator(Iterator<? extends E> roots) {
- this(roots, Midwife.Null.<E>instance());
- }
-
- /**
- * Construct an iterator with the specified root
- * and a midwife that simply returns an empty iterator
- * for the root.
- * Use this constructor if you want to override the
- * <code>children(Object)</code> method instead of building
- * a <code>Midwife</code>.
- */
- public TreeIterator(E root) {
- this(root, Midwife.Null.<E>instance());
- }
-
- /**
- * Construct an iterator with the specified root
- * and midwife.
- */
- public TreeIterator(E root, Midwife<E> midwife) {
- this(new SingleElementIterator<E>(root), midwife);
- }
-
- /**
- * Construct an iterator with the specified roots
- * and midwife.
- */
- public TreeIterator(Iterator<? extends E> roots, Midwife<E> midwife) {
- super();
- this.currentIterator = roots;
- // use a LinkedList since we will be pulling off the front and adding to the end
- this.iterators = new LinkedList<Iterator<? extends E>>();
- this.midwife = midwife;
- }
-
- public boolean hasNext() {
- if (this.currentIterator.hasNext()) {
- return true;
- }
- for (Iterator<? extends E> iterator : this.iterators) {
- if (iterator.hasNext()) {
- return true;
- }
- }
- return false;
- }
-
- public E next() {
- if (this.currentIterator.hasNext()) {
- return this.nextInternal();
- }
- for (Iterator<Iterator<? extends E>> stream = this.iterators.iterator(); stream.hasNext(); ) {
- this.currentIterator = stream.next();
- if (this.currentIterator.hasNext()) {
- break;
- }
- stream.remove();
- }
- return this.nextInternal();
- }
-
- /**
- * Fetch the children of the next node before returning it.
- */
- private E nextInternal() {
- E next = this.currentIterator.next();
- this.iterators.add(this.children(next));
- return next;
- }
-
- public void remove() {
- this.currentIterator.remove();
- }
-
- /**
- * Return the immediate children of the specified object.
- */
- protected Iterator<? extends E> children(E next) {
- return this.midwife.children(next);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.currentIterator);
- }
-
-
- //********** inner classes **********
-
- /**
- * Used by <code>TreeIterator</code> to retrieve
- * the immediate children of a node in the tree.
- */
- public interface Midwife<T> {
-
- /**
- * Return the immediate children of the specified object.
- */
- Iterator<? extends T> children(T o);
-
-
- final class Null<S> implements Midwife<S> {
- @SuppressWarnings("unchecked")
- public static final Midwife INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R> Midwife<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- // return no neighbors
- public Iterator<S> children(S next) {
- return EmptyIterator.instance();
- }
- @Override
- public String toString() {
- return "TreeIterator.Midwife.Null";
- }
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.classpath b/jpa/tests/org.eclipse.jpt.core.tests/.classpath
deleted file mode 100644
index db34e47716..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.core.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.project b/jpa/tests/org.eclipse.jpt.core.tests/.project
deleted file mode 100644
index 08395a8e86..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.core.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 88638b5d88..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:20 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index a2f6604d54..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:58:31 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.core.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index be27b103ef..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,25 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.core.tests
-Bundle-Version: 1.0.0
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.emf.ecore,
- org.eclipse.emf.ecore.xmi,
- org.eclipse.jdt.core,
- org.eclipse.jem,
- org.eclipse.jpt.core,
- org.eclipse.jpt.utility,
- org.eclipse.wst.common.emf,
- org.eclipse.wst.common.project.facet.core,
- org.junit
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jpt.core.tests.internal;x-internal:=true,
- org.eclipse.jpt.core.tests.internal.content.java.mappings;x-internal:=true,
- org.eclipse.jpt.core.tests.internal.jdtutility;x-internal:=true,
- org.eclipse.jpt.core.tests.internal.model;x-internal:=true,
- org.eclipse.jpt.core.tests.internal.platform;x-internal:=true,
- org.eclipse.jpt.core.tests.internal.projects;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/about.html b/jpa/tests/org.eclipse.jpt.core.tests/about.html
deleted file mode 100644
index 9e73bdabb6..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>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
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>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
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/build.properties b/jpa/tests/org.eclipse.jpt.core.tests/build.properties
deleted file mode 100644
index 9bf11f791e..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 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
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.core.tests/plugin.properties
deleted file mode 100644
index 6ebf8dbed1..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/plugin.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2007 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=Java Persistence API Core Tests
-providerName=Eclipse.org
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java
deleted file mode 100644
index baf5150f80..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.core.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.core.tests.internal.content.java.mappings.JptCoreContentJavaMappingsTests;
-import org.eclipse.jpt.core.tests.internal.jdtutility.JptCoreJdtUtilityTests;
-import org.eclipse.jpt.core.tests.internal.model.JptCoreModelTests;
-import org.eclipse.jpt.core.tests.internal.platform.JptCorePlatformTests;
-
-/**
- * Runs all JPT Core Tests
- */
-public class JptCoreTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCoreTests.class.getName());
- suite.addTest(JptCoreContentJavaMappingsTests.suite());
- suite.addTest(JptCoreModelTests.suite());
- suite.addTest(JptCoreJdtUtilityTests.suite());
- suite.addTest(JptCorePlatformTests.suite());
- return suite;
- }
-
- private JptCoreTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/ProjectUtility.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/ProjectUtility.java
deleted file mode 100644
index ac9e78a7d6..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/ProjectUtility.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.core.tests.internal;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-/**
- * Copied from org.eclipse.wst.common.tests
- */
-public class ProjectUtility {
- public static IProject[] getAllProjects() {
- IProject[] projects = new IProject[0];
- try {
- projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- } catch (AssertionFailedException ex) {
- // Catch Malformed tree exception that occurs from time to time...
- }
- return projects;
- }
- public static void deleteAllProjects() throws Exception {
- //closing projects and tread work in here is a hack because of a BeanInfo bug holding
- //onto jars loaded in another VM
-
-// for (int i = 0; i < projects.length; i++) {
-// if (projects[i].exists()) {
-// projects[i].close(null); // This should signal the extra VM to kill itself
-// }
-// }
- // Thread.yield(); // give the VM a chance to die
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
-
- public void run(IProgressMonitor monitor) {
- IProject[] projects = getAllProjects();
- for (int i = 0; i < projects.length; i++) {
- IProject project = projects[i];
- boolean success = false;
- Exception lastException = null;
- // Don't make 2^12 is about 4 seconds which is the max we
- // will wait for the VM to die
- for (int j = 0; j < 13 && !success; j++) {
- try {
- if (project.exists()) {
- project.delete(true, true, null);
- ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
- }
- success = true;
- } catch (Exception e) {
- lastException = e;
- if (project.exists()) {
- try {
- project.close(null);
- project.open(null);
- } catch (Exception e2) {
- // do nothing
- }
- }
- try {
- Thread.sleep((int) Math.pow(2, j));
- } catch (InterruptedException e1) {
- // do nothing
- } // if the VM isn't dead, try sleeping
- }
- }
- if (!success && lastException != null) {
- //Logger.getLogger().log("Problem while deleting: " + lastException.getMessage());
-// Assert.fail("Caught Exception=" +
-// lastException.getMessage() + " when deleting project=" + project.getName());
- }
- }
- }
- };
- try {
- ResourcesPlugin.getWorkspace().run(runnable, null);
- } catch (CoreException ce) {
- // do nothing
- }
- //verifyNoProjects();
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JavaEntityTests.java
deleted file mode 100644
index bbf7a950dd..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JavaEntityTests.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.core.tests.internal.content.java.mappings;
-
-import java.util.Iterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping;
-import org.eclipse.jpt.core.internal.content.java.mappings.JPA;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class JavaEntityTests extends JpaJavaTestCase {
-
- public JavaEntityTests(String name) {
- super(name);
- }
-
- private void createTestEntity1() throws CoreException {
- this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuffer sb) {
- sb.append("@Entity");
- }
- });
- this.synchPersistenceXml();
- }
-
- public void testGetName() throws Exception {
- this.createTestEntity1();
- IJavaTypeMapping typeMapping = this.javaPersistentTypeNamed(FULLY_QUALIFIED_TYPE_NAME).getMapping();
- assertEquals(TYPE_NAME, typeMapping.getName());
- }
-
-// TODO we can only execute 1 test for now...
-// public void testGetKey() throws Exception {
-// this.createTestEntity1();
-// IJavaTypeMapping typeMapping = this.javaPersistentTypeNamed(FULLY_QUALIFIED_TYPE_NAME).getMapping();
-// assertEquals(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, typeMapping.getKey());
-// }
-//
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JpaJavaTestCase.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JpaJavaTestCase.java
deleted file mode 100644
index ba028e9704..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JpaJavaTestCase.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.core.tests.internal.content.java.mappings;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.core.internal.IJpaFile;
-import org.eclipse.jpt.core.internal.content.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.content.java.JpaCompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.internal.synch.SynchronizeClassesJob;
-import org.eclipse.jpt.core.tests.internal.jdtutility.AnnotationTestCase;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.utility.internal.ClassTools;
-
-public abstract class JpaJavaTestCase extends AnnotationTestCase {
-
- public JpaJavaTestCase(String name) {
- super(name);
- }
-
- @Override
- protected TestJavaProject buildJavaProject(String projectName, boolean autoBuild) throws Exception {
- return new TestJpaProject(projectName, autoBuild);
- }
-
- protected TestJpaProject jpaProject() {
- return (TestJpaProject) this.javaProject;
- }
-
- protected JavaPersistentType javaPersistentTypeNamed(String typeName) {
- for (IJpaFile jpaFile : this.jpaProject().getJpaProject().jpaFiles(JavaCore.JAVA_SOURCE_CONTENT_TYPE)) {
- JpaCompilationUnit cu = (JpaCompilationUnit) jpaFile.getContent();
- for (JavaPersistentType pt : cu.getTypes()) {
- if (pt.fullyQualifiedTypeName().equals(typeName)) {
- return pt;
- }
- }
- }
- throw new IllegalArgumentException("missing type: " + typeName);
- }
-
- protected Type typeNamed(String typeName) {
- return this.javaPersistentTypeNamed(typeName).getType();
- }
-
- protected void synchPersistenceXml() {
- SynchronizeClassesJob job = new SynchronizeClassesJob(this.jpaProject().getProject().getFile("src/META-INF/persistence.xml"));
- ClassTools.executeMethod(job, "run", IProgressMonitor.class, new NullProgressMonitor());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JptCoreContentJavaMappingsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JptCoreContentJavaMappingsTests.java
deleted file mode 100644
index ddbb6bd094..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/content/java/mappings/JptCoreContentJavaMappingsTests.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.core.tests.internal.content.java.mappings;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptCoreContentJavaMappingsTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCoreContentJavaMappingsTests.class.getName());
-// suite.addTestSuite(JavaEntityTests.class);
- return suite;
- }
-
- private JptCoreContentJavaMappingsTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/AnnotationTestCase.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/AnnotationTestCase.java
deleted file mode 100644
index 87d6169bac..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/AnnotationTestCase.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.core.tests.internal.jdtutility;
-
-import java.util.Iterator;
-import java.util.List;
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jdt.core.dom.SimpleName;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jpt.core.internal.jdtutility.FieldAttribute;
-import org.eclipse.jpt.core.internal.jdtutility.MethodAttribute;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-
-/**
- * Provide an easy(?) way to build an annotated source file.
- * The type must be created by calling one of the #createType() methods
- * before calling any of the various helper methods (i.e. the type is *not*
- * created during #setUp()).
- */
-public abstract class AnnotationTestCase extends TestCase {
- protected TestJavaProject javaProject;
-
- protected static final String CR = System.getProperty("line.separator");
- protected static final String PROJECT_NAME = "AnnotationTestProject";
- protected static final String PACKAGE_NAME = "test";
- protected static final String TYPE_NAME = "AnnotationTestType";
- protected static final String FULLY_QUALIFIED_TYPE_NAME = PACKAGE_NAME + "." + TYPE_NAME;
- protected static final String FILE_NAME = TYPE_NAME + ".java";
-
- protected static final String[] EMPTY_STRING_ARRAY = new String[0];
-
-
- // ********** TestCase behavior **********
-
- protected AnnotationTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.javaProject = this.buildJavaProject(PROJECT_NAME, false); // false = no auto-build
- }
-
- protected TestJavaProject buildJavaProject(String projectName, boolean autoBuild) throws Exception {
- return new TestJavaProject(projectName, autoBuild); // false = no auto-build
- }
-
- @Override
- protected void tearDown() throws Exception {
-// this.dumpSource();
- this.javaProject.dispose();
- this.javaProject = null;
- super.tearDown();
- }
-
- protected void dumpSource() throws Exception {
- System.out.println("*** " + this.getName() + " ****");
- System.out.println(this.source());
- System.out.println();
- }
-
-
- // ********** type creation **********
-
- /**
- * create an un-annotated type
- */
- protected IType createTestType() throws CoreException {
- return this.createTestType(new DefaultAnnotationWriter());
- }
-
- /**
- * shortcut for simply adding an annotation to the 'id' field
- */
- protected IType createTestType(final String annotationImport, final String idFieldAnnotation) throws CoreException {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return (annotationImport == null) ?
- EmptyIterator.<String>instance()
- :
- new SingleElementIterator<String>(annotationImport);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuffer sb) {
- sb.append(idFieldAnnotation);
- }
- });
- }
-
- /**
- * shortcut for simply adding a fully-qualified annotation to the 'id' field
- */
- protected IType createTestType(final String idFieldAnnotation) throws CoreException {
- return this.createTestType(null, idFieldAnnotation);
- }
-
- protected IType createTestType(AnnotationWriter annotationWriter) throws CoreException {
- return this.javaProject.createType(PACKAGE_NAME, FILE_NAME, this.createSourceWriter(annotationWriter));
- }
-
- protected SourceWriter createSourceWriter(AnnotationWriter annotationWriter) {
- return new AnnotatedSourceWriter(annotationWriter);
- }
-
- protected void appendSourceTo(StringBuffer sb, AnnotationWriter annotationWriter) {
- sb.append(CR);
- for (Iterator<String> stream = annotationWriter.imports(); stream.hasNext(); ) {
- sb.append("import ");
- sb.append(stream.next());
- sb.append(";");
- sb.append(CR);
- }
- annotationWriter.appendTypeAnnotationTo(sb);
- sb.append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" {").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendIdFieldAnnotationTo(sb);
- sb.append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendNameFieldAnnotationTo(sb);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendGetIdMethodAnnotationTo(sb);
- sb.append(CR);
- sb.append(" public int getId() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendSetIdMethodAnnotationTo(sb);
- sb.append(CR);
- sb.append(" public void setId(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendGetNameMethodAnnotationTo(sb);
- sb.append(CR);
- sb.append(" public String getName() {").append(CR);
- sb.append(" return this.name;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- annotationWriter.appendSetNameMethodAnnotationTo(sb);
- sb.append(CR);
- sb.append(" public void setTestField(String testField) {").append(CR);
- sb.append(" this.testField = testField;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
-
-
- // ********** queries **********
-
- protected IType jdtType() throws JavaModelException {
- return this.javaProject.findType(FULLY_QUALIFIED_TYPE_NAME);
- }
-
- protected Type testType() throws JavaModelException {
- return new Type(this.jdtType());
- }
-
- protected FieldAttribute idField() throws JavaModelException {
- return this.fieldNamed("id");
- }
-
- protected FieldAttribute nameField() throws JavaModelException {
- return this.fieldNamed("name");
- }
-
- protected FieldAttribute fieldNamed(String fieldName) throws JavaModelException {
- return new FieldAttribute(this.jdtType().getField(fieldName));
- }
-
- protected MethodAttribute idGetMethod() throws JavaModelException {
- return this.methodNamed("getId");
- }
-
- protected MethodAttribute nameGetMethod() throws JavaModelException {
- return this.methodNamed("getName");
- }
-
- protected MethodAttribute methodNamed(String methodName) throws JavaModelException {
- return this.method(methodName, EMPTY_STRING_ARRAY);
- }
-
- protected MethodAttribute method(String methodName, String[] parameterTypeSignatures) throws JavaModelException {
- return new MethodAttribute(this.jdtType().getMethod(methodName, parameterTypeSignatures));
- }
-
- protected String source() throws JavaModelException {
- return this.jdtType().getOpenable().getBuffer().getContents();
- }
-
-
- // ********** test validation **********
-
- protected void assertSourceContains(String s) throws JavaModelException {
- String source = this.source();
- boolean found = source.indexOf(s) > -1;
- if ( ! found) {
- String msg = "source does not contain the expected string: " + s + " (see System console)";
- System.out.println("*** " + this.getName() + " ****");
- System.out.println(msg);
- System.out.println(source);
- System.out.println();
- fail(msg);
- }
- }
-
- protected void assertSourceDoesNotContain(String s) throws JavaModelException {
- String source = this.source();
- int pos = source.indexOf(s);
- if (pos != -1) {
- String msg = "unexpected string in source (position: " + pos + "): " + s + " (see System console)";
- System.out.println("*** " + this.getName() + " ****");
- System.out.println(msg);
- System.out.println(source);
- System.out.println();
- fail(msg);
- }
- }
-
-
- // ********** manipulate annotations **********
-
- /**
- * Return the *first* member value pair for the specified annotation element
- * with the specified name.
- * Return null if the annotation has no such element.
- */
- protected MemberValuePair memberValuePair(NormalAnnotation annotation, String elementName) {
- for (MemberValuePair pair : this.values(annotation)) {
- if (pair.getName().getFullyQualifiedName().equals(elementName)) {
- return pair;
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- protected List<MemberValuePair> values(NormalAnnotation na) {
- return na.values();
- }
-
- /**
- * check for null member value pair
- */
- protected Expression valueInternal(MemberValuePair pair) {
- return (pair == null) ? null : pair.getValue();
- }
-
- /**
- * Return the value of the *first* annotation element
- * with the specified name.
- * Return null if the annotation has no such element.
- */
- protected Expression annotationElementValue(NormalAnnotation annotation, String elementName) {
- return this.valueInternal(this.memberValuePair(annotation, elementName));
- }
-
- /**
- * Return the value of the *first* annotation element
- * with the specified name.
- * Return null if the annotation has no such element.
- */
- protected Expression annotationElementValue(SingleMemberAnnotation annotation, String elementName) {
- return elementName.equals("value") ? annotation.getValue() : null;
- }
-
- /**
- * Return the value of the *first* annotation element
- * with the specified name.
- * Return null if the annotation has no such element.
- * (An element name of "value" will return the value of a single
- * member annotation.)
- */
- protected Expression annotationElementValue(Annotation annotation, String elementName) {
- if (annotation.isNormalAnnotation()) {
- return this.annotationElementValue((NormalAnnotation) annotation, elementName);
- }
- if (annotation.isSingleMemberAnnotation()) {
- return this.annotationElementValue((SingleMemberAnnotation) annotation, elementName);
- }
- return null;
- }
-
- /**
- * Build a number literal and set its initial value to the specified literal.
- */
- protected NumberLiteral newNumberLiteral(AST ast, int value) {
- return ast.newNumberLiteral(Integer.toString(value));
- }
-
- /**
- * Build a string literal and set its initial value.
- */
- protected StringLiteral newStringLiteral(AST ast, String value) {
- StringLiteral stringLiteral = ast.newStringLiteral();
- stringLiteral.setLiteralValue(value);
- return stringLiteral;
- }
-
- protected MemberValuePair newMemberValuePair(AST ast, SimpleName name, Expression value) {
- MemberValuePair pair = ast.newMemberValuePair();
- pair.setName(name);
- pair.setValue(value);
- return pair;
- }
-
- protected MemberValuePair newMemberValuePair(AST ast, String name, Expression value) {
- return this.newMemberValuePair(ast, ast.newSimpleName(name), value);
- }
-
- protected MemberValuePair newMemberValuePair(AST ast, String name, String value) {
- return this.newMemberValuePair(ast, name, this.newStringLiteral(ast, value));
- }
-
- protected MemberValuePair newMemberValuePair(AST ast, String name, int value) {
- return this.newMemberValuePair(ast, name, this.newNumberLiteral(ast, value));
- }
-
- /**
- * Add the specified member value pair to the specified annotation.
- * Return the resulting annotation.
- */
- protected NormalAnnotation addMemberValuePair(NormalAnnotation annotation, MemberValuePair pair) {
- this.values(annotation).add(pair);
- return annotation;
- }
-
- /**
- * Add the specified member value pair to the specified annotation.
- * Return the resulting annotation.
- */
- protected NormalAnnotation addMemberValuePair(NormalAnnotation annotation, String name, int value) {
- return this.addMemberValuePair(annotation, this.newMemberValuePair(annotation.getAST(), name, value));
- }
-
- /**
- * Add the specified member value pair to the specified annotation.
- * Return the resulting annotation.
- */
- protected NormalAnnotation addMemberValuePair(NormalAnnotation annotation, String name, String value) {
- return this.addMemberValuePair(annotation, this.newMemberValuePair(annotation.getAST(), name, value));
- }
-
-
- // ********** member classes **********
-
- public interface AnnotationWriter {
- Iterator<String> imports();
- void appendTypeAnnotationTo(StringBuffer sb);
- void appendIdFieldAnnotationTo(StringBuffer sb);
- void appendNameFieldAnnotationTo(StringBuffer sb);
- void appendGetIdMethodAnnotationTo(StringBuffer sb);
- void appendSetIdMethodAnnotationTo(StringBuffer sb);
- void appendGetNameMethodAnnotationTo(StringBuffer sb);
- void appendSetNameMethodAnnotationTo(StringBuffer sb);
- }
-
- public static class DefaultAnnotationWriter implements AnnotationWriter {
- public Iterator<String> imports() {return EmptyIterator.instance();}
- public void appendTypeAnnotationTo(StringBuffer sb) {/* do nothing */}
- public void appendIdFieldAnnotationTo(StringBuffer sb) {/* do nothing */}
- public void appendNameFieldAnnotationTo(StringBuffer sb) {/* do nothing */}
- public void appendGetIdMethodAnnotationTo(StringBuffer sb) {/* do nothing */}
- public void appendSetIdMethodAnnotationTo(StringBuffer sb) {/* do nothing */}
- public void appendGetNameMethodAnnotationTo(StringBuffer sb) {/* do nothing */}
- public void appendSetNameMethodAnnotationTo(StringBuffer sb) {/* do nothing */}
- }
-
- public static class AnnotationWriterWrapper implements AnnotationWriter {
- private final AnnotationWriter aw;
- public AnnotationWriterWrapper(AnnotationWriter aw) {
- super();
- this.aw = aw;
- }
- public Iterator<String> imports() {return aw.imports();}
- public void appendTypeAnnotationTo(StringBuffer sb) {aw.appendTypeAnnotationTo(sb);}
- public void appendIdFieldAnnotationTo(StringBuffer sb) {aw.appendIdFieldAnnotationTo(sb);}
- public void appendNameFieldAnnotationTo(StringBuffer sb) {aw.appendNameFieldAnnotationTo(sb);}
- public void appendGetIdMethodAnnotationTo(StringBuffer sb) {aw.appendGetIdMethodAnnotationTo(sb);}
- public void appendSetIdMethodAnnotationTo(StringBuffer sb) {aw.appendSetIdMethodAnnotationTo(sb);}
- public void appendGetNameMethodAnnotationTo(StringBuffer sb) {aw.appendGetNameMethodAnnotationTo(sb);}
- public void appendSetNameMethodAnnotationTo(StringBuffer sb) {aw.appendSetNameMethodAnnotationTo(sb);}
- }
-
- public class AnnotatedSourceWriter implements SourceWriter {
- private AnnotationWriter annotationWriter;
- public AnnotatedSourceWriter(AnnotationWriter annotationWriter) {
- super();
- this.annotationWriter = annotationWriter;
- }
- public void appendSourceTo(StringBuffer sb) {
- AnnotationTestCase.this.appendSourceTo(sb, this.annotationWriter);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapterTests.java
deleted file mode 100644
index 10a259ccf7..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapterTests.java
+++ /dev/null
@@ -1,728 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.core.tests.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter;
-
-public class CombinationIndexedDeclarationAnnotationAdapterTests extends AnnotationTestCase {
-
- public CombinationIndexedDeclarationAnnotationAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createType("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- public void testGetAnnotation1() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID\")");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
- assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isNormalAnnotation());
- }
-
- public void testGetAnnotation2() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID\")");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testGetAnnotation3() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns(@annot.JoinColumn(name=\"ADDRESS_ID\"))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
- assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isNormalAnnotation());
- }
-
- public void testGetAnnotation4() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns(@annot.JoinColumn(name=\"ADDRESS_ID\"))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testGetAnnotation5() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
- assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isNormalAnnotation());
- String value = ((StringLiteral) ((MemberValuePair) ((NormalAnnotation) annotation).values().get(0)).getValue()).getLiteralValue();
- assertEquals("ADDRESS_ID2", value);
- }
-
- public void testGetAnnotation6() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testGetAnnotation7() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
- assertEquals("annot.JoinColumn", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isNormalAnnotation());
- String value = ((StringLiteral) ((MemberValuePair) ((NormalAnnotation) annotation).values().get(0)).getValue()).getLiteralValue();
- assertEquals("ADDRESS_ID2", value);
- }
-
- public void testGetAnnotation8() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testRemoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID\")");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumn");
- }
-
- public void testRemoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns(@annot.JoinColumn(name=\"ADDRESS_ID\"))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumns");
- this.assertSourceDoesNotContain("JoinColumn");
- }
-
- public void testRemoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumns");
- this.assertSourceDoesNotContain("ADDRESS_ID2");
- this.assertSourceContains("@JoinColumn(name=\"ADDRESS_ID1\")");
- }
-
- public void testRemoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumns");
- this.assertSourceDoesNotContain("ADDRESS_ID2");
- this.assertSourceContains("@JoinColumn(name=\"ADDRESS_ID1\")");
- }
-
- public void testRemoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "String comment(); JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(comment=\"test\",columns={@annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.removeAnnotation();
- this.assertSourceContains("@annot.JoinColumns(comment=\"test\",columns=@annot.JoinColumn(name=\"ADDRESS_ID1\"))");
- }
-
- public void testRemoveAnnotation6() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns(null)");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.removeAnnotation();
- this.assertSourceContains("@annot.JoinColumns(null)");
- }
-
- public void testRemoveAnnotation12() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID0\")";
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(expected);
- this.assertSourceDoesNotContain("JoinColumns");
- }
-
- public void testRemoveAnnotation13() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns({null, @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- this.assertSourceContains("@annot.JoinColumn");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumn");
- }
-
- public void testRemoveAnnotation14() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\"), null})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID0\")";
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testRemoveAnnotation15() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\")})");
- String expected = "@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, null, @annot.JoinColumn(name=\"ADDRESS_ID3\")})";
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testRemoveAnnotation16() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\")})");
- String expected = "@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 3);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testRemoveAnnotation17() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns({null, null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- this.assertSourceContains("@annot.JoinColumn");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("JoinColumn");
- }
-
- public void testNewMarkerAnnotation1() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType();
- this.assertSourceDoesNotContain("JoinColumn");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("JoinColumn");
- this.assertSourceDoesNotContain("JoinColumns");
- }
-
- public void testNewMarkerAnnotation2() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumn");
- this.assertSourceDoesNotContain("JoinColumns");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@JoinColumns(columns={@JoinColumn,@JoinColumn})");
- }
-
- public void testNewMarkerAnnotation3() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn, @annot.JoinColumn})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.JoinColumns(columns={@annot.JoinColumn, @annot.JoinColumn," + CR + " @JoinColumn})");
- }
-
- public void testNewMarkerAnnotation4() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumn(77)");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("JoinColumn");
- this.assertSourceDoesNotContain("JoinColumns");
- this.assertSourceDoesNotContain("77");
- }
-
- public void testNewMarkerAnnotation5() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns=@annot.JoinColumn(77))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.JoinColumns(columns=@JoinColumn)");
- this.assertSourceDoesNotContain("77");
- }
-
- public void testNewMarkerAnnotation6() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns=@annot.JoinColumn(77))");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.JoinColumns(columns={@annot.JoinColumn(77),@JoinColumn})");
- }
-
- public void testNewMarkerAnnotation7() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumn(77)");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@JoinColumns(columns={@JoinColumn(77),@JoinColumn})");
- }
-
- public void testNewMarkerAnnotation8() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(77),@annot.JoinColumn(88)})");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.JoinColumns(columns={@annot.JoinColumn(77),@JoinColumn})");
- }
-
- public void testNewMarkerAnnotation9() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumn(text=\"blah\",num=42)");
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@JoinColumns(columns={@JoinColumn(text=\"blah\", num=42),@JoinColumn})");
- }
-
- public void testNewMarkerAnnotation23() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumn(text=\"blah\",num=42)");
- String expected = "@JoinColumns(columns={@JoinColumn(text=\"blah\", num=42),null,@JoinColumn})";
- this.assertSourceDoesNotContain(expected);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation24() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumn(text=\"blah\",num=42)");
- String expected1 = "@JoinColumns({";
- String expected2 = "@JoinColumn(text=\"blah\", num=42),null,";
- String expected3 = "@JoinColumn})";
- this.assertSourceDoesNotContain(expected1);
- this.assertSourceDoesNotContain(expected2);
- this.assertSourceDoesNotContain(expected3);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1);
- this.assertSourceContains(expected2);
- this.assertSourceContains(expected3);
- }
-
- public void testNewMarkerAnnotation25() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected1 = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, null,"; // the line gets split
- String expected2 = "@JoinColumn})";
- this.assertSourceDoesNotContain(expected1);
- this.assertSourceDoesNotContain(expected2);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 4);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1);
- this.assertSourceContains(expected2);
- }
-
- public void testNewMarkerAnnotation26() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected1 = "@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, null,"; // the line gets split
- String expected2 = "@JoinColumn})";
- this.assertSourceDoesNotContain(expected1);
- this.assertSourceDoesNotContain(expected2);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 4);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1);
- this.assertSourceContains(expected2);
- }
-
- public void testMoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID0\")");
- String expected = "@JoinColumns(columns={null,@JoinColumn(name=\"ADDRESS_ID0\")})";
- this.assertSourceDoesNotContain(expected);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={null,@annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID1\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- this.assertSourceDoesNotContain("JoinColumns");
- }
-
- public void testMoveAnnotation2a() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns({null,@annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID1\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 1);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- this.assertSourceDoesNotContain("JoinColumns");
- }
-
- public void testMoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\")})");
- String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- this.assertSourceDoesNotContain(expected);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID4\")})");
- String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), null, @annot.JoinColumn(name=\"ADDRESS_ID4\")})";
- this.assertSourceDoesNotContain(expected);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- this.assertSourceDoesNotContain(expected);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation6() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), @annot.JoinColumn(name=\"ADDRESS_ID0\")})";
- this.assertSourceDoesNotContain(expected);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation7() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- this.assertSourceDoesNotContain(expected);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation8() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), null, @annot.JoinColumn(name=\"ADDRESS_ID4\")})");
- String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\"), null, @annot.JoinColumn(name=\"ADDRESS_ID4\")})";
- this.assertSourceDoesNotContain(expected);
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation9() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- String expected = "@annot.JoinColumns(columns={null, @annot.JoinColumn(name=\"ADDRESS_ID1\"), @annot.JoinColumn(name=\"ADDRESS_ID2\")})";
- this.createTestType(expected); // the source should be unchanged
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 0);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation10() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID0\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNull(annotation);
-
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected);
- this.assertSourceDoesNotContain("@annot.JoinColumns");
- }
-
- public void testMoveAnnotation10a() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- this.createTestType("@annot.JoinColumns({@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID0\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNull(annotation);
-
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected);
- this.assertSourceDoesNotContain("@annot.JoinColumns");
- }
-
- public void testMoveAnnotation11() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumn(name=\"ADDRESS_ID0\")");
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 1);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceDoesNotContain("JoinColumn");
- }
-
- public void testMoveAnnotation12() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), null, @annot.JoinColumn(name=\"ADDRESS_ID2\")})");
- String expected = "@JoinColumn(name=\"ADDRESS_ID2\")";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 2);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- this.assertSourceDoesNotContain("@annot.JoinColumns");
- }
-
- public void testMoveAnnotation13() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] columns();");
- this.createTestType("@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID0\"), @annot.JoinColumn(name=\"ADDRESS_ID1\"), null, @annot.JoinColumn(name=\"ADDRESS_ID3\")})");
- String expected = "@annot.JoinColumns(columns={@annot.JoinColumn(name=\"ADDRESS_ID3\"), @annot.JoinColumn(name=\"ADDRESS_ID1\")})";
- IndexedDeclarationAnnotationAdapter cidaa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "columns", 3);
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), cidaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JDTToolsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JDTToolsTests.java
deleted file mode 100644
index 5176595367..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JDTToolsTests.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.core.tests.internal.jdtutility;
-
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.FieldAttribute;
-import org.eclipse.jpt.core.internal.jdtutility.JDTTools;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-
-public class JDTToolsTests extends AnnotationTestCase {
-
- public JDTToolsTests(String name) {
- super(name);
- }
-
- public void testResolveSignature1() throws Exception {
- this.verifyResolveSignature("String", "java.lang.String");
- }
-
- public void testResolveSignature2() throws Exception {
- this.verifyResolveSignature("List", null);
- }
-
- public void testResolveSignature3() throws Exception {
- this.verifyResolveSignature("int", "int");
- }
-
- public void testResolveSignature4() throws Exception {
- this.verifyResolveSignature("void", "void");
- }
-
- public void testResolveSignature5() throws Exception {
- this.verifyResolveSignature("int[]", "int[]");
- }
-
- public void testResolveSignature6() throws Exception {
- this.verifyResolveSignature("String[]", "java.lang.String[]");
- }
-
- public void testResolveSignature7() throws Exception {
- this.verifyResolveSignature("java.util.List[][][]", "java.util.List[][][]");
- }
-
- public void testResolveSignature8a() throws Exception {
- // inner class
- this.verifyResolveSignature("java.util.Map.Entry", "java.util.Map.Entry");
- }
-
- public void testResolveSignature8b() throws Exception {
- // inner class
- this.createTestType("java.util.Map", "");
- this.verifyResolveSignature2("Map.Entry", "java.util.Map.Entry");
- }
-
- public void testResolveSignature8c() throws Exception {
- // inner class
- this.createTestType("java.util.Map.Entry", "");
- this.verifyResolveSignature2("Entry", "java.util.Map.Entry");
- }
-
- public void testResolveSignature9() throws Exception {
- // inner class
- this.verifyResolveSignature("Character.Subset", "java.lang.Character.Subset");
- }
-
- public void testResolveSignature10() throws Exception {
- // generic type
- this.verifyResolveSignature("java.util.List<java.lang.String>", "java.util.List"); // ????
- }
-
- public void testResolveSignature11() throws Exception {
- // annotation
- this.createTestType("java.lang.annotation.Target", "");
- this.verifyResolveSignature2("Target", "java.lang.annotation.Target");
- }
-
- public void testResolveSignature12() throws Exception {
- this.createTestType("java.lang.annotation.ElementType", "");
- this.verifyResolveSignature2("ElementType", "java.lang.annotation.ElementType");
- }
-
- private void verifyResolveSignature(String unresolvedTypeName, String expected) throws Exception {
- this.createTestType();
- this.verifyResolveSignature2(unresolvedTypeName, expected);
- }
-
- private void verifyResolveSignature2(String unresolvedTypeName, String expected) throws Exception {
- String signature = Signature.createTypeSignature(unresolvedTypeName, false);
- String actual = JDTTools.resolveSignature(signature, this.jdtType());
- assertEquals(expected, actual);
- }
-
-
- private void createEnumAndMembers(String enumName, String enumBody) throws Exception {
- this.javaProject.createType("enums", enumName + ".java", "public enum " + enumName + " { " + enumBody + " }");
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createType("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- public void testResolveEnum1() throws Exception {
- this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
-
- this.createTestType("@annot.TestAnnotation(foo=enums.TestEnum.BAZ)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo");
- FieldAttribute field = this.idField();
-
- String actual = JDTTools.resolveEnum(this.jdtType().getCompilationUnit(), field.annotationElementExpression(daea));
- assertEquals("enums.TestEnum.BAZ", actual);
- }
-
- public void testResolveEnum2() throws Exception {
- this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
-
- this.createTestType("static enums.TestEnum.BAZ", "@annot.TestAnnotation(foo=BAZ)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo");
- FieldAttribute field = this.idField();
-
- String actual = JDTTools.resolveEnum(this.jdtType().getCompilationUnit(), field.annotationElementExpression(daea));
- assertEquals("enums.TestEnum.BAZ", actual);
- }
-
- public void testResolveEnum3() throws Exception {
- this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
-
- this.createTestType("static enums.TestEnum.*", "@annot.TestAnnotation(foo=BAZ)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo");
- FieldAttribute field = this.idField();
-
- String actual = JDTTools.resolveEnum(this.jdtType().getCompilationUnit(), field.annotationElementExpression(daea));
- assertEquals("enums.TestEnum.BAZ", actual);
- }
-
- public void testResolveEnum4() throws Exception {
- this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
-
- this.createTestType("enums.TestEnum", "@annot.TestAnnotation(foo=TestEnum.BAZ)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.TestAnnotation");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "foo");
- FieldAttribute field = this.idField();
-
- String actual = JDTTools.resolveEnum(this.jdtType().getCompilationUnit(), field.annotationElementExpression(daea));
- assertEquals("enums.TestEnum.BAZ", actual);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JptCoreJdtUtilityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JptCoreJdtUtilityTests.java
deleted file mode 100644
index a6a0fb6b52..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/JptCoreJdtUtilityTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.core.tests.internal.jdtutility;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptCoreJdtUtilityTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCoreJdtUtilityTests.class.getName());
- suite.addTestSuite(MemberAnnotationElementAdapterTests.class);
- suite.addTestSuite(CombinationIndexedDeclarationAnnotationAdapterTests.class);
- suite.addTestSuite(JDTToolsTests.class);
- suite.addTestSuite(NestedDeclarationAnnotationAdapterTests.class);
- suite.addTestSuite(NestedIndexedDeclarationAnnotationAdapterTests.class);
- suite.addTestSuite(SimpleDeclarationAnnotationAdapterTests.class);
- suite.addTestSuite(TypeTests.class);
- return suite;
- }
-
- private JptCoreJdtUtilityTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/MemberAnnotationElementAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/MemberAnnotationElementAdapterTests.java
deleted file mode 100644
index a13cf24929..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/MemberAnnotationElementAdapterTests.java
+++ /dev/null
@@ -1,615 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.core.tests.internal.jdtutility;
-
-import java.util.Arrays;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.BooleanLiteral;
-import org.eclipse.jdt.core.dom.CharacterLiteral;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-import org.eclipse.jpt.core.internal.ITextRange;
-import org.eclipse.jpt.core.internal.jdtutility.ASTNodeTextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.BooleanStringExpressionConverter;
-import org.eclipse.jpt.core.internal.jdtutility.CharacterStringExpressionConverter;
-import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.EnumArrayDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.NumberStringExpressionConverter;
-import org.eclipse.jpt.core.internal.jdtutility.PrimitiveTypeStringExpressionConverter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.internal.jdtutility.StringArrayExpressionConverter;
-
-public class MemberAnnotationElementAdapterTests extends AnnotationTestCase {
-
- public MemberAnnotationElementAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createType("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- private void createEnum(String enumName, String enumBody) throws Exception {
- this.javaProject.createType("enums", enumName + ".java", "public enum " + enumName + " { " + enumBody + " }");
- }
-
- public void testGetValue1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- this.createTestType("@annot.Foo(bar=\"xxx\")");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("xxx", aea.getValue());
- }
-
- public void testGetValue2() throws Exception {
- this.createAnnotationAndMembers("Foo", "int bar();");
- this.createTestType("@annot.Foo(bar=48)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, NumberLiteral>(daa, "bar", NumberStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("48", aea.getValue());
- }
-
- public void testGetValue3() throws Exception {
- this.createAnnotationAndMembers("Foo", "char bar();");
- this.createTestType("@annot.Foo(bar='c')");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, CharacterLiteral>(daa, "bar", CharacterStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("c", aea.getValue());
- }
-
- public void testGetValue4() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean bar();");
- this.createTestType("@annot.Foo(bar=false)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, BooleanLiteral>(daa, "bar", BooleanStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("false", aea.getValue());
- }
-
- public void testGetValue5() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- this.createTestType("@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, BooleanLiteral>(daa3, "fred", BooleanStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("false", aea.getValue());
- }
-
- public void testGetValue6() throws Exception {
- this.createAnnotationAndMembers("Foo", "boolean value();");
- this.createTestType("@annot.Foo(false)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, BooleanLiteral>(daa, BooleanStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("false", aea.getValue());
- }
-
- public void testGetValueNull1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- this.createTestType("@annot.Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertNull(aea.getValue());
- }
-
- public void testGetValueNull2() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertNull(aea.getValue());
- }
-
- public void testGetValueNull3() throws Exception {
- this.createAnnotationAndMembers("Baz", "String fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- this.createTestType("@annot.Foo(@annot.Bar(jimmy=@annot.Baz))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa3, "fred");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertNull(aea.getValue());
- }
-
- public void testASTNode1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String value = "\"xxx\"";
- String element = "bar=" + value;
- String annotation = "@annot.Foo(" + element + ")";
- this.createTestType(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- ITextRange textRange = new ASTNodeTextRange(aea.astNode());
- assertEquals(this.source().indexOf(value), textRange.getOffset());
- assertEquals(value.length(), textRange.getLength());
- assertEquals(7, textRange.getLineNumber());
- }
-
- public void testASTNode2() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String value = "false";
- String element = "fred=" + value;
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(" + element + ")))";
- this.createTestType(annotation);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, BooleanLiteral>(daa3, "fred", BooleanStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("false", aea.getValue());
- ITextRange textRange = new ASTNodeTextRange(aea.astNode());
- assertEquals(value.length(), textRange.getLength());
- }
-
- public void testASTNode3() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value();");
- String element = "\"xxx\"";
- String annotation = "@annot.Foo(" + element + ")";
- this.createTestType(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa);
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- ITextRange textRange = new ASTNodeTextRange(aea.astNode());
- assertEquals(this.source().indexOf(element), textRange.getOffset());
- assertEquals(element.length(), textRange.getLength());
- }
-
- public void testASTNode4() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value();");
- String annotation = "@annot.Foo";
- this.createTestType(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa);
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- ITextRange textRange = new ASTNodeTextRange(aea.astNode());
- assertEquals(this.source().indexOf(annotation), textRange.getOffset());
- assertEquals(annotation.length(), textRange.getLength());
- }
-
- public void testSetValue1() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String annotation = "@annot.Foo(bar=\"xxx\")";
- this.createTestType(annotation);
- this.assertSourceContains(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- aea.setValue(null);
- this.assertSourceDoesNotContain("Foo");
- }
-
- public void testSetValue2() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String annotation = "@annot.Foo(bar=\"xxx\")";
- this.createTestType(annotation);
- this.assertSourceContains(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar", false);
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- aea.setValue(null);
- this.assertSourceDoesNotContain(annotation);
- this.assertSourceContains("@Foo");
- }
-
- public void testSetValue3() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))";
- this.createTestType(annotation);
- this.assertSourceContains(annotation);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, BooleanLiteral>(daa3, "fred", BooleanStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- aea.setValue(null);
- this.assertSourceDoesNotContain(annotation);
- this.assertSourceDoesNotContain("Foo");
- this.assertSourceDoesNotContain("Bar");
- }
-
- public void testSetValue3a() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))";
- this.createTestType(annotation);
- this.assertSourceContains(annotation);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar", false);
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz", false);
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, BooleanLiteral>(daa3, "fred", BooleanStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- aea.setValue(null);
- this.assertSourceDoesNotContain(annotation);
- this.assertSourceContains("@annot.Foo(@Bar)");
- }
-
- public void testSetValue4() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- aea.setValue("xxx");
- this.assertSourceContains("@Foo(bar=\"xxx\")");
- }
-
- public void testSetValue5() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String annotation = "@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=false)))";
- this.createTestType(annotation);
- this.assertSourceContains(annotation);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, BooleanLiteral>(daa3, "fred", BooleanStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- aea.setValue("true");
- this.assertSourceDoesNotContain(annotation);
- this.assertSourceContains("@annot.Foo(@annot.Bar(jimmy=@annot.Baz(fred=true)))");
- }
-
- public void testSetValue6() throws Exception {
- this.createAnnotationAndMembers("Baz", "boolean fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- this.createTestType();
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "jimmy", "annot.Baz");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, BooleanLiteral>(daa3, "fred", BooleanStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- aea.setValue("true");
- this.assertSourceContains("@Foo(@Bar(jimmy=@Baz(fred=true)))");
- }
-
- public void testSetValue7() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String annotation = "@annot.Foo(bar=\"xxx\")";
- this.createTestType(annotation);
- this.assertSourceContains(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- aea.setValue("yyy");
- this.assertSourceDoesNotContain(annotation);
- this.assertSourceContains("@annot.Foo(bar=\"yyy\")");
- }
-
- public void testSetValue8() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar();");
- String annotation = "@annot.Foo";
- this.createTestType(annotation);
- this.assertSourceContains(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- aea.setValue("xxx");
- this.assertSourceContains("@Foo(bar=\"xxx\")");
- }
-
- public void testSetValue9() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value(); String bar();");
- String annotation = "@annot.Foo(\"zzz\")";
- this.createTestType(annotation);
- this.assertSourceContains(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- aea.setValue("xxx");
- this.assertSourceDoesNotContain(annotation);
- this.assertSourceContains("@Foo(value=\"zzz\", bar=\"xxx\")");
- }
-
- public void testSetValue10() throws Exception {
- this.createAnnotationAndMembers("Foo", "String bar(); String baz();");
- String annotation = "@annot.Foo(bar=\"xxx\")";
- this.createTestType(annotation);
- this.assertSourceContains(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "baz");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- aea.setValue("yyy");
- this.assertSourceDoesNotContain(annotation);
- this.assertSourceContains("@annot.Foo(bar=\"xxx\", baz = \"yyy\")");
- }
-
- public void testSetValue11() throws Exception {
- this.createAnnotationAndMembers("Baz", "int fred();");
- this.createAnnotationAndMembers("Bar", "annot.Baz[] jimmy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- String annotation = "@annot.Foo(@annot.Bar(jimmy={@annot.Baz(fred=0), @annot.Baz(fred=1), @annot.Baz(fred=2), @annot.Baz(fred=3)}))";
- this.createTestType(annotation);
- this.assertSourceContains(annotation);
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "value", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "jimmy", 2, "annot.Baz");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, NumberLiteral>(daa3, "fred", NumberStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- assertEquals("2", aea.getValue());
- aea.setValue("48");
- this.assertSourceContains("@annot.Foo(@annot.Bar(jimmy={@annot.Baz(fred=0), @annot.Baz(fred=1), @annot.Baz(fred=48), @annot.Baz(fred=3)}))");
- }
-
- public void testSetValue12() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value();");
- String annotation = "@annot.Foo";
- this.createTestType(annotation);
- this.assertSourceContains(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "value");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- aea.setValue("xxx");
- this.assertSourceContains("@Foo(\"xxx\")");
- }
-
- public void testSetValue13() throws Exception {
- this.createAnnotationAndMembers("Foo", "String value();");
- String annotation = "@annot.Foo(\"zzz\")";
- this.createTestType(annotation);
- this.assertSourceContains(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, "value");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
-
- aea.setValue("xxx");
- this.assertSourceDoesNotContain(annotation);
- this.assertSourceContains("@annot.Foo(\"xxx\")");
- }
-
- public void testSimpleTypeLiteral1() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- this.createTestType("@annot.Foo(bar=java.lang.Object.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, TypeLiteral>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("java.lang.Object", aea.getValue());
- }
-
- public void testSimpleTypeLiteral2() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, TypeLiteral>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- aea.setValue("java.lang.Object");
- this.assertSourceContains("@Foo(bar=java.lang.Object.class)");
- }
-
- public void testSimpleTypeLiteral3() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- this.createTestType("@annot.Foo(bar=int.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, TypeLiteral>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertNull(aea.getValue());
- }
-
- public void testSimpleTypeLiteral4() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- this.createTestType("@annot.Foo(bar=java.util.Map.Entry.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, TypeLiteral>(daa, "bar", SimpleTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("java.util.Map.Entry", aea.getValue());
- }
-
- public void testPrimitiveTypeLiteral1() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- this.createTestType("@annot.Foo(bar=int.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, TypeLiteral>(daa, "bar", PrimitiveTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("int", aea.getValue());
- }
-
- public void testPrimitiveTypeLiteral2() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, TypeLiteral>(daa, "bar", PrimitiveTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- aea.setValue("int");
- this.assertSourceContains("@Foo(bar=int.class)");
- }
-
- public void testPrimitiveTypeLiteral3() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- this.createTestType("@annot.Foo(bar=java.lang.Object.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, TypeLiteral>(daa, "bar", PrimitiveTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertNull(aea.getValue());
- }
-
- public void testPrimitiveTypeLiteral4() throws Exception {
- this.createAnnotationAndMembers("Foo", "Class bar();");
- this.createTestType("@annot.Foo(bar=void.class)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new ConversionDeclarationAnnotationElementAdapter<String, TypeLiteral>(daa, "bar", PrimitiveTypeStringExpressionConverter.instance());
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("void", aea.getValue());
- }
-
- public void testGetValueEnum1() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- this.createTestType("@annot.Foo(bar=enums.TestEnum.XXX)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("enums.TestEnum.XXX", aea.getValue());
- }
-
- public void testGetValueEnum2() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- this.createTestType("static enums.TestEnum.XXX", "@annot.Foo(bar=XXX)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("enums.TestEnum.XXX", aea.getValue());
- }
-
- public void testGetValueEnum3() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- this.createTestType("@annot.Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertNull(aea.getValue());
- }
-
- public void testGetValueEnum4() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- this.createTestType("enums.TestEnum", "@annot.Foo(bar=TestEnum.XXX)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- assertEquals("enums.TestEnum.XXX", aea.getValue());
- }
-
- public void testSetValueEnum1() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- String annotation = "@annot.Foo(bar=XXX)";
- this.createTestType("static enums.TestEnum.XXX", annotation);
- this.assertSourceContains(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- aea.setValue(null);
- this.assertSourceDoesNotContain("Foo");
- }
-
- public void testSetValueEnum2() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum bar();");
- String annotation = "@Foo(bar=XXX)";
- this.createTestType();
- this.assertSourceDoesNotContain(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String> daea = new EnumDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String> aea = new MemberAnnotationElementAdapter<String>(this.idField(), daea);
- aea.setValue("enums.TestEnum.XXX");
- this.assertSourceContains("import static enums.TestEnum.XXX;");
- this.assertSourceContains(annotation);
- }
-
- public void testGetValueStringArray() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- this.createTestType("@annot.Foo(bar={\"string0\", \"string1\"})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[], ArrayInitializer>(daa, "bar", StringArrayExpressionConverter.forStringLiterals());
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(), daea);
- assertTrue(Arrays.equals(new String[] {"string0", "string1"}, aea.getValue()));
- }
-
- public void testGetValueNullStringArray() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- this.createTestType("@annot.Foo()");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[], ArrayInitializer>(daa, "bar", StringArrayExpressionConverter.forStringLiterals());
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(), daea);
- assertNull(aea.getValue());
- }
-
- public void testSetValueStringArray() throws Exception {
- this.createAnnotationAndMembers("Foo", "String[] bar();");
- String annotation = "@Foo(bar={\"string0\",\"string1\"})";
- this.createTestType();
- this.assertSourceDoesNotContain(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new ConversionDeclarationAnnotationElementAdapter<String[], ArrayInitializer>(daa, "bar", StringArrayExpressionConverter.forStringLiterals());
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(), daea);
- aea.setValue(new String[] {"string0", "string1"});
- this.assertSourceContains(annotation);
- }
-
- public void testGetValueEnumArray() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- this.createTestType("@annot.Foo(bar={enums.TestEnum.XXX, enums.TestEnum.YYY})");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(), daea);
- assertTrue(Arrays.equals(new String[] {"enums.TestEnum.XXX", "enums.TestEnum.YYY"}, aea.getValue()));
- }
-
- public void testGetValueNullEnumArray() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- this.createTestType("@annot.Foo()");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(), daea);
- assertNull(aea.getValue());
- }
-
- public void testSetValueEnumArray() throws Exception {
- this.createEnum("TestEnum", "XXX, YYY, ZZZ");
- this.createAnnotationAndMembers("Foo", "enums.TestEnum[] bar();");
- String annotation = "@Foo(bar={XXX,YYY})";
- this.createTestType();
- this.assertSourceDoesNotContain(annotation);
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationElementAdapter<String[]> daea = new EnumArrayDeclarationAnnotationElementAdapter(daa, "bar");
- AnnotationElementAdapter<String[]> aea = new MemberAnnotationElementAdapter<String[]>(this.idField(), daea);
- aea.setValue(new String[] {"enums.TestEnum.XXX", "enums.TestEnum.YYY"});
- this.assertSourceContains("import static enums.TestEnum.XXX;");
- this.assertSourceContains("import static enums.TestEnum.YYY;");
- this.assertSourceContains(annotation);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedDeclarationAnnotationAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedDeclarationAnnotationAdapterTests.java
deleted file mode 100644
index e82d42c7c4..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedDeclarationAnnotationAdapterTests.java
+++ /dev/null
@@ -1,763 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.core.tests.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.ModifiedDeclaration;
-import org.eclipse.jpt.core.internal.jdtutility.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-
-public class NestedDeclarationAnnotationAdapterTests extends AnnotationTestCase {
-
- public NestedDeclarationAnnotationAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createType("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- public void testGetAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- this.createTestType("@annot.Foo(nestedAnnotation=@annot.Bar)");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
- assertEquals("annot.Bar", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testGetAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Baz", "String value();");
- this.createAnnotationAndMembers("Bar", "annot.Baz yana();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- this.createTestType("@annot.Foo(nestedAnnotation=@annot.Bar(yana=@annot.Baz))");
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedDeclarationAnnotationAdapter(daa1, "nestedAnnotation", "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedDeclarationAnnotationAdapter(daa2, "yana", "annot.Baz");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa3);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
- assertEquals("annot.Baz", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testGetAnnotationNull1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- this.createTestType("@annot.Foo()");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testGetAnnotationNull2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- this.createTestType();
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testGetAnnotationNull3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "String nestedAnnotation();");
- this.createTestType("@annot.Foo(nestedAnnotation=\"annot.Bar\")");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testGetAnnotationNull4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Bar2", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar2 nestedAnnotation();");
- this.createTestType("@annot.Foo(nestedAnnotation=@annot.Bar2)");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testRemoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- String na = "@annot.Foo(nestedAnnotation=@annot.Bar)";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na);
- this.assertSourceDoesNotContain("Foo");
- }
-
- public void testRemoveAnnotation1a() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- String na = "@annot.Foo(nestedAnnotation=@annot.Bar)";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar", false);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains("Foo");
- }
-
- public void testRemoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- this.createTestType();
- this.assertSourceDoesNotContain("Foo");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("Foo");
- }
-
- public void testRemoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "String nestedAnnotation();");
- String na = "@annot.Foo(nestedAnnotation=\"annot.Bar\")";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na);
- }
-
- public void testRemoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Bar2", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar2 nestedAnnotation();");
- String na = "@annot.Foo(nestedAnnotation=@annot.Bar2)";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na);
- }
-
- public void testRemoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Baz", "String value();");
- this.createAnnotationAndMembers("Bar", "annot.Baz nestedAnnotation2();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation1();");
- String na = "@annot.Foo(nestedAnnotation1=@annot.Bar(nestedAnnotation2=@annot.Baz))";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daaFoo = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daaBar = new NestedDeclarationAnnotationAdapter(daaFoo, "nestedAnnotation1", "annot.Bar");
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(daaBar, "nestedAnnotation2", "annot.Baz");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na);
- this.assertSourceDoesNotContain("Foo");
- this.assertSourceDoesNotContain("Bar");
- this.assertSourceDoesNotContain("Baz");
- }
-
- public void testRemoveAnnotation5a() throws Exception {
- this.createAnnotationAndMembers("Baz", "String value();");
- this.createAnnotationAndMembers("Bar", "annot.Baz nestedAnnotation2();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation1();");
- String na = "@annot.Foo(nestedAnnotation1=@annot.Bar(nestedAnnotation2=@annot.Baz))";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daaFoo = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daaBar = new NestedDeclarationAnnotationAdapter(daaFoo, "nestedAnnotation1", "annot.Bar", false);
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(daaBar, "nestedAnnotation2", "annot.Baz", false);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains("@annot.Foo(nestedAnnotation1=@Bar)");
- }
-
- public void testNewMarkerAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- this.createTestType();
- this.assertSourceDoesNotContain("Foo");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotation=@Bar)");
- }
-
- public void testNewMarkerAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- this.createTestType();
- this.assertSourceDoesNotContain("Foo");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(@Bar)");
- }
-
- public void testNewMarkerAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotation=@Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String value();");
- this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value=\"something\", nestedAnnotation=@Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "Object value();");
- this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar nestedAnnotation();");
- this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotation = @Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar value();");
- this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewSingleMemberAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- this.createTestType();
- this.assertSourceDoesNotContain("Foo");
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation1(declaration);
- }
- });
- this.assertSourceContains("@Foo(nestedAnnotation=@Bar(\"test string literal\"))");
- }
-
- void editNewSingleMemberAnnotation1(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- this.createTestType();
- this.assertSourceDoesNotContain("Foo");
-
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) aa.getAnnotation();
- assertNull(annotation);
-
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation2(declaration);
- }
- });
- this.assertSourceContains("@Foo(@Bar(\"test string literal\"))");
- }
-
- void editNewSingleMemberAnnotation2(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotation=@Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation3(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation3(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation4(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation4(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String value();");
- this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value=\"something\", nestedAnnotation=@Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation5(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation5(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "Object value();");
- this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation6(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation6(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String xxx();");
- this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotation = @Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation7(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation7(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewSingleMemberAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value(); String xxx();");
- this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar(\"test string literal\"))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation8(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation8(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewNormalAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- this.createTestType();
- this.assertSourceDoesNotContain("Foo");
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation1(declaration);
- }
- });
- this.assertSourceContains("@Foo(nestedAnnotation=@Bar(yyy=\"test string literal\"))");
- }
-
- void editNewNormalAnnotation1(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- this.createTestType();
- this.assertSourceDoesNotContain("Foo");
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation2(declaration);
- }
- });
- this.assertSourceContains("@Foo(@Bar(yyy=\"test string literal\"))");
- }
-
- void editNewNormalAnnotation2(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation();");
- this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotation=@Bar(yyy=\"test string literal\"))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation3(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation3(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar value();");
- this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar(yyy=\"test string literal\"))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation4(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation4(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "annot.Bar nestedAnnotation(); String value();");
- this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value=\"something\", nestedAnnotation=@Bar(yyy=\"test string literal\"))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation5(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation5(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "Object value();");
- this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar(yyy=\"test string literal\"))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation6(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation6(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar nestedAnnotation();");
- this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotation = @Bar(yyy = \"test string literal\"))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation7(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation7(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotation", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
- public void testNewNormalAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "String yyy();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar value();");
- this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar(yyy = \"test string literal\"))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation8(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation8(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "yyy", "test string literal");
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapterTests.java
deleted file mode 100644
index e361b43ff7..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapterTests.java
+++ /dev/null
@@ -1,2209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.core.tests.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.ModifiedDeclaration;
-import org.eclipse.jpt.core.internal.jdtutility.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-
-public class NestedIndexedDeclarationAnnotationAdapterTests extends AnnotationTestCase {
-
- public NestedIndexedDeclarationAnnotationAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotation(String annotationName) throws Exception {
- this.createAnnotationAndMembers(annotationName, "");
- }
-
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createType("annot", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- public void testGetAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations={@annot.Bar, @annot.Bar(\"two\")})");
- // 0
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
- assertEquals("annot.Bar", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
-
- // 1
- daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 1, "annot.Bar");
- aa = new MemberAnnotationAdapter(this.idField(), daa);
- annotation = aa.getAnnotation();
- assertNotNull(annotation);
- assertEquals("annot.Bar", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isSingleMemberAnnotation());
- }
-
- public void testGetAnnotation2() throws Exception {
- this.createAnnotation("Baz");
- this.createAnnotationAndMembers("Bar", "annot.Baz[] yana();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(yana=@annot.Baz))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Baz");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa3);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
- assertEquals("annot.Baz", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testGetAnnotation3() throws Exception {
- this.createAnnotation("Baz");
- this.createAnnotationAndMembers("Bar", "annot.Baz[] yana();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(yana={@annot.Baz}))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Baz");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa3);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
- assertEquals("annot.Baz", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
-
- // name mismatch
- daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Xyz");
- aa = new MemberAnnotationAdapter(this.idField(), daa3);
- annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testGetAnnotationNull1() throws Exception {
- this.createAnnotation("Bar");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo()");
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testGetAnnotationNull2() throws Exception {
- this.createAnnotation("Bar");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType();
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testGetAnnotationNull3() throws Exception {
- this.createAnnotation("Bar");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=\"annot.Bar\")");
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testGetAnnotationNull4() throws Exception {
- this.createAnnotation("NotBar");
- this.createAnnotation("Bar");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testGetAnnotationNull5() throws Exception {
- this.createAnnotationAndMembers("Bar", "String value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations={@annot.Bar, @annot.Bar(\"two\")})");
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testGetAnnotationNull6() throws Exception {
- this.createAnnotation("Xyz");
- this.createAnnotation("Baz");
- this.createAnnotationAndMembers("Bar", "annot.Baz[] yana();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(yana={@annot.Baz}))");
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- DeclarationAnnotationAdapter daa3 = new NestedIndexedDeclarationAnnotationAdapter(daa2, "yana", 0, "annot.Xyz");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa3);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testRemoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), @annot.Bar(1)})";
- String expected = "@annot.Foo(nestedAnnotations={null, @annot.Bar(1)})";
- this.createTestType(na);
- this.assertSourceDoesNotContain(expected);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains(expected);
- }
-
- public void testRemoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType();
- this.assertSourceDoesNotContain("Foo");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("Foo");
- }
-
- public void testRemoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={\"annot.Bar1\", \"annot.Bar2\", \"annot.Bar3\"})";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na);
- }
-
- public void testRemoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.NotBar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.NotBar(0), @annot.NotBar(1)})";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na);
- }
-
- public void testRemoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations=@annot.Bar)";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- assertNull(aa.getAnnotation());
- this.assertSourceDoesNotContain(na);
- this.assertSourceDoesNotContain("Foo");
- }
-
- public void testRemoveAnnotation5a() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations=@annot.Bar)";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 0, "annot.Bar", false);
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertTrue(aa1.getAnnotation().isMarkerAnnotation());
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains("import annot.Foo;");
- this.assertSourceContains("@Foo");
- }
-
- public void testRemoveAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations=\"annot.Bar\")";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na);
- }
-
- public void testRemoveAnnotation7() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.NotBar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations=@annot.NotBar)";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceContains(na);
- }
-
- public void testRemoveAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), @annot.Bar(1), @annot.Bar(2), @annot.Bar(3)})";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertTrue(aa1.getAnnotation().isNormalAnnotation());
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.Bar(0), @annot.Bar(1), null, @annot.Bar(3)})");
- }
-
- public void testRemoveAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), @annot.Bar(1), @annot.Bar(2), @annot.Bar(3)})";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertTrue(aa1.getAnnotation().isSingleMemberAnnotation());
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(), "value").getNodeType());
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains("@annot.Foo({@annot.Bar(0), @annot.Bar(1), null, @annot.Bar(3)})");
- }
-
- public void testRemoveAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), @annot.Bar(1)})";
- String expected = "@annot.Foo({null, @annot.Bar(1)})";
- this.createTestType(na);
- this.assertSourceDoesNotContain(expected);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 0, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains(expected);
- }
-
- public void testRemoveAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), @annot.Bar(1)})";
- String expected = "@annot.Foo(@annot.Bar(0))";
- this.createTestType(na);
- this.assertSourceDoesNotContain(expected);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 1, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(), "value").getNodeType());
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains(expected);
- }
-
- public void testRemoveAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2)})";
- String expected = "@annot.Foo(@annot.Bar(0))";
- this.createTestType(na);
- this.assertSourceDoesNotContain(expected);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(), "value").getNodeType());
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains(expected);
- }
-
- public void testRemoveAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({null, @annot.Bar(1)})";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 1, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- this.assertSourceDoesNotContain("Foo");
- }
-
- public void testRemoveAnnotation14() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2), null})";
- String expected = "@annot.Foo(@annot.Bar(0))";
- this.createTestType(na);
- this.assertSourceDoesNotContain(expected);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(), "value").getNodeType());
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains(expected);
- }
-
- public void testRemoveAnnotation15() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})";
- String expected = "@annot.Foo({@annot.Bar(0), null, null, @annot.Bar(3)})";
- this.createTestType(na);
- this.assertSourceDoesNotContain(expected);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(), "value").getNodeType());
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains(expected);
- }
-
- public void testRemoveAnnotation16() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String na = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})";
- String expected = "@annot.Foo({@annot.Bar(0), null, @annot.Bar(2)})";
- this.createTestType(na);
- this.assertSourceDoesNotContain(expected);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "value", 3, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(), "value").getNodeType());
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains(expected);
- }
-
- public void testRemoveAnnotation17() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2)})";
- String expected = "@annot.Foo(nestedAnnotations=@annot.Bar(0))";
- this.createTestType(na);
- this.assertSourceDoesNotContain(expected);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains(expected);
- }
-
- public void testRemoveAnnotation18() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={null, @annot.Bar(1)})";
- this.createTestType(na);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 1, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- this.assertSourceDoesNotContain("Foo");
- }
-
- public void testRemoveAnnotation19() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2), null})";
- String expected = "@annot.Foo(nestedAnnotations=@annot.Bar(0))";
- this.createTestType(na);
- this.assertSourceDoesNotContain(expected);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.SINGLE_MEMBER_ANNOTATION, this.annotationElementValue(aa1.getAnnotation(), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains(expected);
- }
-
- public void testRemoveAnnotation20() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})";
- String expected = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, null, @annot.Bar(3)})";
- this.createTestType(na);
- this.assertSourceDoesNotContain(expected);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains(expected);
- }
-
- public void testRemoveAnnotation21() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- String na = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2), @annot.Bar(3)})";
- String expected = "@annot.Foo(nestedAnnotations={@annot.Bar(0), null, @annot.Bar(2)})";
- this.createTestType(na);
- this.assertSourceDoesNotContain(expected);
- this.assertSourceContains(na);
-
- DeclarationAnnotationAdapter daa1 = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa1 = new MemberAnnotationAdapter(this.idField(), daa1);
- DeclarationAnnotationAdapter daa2 = new NestedIndexedDeclarationAnnotationAdapter(daa1, "nestedAnnotations", 3, "annot.Bar");
- AnnotationAdapter aa2 = new MemberAnnotationAdapter(this.idField(), daa2);
- Annotation annotation = aa2.getAnnotation();
- assertNotNull(annotation);
-
- aa2.removeAnnotation();
- assertEquals(ASTNode.ARRAY_INITIALIZER, this.annotationElementValue(aa1.getAnnotation(), "nestedAnnotations").getNodeType());
- this.assertSourceDoesNotContain(na);
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType();
- this.assertSourceDoesNotContain("Foo");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotations=@Bar)");
- }
-
- public void testNewMarkerAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType();
- this.assertSourceDoesNotContain("Foo");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(@Bar)");
- }
-
- public void testNewMarkerAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotations=@Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value=\"something\", nestedAnnotations=@Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotations = @Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] value();");
- this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType();
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- assertNull(aa.getAnnotation());
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotations={null,null,null,null,null,@Bar})");
- }
-
- public void testNewMarkerAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(\"something\")");
- this.assertSourceDoesNotContain("Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@Foo(value=\"something\", nestedAnnotations={null,null,null,null,null,@Bar})");
- }
-
- public void testNewMarkerAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo({\"one\", \"two\"})");
- String expected = "@annot.Foo({@Bar, \"two\"})";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo({\"one\", \"two\"})");
- this.assertSourceDoesNotContain("Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("Bar})"); // split line
- }
-
- public void testNewMarkerAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo(7)");
- String expected = "@annot.Foo(@Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation14() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo(7)");
- this.assertSourceDoesNotContain("Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.Foo({7,null,null,null,null,@Bar})");
- }
-
- public void testNewMarkerAnnotation15() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo(@annot.NotBar)");
- String expected = "@annot.Foo(@Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation16() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo(@annot.Bar(55))");
- String expected = "@annot.Foo({@annot.Bar(55),@Bar})";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation17() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- String expected = "@annot.Foo(nestedAnnotations={@Bar})";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation18() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- this.assertSourceDoesNotContain("Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("Bar})"); // split line
- }
-
- public void testNewMarkerAnnotation19() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=\"something\")");
- String expected = "@annot.Foo(nestedAnnotations=@Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation20() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- String expected = "@annot.Foo(nestedAnnotations=@Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation21() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- this.assertSourceDoesNotContain("@Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.NotBar,null,null,null,null,@Bar})");
- }
-
- public void testNewMarkerAnnotation22() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(88))");
- String expected = "@annot.Foo(nestedAnnotations=@Bar)";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation23() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(88))");
- String expected = "@annot.Foo(nestedAnnotations={@annot.Bar(88),null,@Bar})";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 2, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation24() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo(@annot.Bar(88))");
- String expected = "@annot.Foo({@annot.Bar(88),null,@Bar})";
- this.assertSourceDoesNotContain(expected);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected);
- }
-
- public void testNewMarkerAnnotation25() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations={@annot.Bar(88), @annot.Bar(77)})");
- String expected1 = "@annot.Foo(nestedAnnotations={@annot.Bar(88), @annot.Bar(77), null, null,"; // the line gets split
- String expected2 = "@Bar})";
- this.assertSourceDoesNotContain(expected1);
- this.assertSourceDoesNotContain(expected2);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 4, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1);
- this.assertSourceContains(expected2);
- }
-
- public void testNewMarkerAnnotation26() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo({@annot.Bar(88), @annot.Bar(77)})");
- String expected1 = "@annot.Foo({@annot.Bar(88), @annot.Bar(77), null, null,"; // the line gets split
- String expected2 = "@Bar})";
- this.assertSourceDoesNotContain(expected1);
- this.assertSourceDoesNotContain(expected2);
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 4, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1);
- this.assertSourceContains(expected2);
- }
-
- public void testNewSingleMemberAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType();
- this.assertSourceDoesNotContain("@Foo");
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation1(declaration);
- }
- });
- this.assertSourceContains("@Foo(nestedAnnotations=@Bar(88))");
- }
-
- void editNewSingleMemberAnnotation1(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType();
- this.assertSourceDoesNotContain("@Foo");
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation2(declaration);
- }
- });
- this.assertSourceContains("@Foo(@Bar(88))");
- }
-
- void editNewSingleMemberAnnotation2(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotations=@Bar(88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation3(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation3(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar(88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation4(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation4(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value=\"something\", nestedAnnotations=@Bar(88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation5(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation5(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar(88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation6(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation6(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotations = @Bar(88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation7(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation7(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String xxx(); annot.Bar[] value();");
- this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar(88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation8(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation8(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType();
- this.assertSourceDoesNotContain("@Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotations={null,null,null,null,null,@Bar(MISSING)})"); // ???
- }
-
- public void testNewSingleMemberAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "String value(); annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(\"something\")");
- this.assertSourceDoesNotContain("@Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@Foo(value=\"something\", nestedAnnotations={null,null,null,null,null,@Bar(MISSING)})"); // ???
- }
-
- public void testNewSingleMemberAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo({\"one\", \"two\"})");
- String expected = "@annot.Foo({@Bar(88), \"two\"})";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation11(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation11(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo({\"one\", \"two\"})");
- this.assertSourceDoesNotContain("@Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@Bar(MISSING)})"); // split line
- }
-
- public void testNewSingleMemberAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo(7)");
- String expected = "@annot.Foo(@Bar(88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation13(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation13(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation14() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo(7)");
- this.assertSourceDoesNotContain("@Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@annot.Foo({7,null,null,null,null,@Bar(MISSING)})");
- }
-
- public void testNewSingleMemberAnnotation15() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo(@annot.NotBar)");
- String expected = "@annot.Foo(@Bar(88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation15(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation15(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation16() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo(@annot.Bar(55))");
- String expected = "@annot.Foo({@annot.Bar(55),@Bar(88)})";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation16(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation16(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation17() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- String expected = "@annot.Foo(nestedAnnotations={@Bar(88)})";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation17(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation17(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation18() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- this.assertSourceDoesNotContain("@Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@Bar(MISSING)})"); // ???
- }
-
- public void testNewSingleMemberAnnotation19() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=\"something\")");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation19(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation19(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation20() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation20(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation20(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewSingleMemberAnnotation21() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int value();");
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- this.assertSourceDoesNotContain("@Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newSingleMemberAnnotation();
- this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.NotBar,null,null,null,null,@Bar(MISSING)})");
- }
-
- public void testNewSingleMemberAnnotation22() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(77))");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation22(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewSingleMemberAnnotation22(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- SingleMemberAnnotation annotation = daa.newSingleMemberAnnotation(declaration);
- NumberLiteral numberLiteral = annotation.getAST().newNumberLiteral();
- numberLiteral.setToken("88");
- annotation.setValue(numberLiteral);
- }
-
- public void testNewNormalAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType();
- this.assertSourceDoesNotContain("@Foo");
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation1(declaration);
- }
- });
- this.assertSourceContains("@Foo(nestedAnnotations=@Bar(xxx=88))");
- }
-
- void editNewNormalAnnotation1(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType();
- this.assertSourceDoesNotContain("@Foo");
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation2(declaration);
- }
- });
- this.assertSourceContains("@Foo(@Bar(xxx=88))");
- }
-
- void editNewNormalAnnotation2(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo");
- String expected = "@Foo(nestedAnnotations=@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation3(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation3(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations();");
- this.createTestType("@annot.Foo");
- String expected = "@Foo(@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation4(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation4(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String value();");
- this.createTestType("@annot.Foo(\"something\")");
- String expected = "@Foo(value=\"something\", nestedAnnotations=@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation5(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation5(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo(\"something\")");
- String expected = "@annot.Foo(@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation6(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation6(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String xxx();");
- this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", nestedAnnotations = @Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation7(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation7(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value(); String xxx();");
- this.createTestType("@annot.Foo(xxx=\"something\")");
- String expected = "@annot.Foo(xxx=\"something\", value = @Bar(xxx = 88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation8(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation8(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String xxx();");
- this.createTestType();
- this.assertSourceDoesNotContain("@Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@Foo(nestedAnnotations={null,null,null,null,null,@Bar()})");
- }
-
- public void testNewNormalAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] nestedAnnotations(); String value();");
- this.createTestType("@annot.Foo(\"something\")");
- this.assertSourceDoesNotContain("@Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@Foo(value=\"something\", nestedAnnotations={null,null,null,null,null,@Bar()})");
- }
-
- public void testNewNormalAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo({\"one\", \"two\"})");
- String expected = "@annot.Foo({@Bar(xxx=88), \"two\"})";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation11(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation11(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo({\"one\", \"two\"})");
- this.assertSourceDoesNotContain("@Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@Bar()})"); // split line
- }
-
- public void testNewNormalAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo(7)");
- String expected = "@annot.Foo(@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation13(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation13(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation14() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo(7)");
- this.assertSourceDoesNotContain("@Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@annot.Foo({7,null,null,null,null,@Bar()})");
- }
-
- public void testNewNormalAnnotation15() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int xxx();");
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] value();");
- this.createTestType("@annot.Foo(@annot.NotBar)");
- String expected = "@annot.Foo(@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation15(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation15(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation16() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo(@annot.Bar(55))");
- String expected = "@annot.Foo({@annot.Bar(55),@Bar(xxx=88)})";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation16(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation16(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation17() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- String expected = "@annot.Foo(nestedAnnotations={@Bar(xxx=88)})";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation17(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation17(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation18() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations={\"something\"})");
- this.assertSourceDoesNotContain("@Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@Bar()})"); // split line
- }
-
- public void testNewNormalAnnotation19() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=\"something\")");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation19(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation19(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation20() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int xxx();");
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation20(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation20(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testNewNormalAnnotation21() throws Exception {
- this.createAnnotationAndMembers("NotBar", "int xxx();");
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.NotBar)");
- this.assertSourceDoesNotContain("@Bar");
-
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 5, "annot.Bar");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newNormalAnnotation();
- this.assertSourceContains("@annot.Foo(nestedAnnotations={@annot.NotBar,null,null,null,null,@Bar()})");
- }
-
- public void testNewNormalAnnotation22() throws Exception {
- this.createAnnotationAndMembers("Bar", "int xxx();");
- this.createAnnotationAndMembers("Foo", "Object[] nestedAnnotations();");
- this.createTestType("@annot.Foo(nestedAnnotations=@annot.Bar(77))");
- String expected = "@annot.Foo(nestedAnnotations=@Bar(xxx=88))";
- this.assertSourceDoesNotContain(expected);
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NestedIndexedDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation22(declaration);
- }
- });
- this.assertSourceContains(expected);
- }
-
- void editNewNormalAnnotation22(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "nestedAnnotations", 0, "annot.Bar");
- NormalAnnotation annotation = daa.newNormalAnnotation(declaration);
- this.addMemberValuePair(annotation, "xxx", 88);
- }
-
- public void testMoveAnnotation1() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo(@annot.Bar(00))");
- String expected = "@annot.Foo({null,@annot.Bar(00)})";
- this.assertSourceDoesNotContain(expected);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation2() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo({null, @annot.Bar(11)})");
- String expected = "@annot.Foo(@annot.Bar(11))";
- this.assertSourceDoesNotContain(expected);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation3() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22), @annot.Bar(33)})");
- String expected = "@annot.Foo({@annot.Bar(33), @annot.Bar(11), @annot.Bar(22)})";
- this.assertSourceDoesNotContain(expected);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation4() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22), @annot.Bar(33), @annot.Bar(44)})");
- String expected = "@annot.Foo({@annot.Bar(33), @annot.Bar(11), @annot.Bar(22), null, @annot.Bar(44)})";
- this.assertSourceDoesNotContain(expected);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation5() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22)})");
- String expected = "@annot.Foo({@annot.Bar(00), @annot.Bar(11), null, @annot.Bar(22)})";
- this.assertSourceDoesNotContain(expected);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation6() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22)})");
- String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22), @annot.Bar(00)})";
- this.assertSourceDoesNotContain(expected);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation7() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22)})");
- String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22)})";
- this.assertSourceDoesNotContain(expected);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa);
- Annotation annotation = iaa.getAnnotation();
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation8() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), @annot.Bar(22), null, @annot.Bar(44)})");
- String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22), null, @annot.Bar(44)})";
- this.assertSourceDoesNotContain(expected);
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa);
- Annotation annotation = iaa.getAnnotation();
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation9() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- String expected = "@annot.Foo({null, @annot.Bar(11), @annot.Bar(22)})";
- this.createTestType(expected); // the source should be unchanged
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 0, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa);
- Annotation annotation = iaa.getAnnotation();
- assertNull(annotation);
-
- iaa.moveAnnotation(3);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation10() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11)})");
- String expected = "@annot.Foo(@annot.Bar(00))";
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa);
- Annotation annotation = iaa.getAnnotation();
- assertNull(annotation);
- iaa.moveAnnotation(1);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation11() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo(@annot.Bar(00))");
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 1, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa);
- Annotation annotation = iaa.getAnnotation();
- assertNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceDoesNotContain("Foo");
- }
-
- public void testMoveAnnotation12() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo({@annot.Bar(00), null, @annot.Bar(22)})");
- String expected = "@annot.Foo(@annot.Bar(22))";
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 2, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- }
-
- public void testMoveAnnotation13() throws Exception {
- this.createAnnotationAndMembers("Bar", "int value();");
- this.createAnnotationAndMembers("Foo", "annot.Bar[] value();");
- this.createTestType("@annot.Foo({@annot.Bar(00), @annot.Bar(11), null, @annot.Bar(33)})");
- String expected = "@annot.Foo({@annot.Bar(33), @annot.Bar(11)})";
-
- IndexedDeclarationAnnotationAdapter idaa = new NestedIndexedDeclarationAnnotationAdapter(
- new SimpleDeclarationAnnotationAdapter("annot.Foo"), "value", 3, "annot.Bar");
- IndexedAnnotationAdapter iaa = new MemberIndexedAnnotationAdapter(this.idField(), idaa);
- Annotation annotation = iaa.getAnnotation();
- assertNotNull(annotation);
-
- iaa.moveAnnotation(0);
- this.assertSourceContains(expected);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/SimpleDeclarationAnnotationAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/SimpleDeclarationAnnotationAdapterTests.java
deleted file mode 100644
index 0e014b66b5..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/SimpleDeclarationAnnotationAdapterTests.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.core.tests.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.ModifiedDeclaration;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-
-public class SimpleDeclarationAnnotationAdapterTests extends AnnotationTestCase {
-
- public SimpleDeclarationAnnotationAdapterTests(String name) {
- super(name);
- }
-
- private void createAnnotation(String annotationName) throws Exception {
- this.javaProject.createType("annot", annotationName + ".java", "public @interface " + annotationName + " {}");
- }
-
- public void testGetAnnotation1() throws Exception {
- this.createAnnotation("Foo");
- this.createTestType("@annot.Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
- assertEquals("annot.Foo", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testGetAnnotation2() throws Exception {
- this.createAnnotation("Foo");
- this.createTestType("@annot.Foo(1) @annot.Foo(2)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
- assertEquals("annot.Foo", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isSingleMemberAnnotation());
- Expression value = ((SingleMemberAnnotation) annotation).getValue();
- assertEquals(ASTNode.NUMBER_LITERAL, value.getNodeType());
- assertEquals("1", ((NumberLiteral) value).getToken());
- }
-
- public void testGetAnnotation3() throws Exception {
- this.createAnnotation("Foo");
- this.createTestType("annot.Foo", "@Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
- assertEquals("Foo", annotation.getTypeName().getFullyQualifiedName());
- assertTrue(annotation.isMarkerAnnotation());
- }
-
- public void testGetAnnotationNull1() throws Exception {
- this.createAnnotation("Foo");
- this.createTestType();
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- }
-
- public void testGetAnnotationNull2() throws Exception {
- this.createAnnotation("Foo");
- this.createAnnotation("Fop");
- this.createTestType("@annot.Fop");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- this.assertSourceContains("@annot.Fop");
- }
-
- public void testGetAnnotationNull3() throws Exception {
- this.createAnnotation("Foo");
- this.createTestType("@annot.Foo");
- // un-qualified name
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
- this.assertSourceContains("@annot.Foo");
- }
-
- public void testRemoveAnnotation1() throws Exception {
- this.createAnnotation("Foo");
- this.createTestType("@annot.Foo");
- this.assertSourceContains("@annot.Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("@annot.Foo");
- }
-
- public void testRemoveAnnotation2() throws Exception {
- this.createAnnotation("Foo");
- this.createTestType("@annot.Foo(1) @annot.Foo(2)");
- this.assertSourceContains("@annot.Foo(1) @annot.Foo(2)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.removeAnnotation();
- this.assertSourceDoesNotContain("@annot.Foo(1)");
- this.assertSourceContains("@annot.Foo(2)");
- }
-
- public void testNewMarkerAnnotation1() throws Exception {
- this.createAnnotation("Foo");
- this.createTestType();
- this.assertSourceDoesNotContain("@annot.Foo");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("import annot.Foo;");
- this.assertSourceContains("@Foo");
- }
-
- public void testNewMarkerAnnotation2() throws Exception {
- this.createAnnotation("Foo");
- this.createTestType("@annot.Foo(88)");
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(), daa);
- Annotation annotation = aa.getAnnotation();
- assertNotNull(annotation);
-
- aa.newMarkerAnnotation();
- this.assertSourceContains("import annot.Foo;");
- this.assertSourceContains("@Foo");
- this.assertSourceDoesNotContain("@annot.Foo(88)");
- }
-
- public void testNewSingleMemberAnnotation() throws Exception {
- this.createAnnotation("Foo");
- this.createTestType();
- this.assertSourceDoesNotContain("@Foo");
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SimpleDeclarationAnnotationAdapterTests.this.editNewSingleMemberAnnotation(declaration);
- }
- });
- this.assertSourceContains("import annot.Foo;");
- this.assertSourceContains("@Foo(\"test string literal\")");
- }
-
- void editNewSingleMemberAnnotation(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- SingleMemberAnnotation annotation = (SingleMemberAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newSingleMemberAnnotation(declaration);
- StringLiteral stringLiteral = annotation.getAST().newStringLiteral();
- stringLiteral.setLiteralValue("test string literal");
- annotation.setValue(stringLiteral);
- }
-
- public void testNewNormalAnnotation() throws Exception {
- this.createAnnotation("Foo");
- this.createTestType();
- this.assertSourceDoesNotContain("@Foo");
- this.idField().edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SimpleDeclarationAnnotationAdapterTests.this.editNewNormalAnnotation(declaration);
- }
- });
- this.assertSourceContains("import annot.Foo;");
- this.assertSourceContains("@Foo(bar=\"test string literal\")");
- }
-
- void editNewNormalAnnotation(ModifiedDeclaration declaration) {
- DeclarationAnnotationAdapter daa = new SimpleDeclarationAnnotationAdapter("annot.Foo");
- NormalAnnotation annotation = (NormalAnnotation) daa.getAnnotation(declaration);
- assertNull(annotation);
- annotation = daa.newNormalAnnotation(declaration);
- MemberValuePair mvp = this.newMemberValuePair(annotation.getAST(), "bar", "test string literal");
- this.values(annotation).add(mvp);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/TypeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/TypeTests.java
deleted file mode 100644
index 637115678b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jdtutility/TypeTests.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.core.tests.internal.jdtutility;
-
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.core.internal.ITextRange;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-
-public class TypeTests extends AnnotationTestCase {
-
- private IType jdtType;
- private Type testType;
-
-
- public TypeTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.jdtType = this.createTestType();
- this.testType = new Type(this.jdtType);
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.testType = null;
- this.jdtType = null;
- super.tearDown();
- }
-
- public void testGetJdtMember() throws Exception {
- assertEquals(this.jdtType, this.testType.getJdtMember());
- }
-
- public void testIsAbstract() throws Exception {
- assertFalse(this.testType.isAbstract());
- }
-
- public void testTopLevelDeclaringType() throws Exception {
- assertEquals(this.testType, this.testType.topLevelDeclaringType());
- }
-
- public void testGetDeclaringType() throws Exception {
- assertNull(this.testType.getDeclaringType());
- }
-
- public void testGetName() throws Exception {
- assertEquals(TYPE_NAME, this.testType.getName());
- }
-
- public void testTextRange() throws Exception {
- String source = this.jdtType.getOpenable().getBuffer().getContents();
- ITextRange textRange = this.testType.textRange();
- String body = source.substring(textRange.getOffset());
- assertTrue(body.startsWith("public class " + TYPE_NAME));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JptCoreModelTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JptCoreModelTests.java
deleted file mode 100644
index d7d2ffe080..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JptCoreModelTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.core.tests.internal.model;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptCoreModelTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCoreModelTests.class.getPackage().getName());
- suite.addTestSuite(ModelInitializationTests.class);
- return suite;
- }
-
- private JptCoreModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/ModelInitializationTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/ModelInitializationTests.java
deleted file mode 100644
index 620ec258a1..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/ModelInitializationTests.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.core.tests.internal.model;
-
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.core.internal.IJpaModel;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.core.internal.JptCorePlugin;
-import org.eclipse.jpt.core.tests.internal.ProjectUtility;
-import org.eclipse.jpt.core.tests.internal.projects.TestFacetedProject;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class ModelInitializationTests extends TestCase {
- private IJpaModel jpaModel;
-
-
- public ModelInitializationTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- ProjectUtility.deleteAllProjects();
- this.jpaModel = JptCorePlugin.getJpaModel();
- }
-
- @Override
- protected void tearDown() throws Exception {
- ProjectUtility.deleteAllProjects();
- this.jpaModel = null;
- super.tearDown();
- }
-
- /**
- * Builds a project with the java and utility facets installed, and with
- * pre-existing entities added.
- */
- private TestFacetedProject buildTestProject() throws CoreException {
- TestFacetedProject testProject = new TestFacetedProject(ClassTools.shortClassNameForObject(this), true);
- testProject.installFacet("jst.java", "5.0");
- testProject.installFacet("jst.utility", "1.0");
- testProject.createFile(
- new Path("src/test.pkg/TestEntity.java"),
- "package test.pkg; @Entity public class TestEntity {}");
- testProject.createFile(
- new Path("src/test.pkg/TestEntity2.java"),
- "package test.pkg; @Entity public class TestEntity2 {}");
- return testProject;
- }
-
- public void testBasic() {
- assertNotNull(this.jpaModel);
- }
-
- public void testFacetInstallation() throws CoreException {
- TestFacetedProject testProject = buildTestProject();
- assertNull(this.jpaModel.getJpaProject(testProject.getProject()));
- testProject.installFacet("jpt.jpa", "1.0");
- assertEquals(1, CollectionTools.size(this.jpaModel.jpaProjects()));
- IJpaProject jpaProject = this.jpaModel.getJpaProject(testProject.getProject());
- assertNotNull(jpaProject);
- assertEquals(4, CollectionTools.size(jpaProject.jpaFiles()));
- assertNotNull(jpaProject.getJpaFile(testProject.getProject().getFile(new Path("src/test.pkg/TestEntity.java"))));
- assertNotNull(jpaProject.getJpaFile(testProject.getProject().getFile(new Path("src/test.pkg/TestEntity2.java"))));
- }
-
- public void testProjectOpening() throws CoreException {
- TestFacetedProject testProject = buildTestProject();
- testProject.installFacet("jpt.jpa", "1.0");
- testProject.close();
- assertTrue(! testProject.getProject().isOpen());
- testProject.open();
- IJpaProject jpaProject = this.jpaModel.getJpaProject(testProject.getProject());
- assertNotNull(jpaProject);
- assertNotNull(jpaProject.getJpaFile(testProject.getProject().getFile(new Path("src/test.pkg/TestEntity.java"))));
- assertNotNull(jpaProject.getJpaFile(testProject.getProject().getFile(new Path("src/test.pkg/TestEntity2.java"))));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/BaseJpaPlatformTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/BaseJpaPlatformTests.java
deleted file mode 100644
index 94c306e4f0..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/BaseJpaPlatformTests.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.eclipse.jpt.core.tests.internal.platform;
-
-import java.io.IOException;
-import junit.framework.TestCase;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.core.internal.IJpaFile;
-import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal;
-import org.eclipse.jpt.core.internal.content.orm.OrmFactory;
-import org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal;
-import org.eclipse.jpt.core.internal.content.orm.XmlRootContentNode;
-import org.eclipse.jpt.core.internal.content.persistence.JavaClassRef;
-import org.eclipse.jpt.core.internal.content.persistence.Persistence;
-import org.eclipse.jpt.core.internal.content.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.internal.content.persistence.PersistenceXmlRootContentNode;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class BaseJpaPlatformTests extends TestCase
-{
- protected TestJpaProject jpaProject;
-
- protected static final String PROJECT_NAME = "PlatformTestProject";
- protected static final String PACKAGE_NAME = "platform.test";
- protected static final String PERSISTENCE_XML_LOCATION = "src/META-INF/persistence.xml";
- protected static final String ORM_XML_LOCATION = "src/META-INF/orm.xml";
-
-
- public BaseJpaPlatformTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- jpaProject = this.buildJpaProject(PROJECT_NAME, false); // false = no auto-build
- }
-
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild) throws Exception {
- return new TestJpaProject(projectName, autoBuild); // false = no auto-build
- }
-
- @Override
- protected void tearDown() throws Exception {
- jpaProject.dispose();
- jpaProject = null;
- super.tearDown();
- }
-
-
- public void testPersistentTypes() throws CoreException, IOException {
- IFile persistenceXmlIFile = jpaProject.getProject().getFile(PERSISTENCE_XML_LOCATION);
- IJpaFile persistenceXmlJpaFile = jpaProject.getJpaProject().getJpaFile(persistenceXmlIFile);
- PersistenceXmlRootContentNode persistenceRoot = (PersistenceXmlRootContentNode) persistenceXmlJpaFile.getContent();
- Persistence persistence = persistenceRoot.getPersistence();
-
- IFile ormXmlIFile = jpaProject.getProject().getFile(ORM_XML_LOCATION);
- IJpaFile ormXmlJpaFile = jpaProject.getJpaProject().getJpaFile(ormXmlIFile);
- XmlRootContentNode ormRoot = (XmlRootContentNode) ormXmlJpaFile.getContent();
- EntityMappingsInternal entityMappings = ormRoot.getEntityMappings();
-
- // add xml persistent type
- XmlEntityInternal xmlEntity = OrmFactory.eINSTANCE.createXmlEntityInternal();
- xmlEntity.setSpecifiedName("XmlEntity");
- entityMappings.getTypeMappings().add(xmlEntity);
- entityMappings.eResource().save(null);
-
- assertEquals(1, CollectionTools.size(jpaProject.getJpaProject().getPlatform().persistentTypes(PROJECT_NAME)));
-
- // add java persistent type
- jpaProject.createType(PACKAGE_NAME, "JavaEntity.java",
- "@Entity public class JavaEntity {}"
- );
- JavaClassRef javaClassRef = PersistenceFactory.eINSTANCE.createJavaClassRef();
- javaClassRef.setJavaClass(PACKAGE_NAME + ".JavaEntity");
- persistence.getPersistenceUnits().get(0).getClasses().add(javaClassRef);
- persistence.eResource().save(null);
-
- assertEquals(2, CollectionTools.size(jpaProject.getJpaProject().getPlatform().persistentTypes(PROJECT_NAME)));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JptCorePlatformTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JptCorePlatformTests.java
deleted file mode 100644
index 589e63112e..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/platform/JptCorePlatformTests.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.core.tests.internal.platform;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptCorePlatformTests
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCorePlatformTests.class.getName());
-// suite.addTestSuite(BaseJpaPlatformTests.class);
- return suite;
- }
-
- private JptCorePlatformTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestFacetedProject.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestFacetedProject.java
deleted file mode 100644
index 6b638fa21b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestFacetedProject.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.core.tests.internal.projects;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-public class TestFacetedProject extends TestPlatformProject {
- private IFacetedProject facetedProject;
-
-
- // ********** constructors/initialization **********
-
- public TestFacetedProject(String projectName) throws CoreException {
- this(projectName, true);
- }
-
- public TestFacetedProject(String projectName, boolean autoBuild) throws CoreException {
- super(projectName, autoBuild);
- this.facetedProject = this.createFacetedProject();
- }
-
- private IFacetedProject createFacetedProject() throws CoreException {
- return ProjectFacetsManager.create(this.getProject(), true, null); // true = "convert if necessary"
- }
-
-
- // ********** public methods **********
-
- public IFacetedProject getFacetedProject() {
- return this.facetedProject;
- }
-
- public void installFacet(String facetName, String versionName) throws CoreException {
- IProjectFacetVersion facetVersion = ProjectFacetsManager.getProjectFacet(facetName).getVersion(versionName);
- this.facetedProject.installProjectFacet(facetVersion, null, null);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJavaProject.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJavaProject.java
deleted file mode 100644
index a19529b0e1..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJavaProject.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.core.tests.internal.projects;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchConstants;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.core.search.SearchPattern;
-import org.eclipse.jdt.core.search.TypeNameRequestor;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * This builds and holds a "Java" project.
- * Support for adding packages and types.
- */
-public class TestJavaProject extends TestFacetedProject {
-
- private IJavaProject javaProject;
- private IPackageFragmentRoot sourceFolder;
-
-
- // ********** constructors/initialization **********
-
- public TestJavaProject() throws CoreException {
- this("TestJavaProject");
- }
-
- public TestJavaProject(String projectName) throws CoreException {
- this(projectName, false);
- }
-
- public TestJavaProject(String projectName, boolean autoBuild) throws CoreException {
- super(projectName, autoBuild);
- this.installFacet("jst.java", "5.0");
- this.javaProject = JavaCore.create(this.getProject());
- this.sourceFolder = this.javaProject.getPackageFragmentRoot(this.getProject().getFolder("src"));
- }
-
- protected void addJar(String jarPath) throws JavaModelException {
- this.addClasspathEntry(JavaCore.newLibraryEntry(new Path(jarPath), null, null));
- }
-
- private void addClasspathEntry(IClasspathEntry entry) throws JavaModelException {
- this.javaProject.setRawClasspath(CollectionTools.add(this.javaProject.getRawClasspath(), entry), null);
- }
-
-
- // ********** public methods **********
-
- public IPackageFragment createPackage(String packageName) throws CoreException {
- return this.sourceFolder.createPackageFragment(packageName, false, null); // false = "no force"
- }
-
- /**
- * The source should NOT contain a package declaration;
- * it will be added here.
- */
- public IType createType(String packageName, String compilationUnitName, String source) throws CoreException {
- return this.createType(this.createPackage(packageName), compilationUnitName, new SimpleSourceWriter(source));
- }
-
- /**
- * The source should NOT contain a package declaration;
- * it will be added here.
- */
- public IType createType(String packageName, String compilationUnitName, SourceWriter sourceWriter) throws CoreException {
- return this.createType(this.createPackage(packageName), compilationUnitName, sourceWriter);
- }
-
- /**
- * The source should NOT contain a package declaration;
- * it will be added here.
- */
- public IType createType(IPackageFragment packageFragment, String compilationUnitName, SourceWriter sourceWriter) throws CoreException {
- StringBuffer sb = new StringBuffer(2000);
- sb.append("package ").append(packageFragment.getElementName()).append(";").append(CR);
- sb.append(CR);
- sourceWriter.appendSourceTo(sb);
- String source = sb.toString();
- ICompilationUnit cu = packageFragment.createCompilationUnit(compilationUnitName, source, false, null); // false = "no force"
- return cu.findPrimaryType();
- }
-
- public IType findType(String fullyQualifiedName) throws JavaModelException {
- return this.javaProject.findType(fullyQualifiedName);
- }
-
- @Override
- public void dispose() throws CoreException {
- this.waitForIndexer();
- this.sourceFolder = null;
- this.javaProject = null;
- super.dispose();
- }
-
-
- // ********** internal methods **********
-
- private void waitForIndexer() throws JavaModelException {
- new SearchEngine().searchAllTypeNames(
- null,
- SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE,
- null,
- SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE,
- IJavaSearchConstants.CLASS,
- SearchEngine.createJavaSearchScope(new IJavaElement[0]),
- new TypeNameRequestor() {/* do nothing */},
- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null
- );
- }
-
-
- // ********** member classes **********
-
- public interface SourceWriter {
- void appendSourceTo(StringBuffer sb);
- }
-
- public class SimpleSourceWriter implements SourceWriter {
- private final String source;
- public SimpleSourceWriter(String source) {
- super();
- this.source = source;
- }
- public void appendSourceTo(StringBuffer sb) {
- sb.append(source);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java
deleted file mode 100644
index 68f01e8f2b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.core.tests.internal.projects;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.core.internal.IJpaProject;
-import org.eclipse.jpt.core.internal.JptCorePlugin;
-
-public class TestJpaProject extends TestJavaProject {
- private IJpaProject jpaProject;
-
- public static final String JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.jpa.jar";
-
- // ********** constructors/initialization **********
-
- public TestJpaProject() throws CoreException {
- this("TestJpaProject");
- }
-
- public TestJpaProject(String projectName) throws CoreException {
- this(projectName, false);
- }
-
- public TestJpaProject(String projectName, boolean autoBuild) throws CoreException {
- super(projectName, autoBuild);
- this.installFacet("jst.utility", "1.0");
- this.installFacet("jpt.jpa", "1.0");
- this.addJar(this.jarName());
- this.jpaProject = JptCorePlugin.getJpaProject(this.getProject());
- }
-
- protected String jarName() {
- String jarName = System.getProperty(JAR_NAME_SYSTEM_PROPERTY);
- if (jarName == null) {
- throw new RuntimeException("missing Java system property: \"" + JAR_NAME_SYSTEM_PROPERTY + "\"");
- }
- return jarName;
- }
-
-
- // ********** public methods **********
-
- public IJpaProject getJpaProject() {
- return this.jpaProject;
- }
-
- @Override
- public void dispose() throws CoreException {
- this.jpaProject = null;
- super.dispose();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestPlatformProject.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestPlatformProject.java
deleted file mode 100644
index 7fbca7957d..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestPlatformProject.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.core.tests.internal.projects;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * This builds and holds a "general" project.
- * Support for adding natures, folders, and files.
- */
-public class TestPlatformProject {
-
- private final IProject project;
-
- /** carriage return */
- public static final String CR = System.getProperty("line.separator");
-
-
- // ********** constructors/initialization **********
-
- public TestPlatformProject() throws CoreException {
- this(false);
- }
-
- public TestPlatformProject(boolean autoBuild) throws CoreException {
- this("TestProject", autoBuild);
- }
-
- public TestPlatformProject(String projectName, boolean autoBuild) throws CoreException {
- super();
- this.setAutoBuild(autoBuild); // workspace-wide setting
- this.project = this.createPlatformProject(projectName);
- }
-
- private void setAutoBuild(boolean autoBuild) throws CoreException {
- IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription();
- description.setAutoBuilding(autoBuild);
- ResourcesPlugin.getWorkspace().setDescription(description);
- }
-
- private IProject createPlatformProject(String projectName) throws CoreException {
- IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- p.create(null);
- p.open(null);
- return p;
- }
-
-
- // ********** public methods **********
-
- public IProject getProject() {
- return this.project;
- }
-
- public void addProjectNature(String natureID) throws CoreException {
- IProjectDescription description = this.project.getDescription();
- description.setNatureIds((String[]) CollectionTools.add(description.getNatureIds(), natureID));
- this.project.setDescription(description, null);
- }
-
- public void removeProjectNature(String natureID) throws CoreException {
- IProjectDescription description = this.project.getDescription();
- description.setNatureIds((String[]) CollectionTools.removeAllOccurrences(description.getNatureIds(), natureID));
- this.project.setDescription(description, null);
- }
-
- /**
- * Create a folder with the specified name directly under the project.
- */
- public IFolder createFolder(String folderName) throws CoreException {
- return this.createFolder(this.project, new Path(folderName));
- }
-
- /**
- * Create a folder in the specified container with the specified name.
- */
- public IFolder createFolder(IContainer container, String folderName) throws CoreException {
- return this.createFolder(container, new Path(folderName));
- }
-
- /**
- * Create a folder in the specified container with the specified path.
- */
- public IFolder createFolder(IContainer container, IPath folderPath) throws CoreException {
- IFolder folder = container.getFolder(folderPath);
- if ( ! folder.exists()) {
- folder.create(false, true, null); // false = "no force"; true = "local"
- }
- return folder;
- }
-
- /**
- * Create a file with the specified name and content directly under the project.
- */
- public IFile createFile(String fileName, String content) throws CoreException {
- return this.createFile(this.project, fileName, content);
- }
-
- /**
- * Create a file in the specified container with the specified name and content.
- */
- public IFile createFile(IContainer container, String fileName, String content) throws CoreException {
- return createFile(container, new Path(fileName), content);
- }
-
- /**
- * Create a file in the project with the specified [relative] path
- * and content.
- */
- public IFile createFile(IPath filePath, String content) throws CoreException {
- return this.createFile(this.project, filePath, content);
- }
-
- /**
- * Create a file in the specified container with the specified path and content.
- */
- public IFile createFile(IContainer container, IPath filePath, String content) throws CoreException {
- return this.createFile(container, filePath, new ByteArrayInputStream(content.getBytes()));
- }
-
- /**
- * Create a file in the specified container with the specified path and contents.
- */
- public IFile createFile(IContainer container, IPath filePath, InputStream content) throws CoreException {
- int len = filePath.segmentCount() - 1;
- for (int i = 0; i < len; i++) {
- container = container.getFolder(new Path(filePath.segment(i)));
- if ( ! container.exists()) {
- ((IFolder) container).create(true, true, null); // true = "force"; true = "local"
- }
- }
-
- IFile file = container.getFile(new Path(filePath.lastSegment()));
- if (file.exists()) {
- file.delete(true, null); // true = "force"
- }
- file.create(content, true, null); // true = "force"
- return file;
- }
-
- public void open() throws CoreException {
- this.project.open(null);
- waitForJobs();
- }
-
- public void close() throws CoreException {
- this.project.close(null);
- waitForJobs();
- }
-
- public void dispose() throws CoreException {
- this.project.delete(true, true, null); // true = "delete content"; true = "force"
- for (int i = 1; this.project.exists(); i++) {
- waitForJobs();
- System.out.println("Project still exists: " + i);
- }
- }
-
-
- // ********** static methods **********
-
- /**
- * Wait until all background tasks are complete.
- */
- public static void waitForJobs() {
- while (Job.getJobManager().currentJob() != null) {
- try {
- Thread.sleep(100); // let other threads get something done
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/test.xml b/jpa/tests/org.eclipse.jpt.core.tests/test.xml
deleted file mode 100644
index 702dee3626..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/test.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name, and library-file -->
- <property name="plugin-name" value="org.eclipse.jpt.core.tests"/>
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jpt.core.tests.internal.JptCoreTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-</project> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.classpath b/jpa/tests/org.eclipse.jpt.db.tests/.classpath
deleted file mode 100644
index 751c8f2e50..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.db.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.project b/jpa/tests/org.eclipse.jpt.db.tests/.project
deleted file mode 100644
index f5b0127a1e..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.db.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index eb01aca9ac..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,16 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.db.tests
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.jpt.db.tests.internal.JptDbTestsPlugin
-Bundle-Localization: plugin
-Eclipse-LazyStart: false
-Require-Bundle: org.eclipse.core.runtime,
- org.junit,
- org.eclipse.datatools.connectivity,
- org.eclipse.datatools.connectivity.db.generic,
- org.eclipse.jpt.utility,
- org.eclipse.jpt.db
-Export-Package: org.eclipse.jpt.db.tests.internal.platforms
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/build.properties b/jpa/tests/org.eclipse.jpt.db.tests/build.properties
deleted file mode 100644
index cd0d010fd1..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 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
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- plugin.properties
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/derby101.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/derby101.properties
deleted file mode 100644
index 6101413bc8..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/derby101.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 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
-###############################################################################
-# Platform Property names & Default
-#
-# profileName - jpatest
-# profileDescription - JDBC Profile for JPA Testing
-# userName - jpatest
-# userPassword - (empty)
-# databasedriverJarList - (mandatory)
-# databaseName - testdb
-# databaseUrl - (mandatory)
-#
-profileName = derby101
-profileDescription = Derby Embedded JDBC Profile for Testing
-# set user name
-userName = jpatest
-userPassword =
-# set path to Derby driver here (example: databasedriverJarList = c:/derbydb/lib/derby.jar )
-databasedriverJarList =
-databaseName = testdb
-# set database URL here (example: databaseUrl = jdbc:derby:c:/derbydb/testdb;create=true )
-databaseUrl =
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties
deleted file mode 100644
index 498fc7deb5..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 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
-###############################################################################
-# Platform Property names & Default
-#
-# profileName - jpatest
-# profileDescription - JDBC Profile for JPA Testing
-# userName - jpatest
-# userPassword - (empty)
-# databasedriverJarList - jar list separate by comma (mandatory)
-# databaseName - testdb
-# databaseUrl - (mandatory)
-#
-profileName = oracleXE10g
-profileDescription = XE 10g Release 2 (10.2) Thin JDBC Profile for Testing
-userName = scott
-userPassword = tiger
-# set path to Oracle driver here (example: databasedriverJarList = c:/oracle/jdbc/lib/ojdbc14.jar )
-databasedriverJarList =
-databaseName = testdb
-# set database URL here (example: databaseUrl = jdbc:oracle:thin:@localhost:1521:testdb )
-databaseUrl =
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties
deleted file mode 100644
index 3207919153..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 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
-###############################################################################
-# Platform Property names & Default
-#
-# profileName - jpatest
-# profileDescription - JDBC Profile for JPA Testing
-# userName - jpatest
-# userPassword - (empty)
-# databasedriverJarList - jar list separate by comma (mandatory)
-# databaseName - testdb
-# databaseUrl - (mandatory)
-#
-profileName = oracle9i
-profileDescription = Oracle Thin JDBC Profile for Testing
-userName = scott
-userPassword = tiger
-# set path to Oracle driver here (example: databasedriverJarList = c:/oracle/jdbc/lib/ojdbc14.jar )
-databasedriverJarList =
-databaseName = testdb
-# set database URL here (example: databaseUrl = jdbc:oracle:thin:@server:1521:testdb )
-databaseUrl =
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver2005.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver2005.properties
deleted file mode 100644
index 8451351e83..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver2005.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 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
-###############################################################################
-# Platform Property names & Default
-#
-# profileName - jpatest
-# profileDescription - JDBC Profile for JPA Testing
-# userName - jpatest
-# userPassword - (empty)
-# databasedriverJarList - (mandatory)
-# databaseName - testdb
-# databaseUrl - (mandatory)
-#
-profileName = sqlserver2005
-profileDescription = MS SQL Server 2005 JDBC Profile for Testing
-# set user name
-userName =
-userPassword =
-# set path to Derby driver here (example: databasedriverJarList = c:/sqlserver/lib/sqljdbc.jar )
-databasedriverJarList =
-databaseName = testdb
-# set database URL here (example: databaseUrl = jdbc:sqlserver://localhost:1433;databaseName=testdb )
-databaseUrl =
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.db.tests/plugin.properties
deleted file mode 100644
index b04fe27976..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/plugin.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 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 = JPA DB Tests
-providerName = Eclipse.org
-
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java
deleted file mode 100644
index 2326ea3d94..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.swingui.TestRunner;
-import org.eclipse.jpt.db.tests.internal.platforms.AllPlatformTests;
-import org.eclipse.jpt.utility.internal.ClassTools;
-
-/**
- * JptDbTests
- */
-public class JptDbTests {
-
- public static void main( String[] args) {
- TestRunner.main( new String[] { "-c", JptDbTests.class.getName()});
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite( ClassTools.packageNameFor( JptDbTests.class));
-
- suite.addTest( AllPlatformTests.suite());
-
- return suite;
- }
-
- private JptDbTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java
deleted file mode 100644
index dfced34598..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.tests.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * JptDbTestsPlugin
- */
-public class JptDbTestsPlugin extends Plugin {
-
- // The shared instance
- private static JptDbTestsPlugin plugin;
-
- public static final String BUNDLE_ID = "org.eclipse.jpt.db.tests"; //$NON-NLS-1$
-
- /**
- * Returns the shared instance
- */
- public static JptDbTestsPlugin getDefault() {
- return plugin;
- }
-
- /**
- * The constructor
- */
- public JptDbTestsPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java
deleted file mode 100644
index af9c4233cc..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.tests.internal.platforms;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.swingui.TestRunner;
-import org.eclipse.jpt.utility.internal.ClassTools;
-
-/**
- * AllPlatformTests
- */
-public class AllPlatformTests {
-
- public static void main( String[] args) {
- TestRunner.main( new String[] { "-c", AllPlatformTests.class.getName()});
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite( ClassTools.packageNameFor( AllPlatformTests.class));
-
- // TODO - Uncomment the platform to test.
-// suite.addTest( Derby101Tests.suite());
-// suite.addTest( Oracle9iTests.suite());
-// suite.addTest( Oracle10gTests.suite());
-// suite.addTest( SQLServer2005Tests.suite());
-
- return suite;
- }
-
- private AllPlatformTests() {
- super();
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java
deleted file mode 100644
index 46deffc7a6..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java
+++ /dev/null
@@ -1,385 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 - 2007 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.db.tests.internal.platforms;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.NoSuchElementException;
-import java.util.Properties;
-import junit.framework.Assert;
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.datatools.connectivity.ConnectionProfileException;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants;
-import org.eclipse.datatools.connectivity.drivers.IDriverMgmtConstants;
-import org.eclipse.datatools.connectivity.drivers.IPropertySet;
-import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
-import org.eclipse.datatools.connectivity.drivers.XMLFileManager;
-import org.eclipse.datatools.connectivity.internal.ConnectivityPlugin;
-import org.eclipse.jpt.db.internal.Connection;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.ConnectionProfileRepository;
-import org.eclipse.jpt.db.internal.DTPConnectionProfileWrapper;
-import org.eclipse.jpt.db.internal.Database;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.db.tests.internal.JptDbTestsPlugin;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Base class for all supported DTP platform.
- */
-public abstract class DTPPlatformTests extends TestCase {
-
- protected ConnectionProfileRepository connectionRepository;
-
- private Properties platformProperties;
- private String currentDbVendor;
- private String currentDbVersion;
-
- private static final String PLATFORM_CONFIG_DIRECTORY = "config"; //$NON-NLS-1$
-
- private static final String PROFILE_NAME_PROPERTY = "profileName"; //$NON-NLS-1$
- private static final String PROFILE_DESCRIPTION_PROPERTY = "profileDescription"; //$NON-NLS-1$
- private static final String USER_NAME_PROPERTY = "userName"; //$NON-NLS-1$
- private static final String USER_PASSWORD_PROPERTY = "userPassword"; //$NON-NLS-1$
- private static final String DB_DRIVER_JAR_PROPERTY = "databasedriverJarList"; //$NON-NLS-1$
- private static final String DB_NAME_PROPERTY = "databaseName"; //$NON-NLS-1$
- private static final String DB_URL_PROPERTY = "databaseUrl"; //$NON-NLS-1$
-
- private static final String PROFILE_NAME_DEFAULT = "jpatest"; //$NON-NLS-1$
- private static final String PROFILE_DESCRIPTION_DEFAULT = "JDBC Profile for JPA Testing"; //$NON-NLS-1$
- private static final String USER_NAME_DEFAULT = "userName"; //$NON-NLS-1$
- private static final String USER_PASSWORD_DEFAULT = ""; //$NON-NLS-1$
- private static final String DB_NAME_DEFAULT = "testdb"; //$NON-NLS-1$
-
- private static final String MISSING_PROPERTY_MESSAGE = "Enter missing property in platform config file (config/database.properties)";
-
- public DTPPlatformTests( String name) {
- super( name);
-
- this.connectionRepository = ConnectionProfileRepository.instance();
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- this.connectionRepository.initializeListeners();
-
- if( this.platformIsNew()) {
- this.loadPlatformProperties();
-
- this.buildDriverDefinitionFile( IDriverMgmtConstants.DRIVER_FILE);
- this.buildConnectionProfile( this.profileName());
- this.currentDbVendor = this.databaseVendor();
- this.currentDbVersion = this.databaseVersion();
- }
- this.verifyProfileNamed( this.profileName());
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
-
- this.connectionRepository.disposeListeners();
- }
-
- // ********** tests **********
-
- public void testConnection() throws Exception {
-
- this.connect();
-
- this.verifyDatabaseVersionNumber();
- this.verifyConnection();
- this.verifyDatabaseContent();
-
- this.disconnect();
- }
-
- public void testGetProfiles() {
- // Getting the profile directly from DTP ProfileManager
- IConnectionProfile[] profiles = ProfileManager.getInstance().getProfiles();
- Assert.assertNotNull( profiles);
- Assert.assertTrue( profiles.length > 0);
- }
-
- public void testGetProfilesByProvider() {
- // Get Profiles By ProviderID
- IConnectionProfile[] profiles = ProfileManager.getInstance().getProfileByProviderID( this.getProfile().getProviderId());
- Assert.assertNotNull( profiles);
- Assert.assertTrue( profiles.length > 0);
- }
-
- public void testGetProfileByName() {
- // Get Profile By Name
- IConnectionProfile dtpProfile = ProfileManager.getInstance().getProfileByName( this.profileName());
- Assert.assertNotNull( dtpProfile);
- Assert.assertTrue( dtpProfile.getName().equals( this.profileName()));
- }
-
- public void testGetProfileByInstanceId() {
- // Get Profile By InstanceID
- IConnectionProfile dtpProfile = ProfileManager.getInstance().getProfileByInstanceID( this.getProfile().getInstanceId());
- Assert.assertNotNull( dtpProfile);
- Assert.assertTrue( dtpProfile.getName().equals( this.profileName()));
- }
-
- // ********** internal tests **********
-
- private void verifyDatabaseVersionNumber() {
- Database database = this.getProfile().getDatabase();
- Assert.assertNotNull( database);
-
- String actualVersionNumber = database.getVersion();
- String expectedVersionNumber = this.databaseVersion();
- String errorMessage = "Expected version number: " + expectedVersionNumber + " but the actual version number was: " + actualVersionNumber;
- assertTrue( errorMessage, actualVersionNumber.indexOf( expectedVersionNumber) != -1);
-
- String actualVendor = database.getVendor();
- String expectedVendor = this.databaseVendor();
- errorMessage = "Expected vendor: " + expectedVendor + " but the actual vendor was: " + actualVendor;
- assertEquals( errorMessage, actualVendor, expectedVendor);
- }
-
- private void verifyConnection() {
- Connection connection = this.getProfile().getConnection();
- Assert.assertNotNull( connection);
-
- String actualFactory = connection.getFactoryId();
- String expectedFactory = DTPConnectionProfileWrapper.CONNECTION_TYPE;
- String errorMessage = "Expected factory: " + expectedFactory + " but the actual factory was: " + actualFactory;
- assertEquals( errorMessage, actualFactory, expectedFactory);
- }
-
- private void verifyDatabaseContent() {
- Database database = this.getProfile().getDatabase();
- Assert.assertTrue( database.schemataSize() > 0);
-
- Schema schema = database.schemaNamed( this.getProfile().getUserName());
- if( schema != null) {
- Assert.assertTrue( schema.sequencesSize() >= 0);
-
- Object[] tableNames = CollectionTools.array( schema.tableNames());
- if( tableNames.length >= 1) {
- Table table = schema.tableNamed(( String)tableNames[ 0]);
- Assert.assertTrue( table.columnsSize() >= 0);
- Assert.assertTrue( table.foreignKeyColumnsSize() >= 0);
- Assert.assertTrue( table.foreignKeysSize() >= 0);
- Assert.assertTrue( table.primaryKeyColumnsSize() >= 0);
- }
- }
- }
-
- private void verifyProfileNamed( String profileName) {
-
- ConnectionProfile profile = this.getProfileNamed( profileName);
- Assert.assertTrue( "ConnectionProfile not found", profileName.equals( profile.getName()));
- }
-
- // ***** Platform specific behavior *****
-
- protected abstract String databaseVendor();
- protected abstract String databaseVersion();
-
- protected abstract String driverName();
- protected abstract String driverDefinitionType();
- protected abstract String driverDefinitionId();
- protected abstract String driverClass();
-
- protected abstract String getConfigName();
-
- // ***** Behavior *****
-
- protected void connect() {
-
- this.getProfile().connect();
- Assert.assertTrue( "Connect failed.", this.getProfile().isConnected());
- }
-
- protected void disconnect() {
-
- this.getProfile().disconnect();
- Assert.assertFalse( "Disconnect failed.", this.getProfile().isConnected());
- }
-
- // ********** queries **********
-
- protected Schema getSchemaNamed( String schemaName) {
-
- return this.getProfile().getDatabase().schemaNamed( schemaName);
- }
-
- protected Collection getTables() {
-
- Schema schema = this.getSchemaNamed( this.getProfile().getUserName());
- if( schema == null) {
- return new ArrayList();
- }
- return CollectionTools.collection( schema.tables());
- }
-
- protected Table getTableNamed( String tableName) {
-
- Schema schema = this.getSchemaNamed( this.getProfile().getUserName());
- Assert.assertNotNull( schema);
-
- return schema.tableNamed( tableName);
- }
-
- protected String providerId() {
- return DTPConnectionProfileWrapper.CONNECTION_PROFILE_TYPE;
- }
-
- protected String passwordIsSaved() {
- return "true";
- }
-
- protected String profileName() {
- return this.platformProperties.getProperty( PROFILE_NAME_PROPERTY, PROFILE_NAME_DEFAULT);
- }
-
- protected String profileDescription() {
- return this.platformProperties.getProperty( PROFILE_DESCRIPTION_PROPERTY, PROFILE_DESCRIPTION_DEFAULT);
- }
-
- protected String userName() {
- return this.platformProperties.getProperty( USER_NAME_PROPERTY, USER_NAME_DEFAULT);
- }
-
- protected String userPassword() {
- return this.platformProperties.getProperty( USER_PASSWORD_PROPERTY, USER_PASSWORD_DEFAULT);
- }
-
- protected String databaseName() {
- return this.platformProperties.getProperty( DB_NAME_PROPERTY, DB_NAME_DEFAULT);
- }
-
- protected String databasedriverJarList() {
- String dbDriverJarList = this.platformProperties.getProperty( DB_DRIVER_JAR_PROPERTY);
- if ( StringTools.stringIsEmpty( dbDriverJarList)) {
- throw new NoSuchElementException( MISSING_PROPERTY_MESSAGE);
- }
- return dbDriverJarList;
- }
-
- protected String databaseUrl() {
- String dbUrl = this.platformProperties.getProperty( DB_URL_PROPERTY);
- if ( StringTools.stringIsEmpty( dbUrl)) {
- throw new NoSuchElementException( MISSING_PROPERTY_MESSAGE);
- }
- return dbUrl;
- }
-
- private ConnectionProfile getProfile() {
-
- return this.getProfileNamed( this.profileName());
- }
-
- protected ConnectionProfile getProfileNamed( String profileName) {
-
- return ConnectionProfileRepository.instance().profileNamed( profileName);
- }
-
- private String getTestPluginBundleId() {
- return JptDbTestsPlugin.BUNDLE_ID;
- }
-
- private IPath getDriverDefinitionLocation() {
- return ConnectivityPlugin.getDefault().getStateLocation();
- }
-
- private String getConfigPath() {
- return this.getConfigDir() + "/" + this.getConfigName();
- }
-
- private String getConfigDir() {
- return PLATFORM_CONFIG_DIRECTORY;
- }
-
- private boolean platformIsNew() {
- return( !this.databaseVendor().equals( this.currentDbVendor) || this.databaseVersion().equals( this.currentDbVersion));
- }
-
- private void loadPlatformProperties() throws IOException {
-
- if( this.platformProperties == null) {
- URL configUrl = Platform.getBundle( this.getTestPluginBundleId()).getEntry( this.getConfigPath());
-
- this.platformProperties = new Properties();
- this.platformProperties.load( configUrl.openStream());
- }
- }
-
- private Properties buildDriverProperties() {
- Properties driverProperties = new Properties();
- driverProperties.setProperty( DTPConnectionProfileWrapper.DRIVER_DEFINITION_TYPE_PROP_ID, this.driverDefinitionType());
- driverProperties.setProperty( DTPConnectionProfileWrapper.DRIVER_JAR_LIST_PROP_ID, this.databasedriverJarList());
- driverProperties.setProperty( IDBDriverDefinitionConstants.USERNAME_PROP_ID, this.userName());
- driverProperties.setProperty( IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, this.driverClass());
- driverProperties.setProperty( IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, this.databaseName());
- driverProperties.setProperty( IDBDriverDefinitionConstants.PASSWORD_PROP_ID, this.userPassword());
- driverProperties.setProperty( IDBDriverDefinitionConstants.URL_PROP_ID, this.databaseUrl());
- driverProperties.setProperty( IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, this.databaseVendor());
- driverProperties.setProperty( IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, this.databaseVersion());
- return driverProperties;
- }
-
- private Properties buildBasicProperties() {
- Properties basicProperties = new Properties();
- basicProperties.setProperty( IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, this.databaseName());
- basicProperties.setProperty( IDBDriverDefinitionConstants.USERNAME_PROP_ID, this.userName());
- basicProperties.setProperty( IDBDriverDefinitionConstants.PASSWORD_PROP_ID, this.userPassword());
- basicProperties.setProperty( DTPConnectionProfileWrapper.DRIVER_DEFINITION_PROP_ID, this.driverDefinitionId());
-
- basicProperties.setProperty( IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, this.driverClass());
- basicProperties.setProperty( IDBDriverDefinitionConstants.URL_PROP_ID, this.databaseUrl());
- basicProperties.setProperty( IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, this.databaseVendor());
- basicProperties.setProperty( IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, this.databaseVersion());
-
- basicProperties.setProperty( DTPConnectionProfileWrapper.DATABASE_SAVE_PWD_PROP_ID, this.passwordIsSaved());
- return basicProperties;
- }
-
- private void buildConnectionProfile( String profileName) throws ConnectionProfileException {
-
- ProfileManager profileManager = ProfileManager.getInstance();
- Assert.assertNotNull( profileManager);
- IConnectionProfile profile = profileManager.getProfileByName( profileName);
- if( profile == null) {
- Properties basicProperties = buildBasicProperties();
- ProfileManager.getInstance().createProfile( profileName, this.profileDescription(), this.providerId(), basicProperties);
- }
- }
-
- private void buildDriverDefinitionFile( String driverFileName) throws CoreException {
-
- XMLFileManager.setStorageLocation( this.getDriverDefinitionLocation());
- XMLFileManager.setFileName( driverFileName);
- IPropertySet[] propsets = new IPropertySet[ 1];
- String driverName = this.driverName();
- String driverId = this.driverDefinitionId();
- PropertySetImpl propertySet = new PropertySetImpl( driverName, driverId);
- propertySet.setProperties( driverId, this.buildDriverProperties());
- propsets[ 0] = propertySet;
-
- XMLFileManager.saveNamedPropertySet( propsets);
-
- File driverDefinitioneFile = this.getDriverDefinitionLocation().append( driverFileName).toFile();
- Assert.assertTrue( driverDefinitioneFile.exists());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Derby101Tests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Derby101Tests.java
deleted file mode 100644
index 7e510cfd43..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Derby101Tests.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.tests.internal.platforms;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.swingui.TestRunner;
-
-/**
- * Derby 10.1 Embedded Driver Test
- */
-public class Derby101Tests extends DTPPlatformTests {
-
- public static void main( String[] args) {
- TestRunner.main( new String[] { "-c", Derby101Tests.class.getName()});
- }
-
- public static Test suite() {
- return new TestSuite( Derby101Tests.class);
- }
-
- public Derby101Tests( String name) {
- super( name);
- }
-
- protected String databaseVendor() {
- return "Derby";
- }
-
- protected String databaseVersion() {
- return "10.1";
- }
-
- protected String providerId() {
- return "org.eclipse.datatools.connectivity.db.derby.embedded.connectionProfile";
- }
-
- protected String driverName() {
- return "Derby Embedded JDBC Driver";
- }
-
- protected String driverDefinitionType() {
- return "org.eclipse.datatools.connectivity.db.derby101.genericDriverTemplate";
- }
-
- protected String driverDefinitionId() {
- return "DriverDefn.Derby Embedded JDBC Driver";
- }
-
- protected String driverClass() {
- return "org.apache.derby.jdbc.EmbeddedDriver";
- }
-
- protected String getConfigName() {
- return "derby101.properties";
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java
deleted file mode 100644
index 70d3a3d55f..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.tests.internal.platforms;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.swingui.TestRunner;
-
-/**
- * Oracle 10g Thin Driver Test
- */
-public class Oracle10gTests extends DTPPlatformTests {
-
- public static void main( String[] args) {
- TestRunner.main( new String[] { "-c", Oracle10gTests.class.getName()});
- }
-
- public static Test suite() {
- return new TestSuite( Oracle10gTests.class);
- }
-
- public Oracle10gTests( String name) {
- super( name);
- }
-
- protected String databaseVendor() {
- return "Oracle";
- }
-
- protected String databaseVersion() {
- return "10";
- }
-
- protected String driverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- protected String driverDefinitionId() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- protected String driverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.10.driverTemplate";
- }
-
- protected String driverName() {
- return "Oracle 10g Thin Driver";
- }
-
- protected String getConfigName() {
- return "oracle10g.properties";
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java
deleted file mode 100644
index 3923081244..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.db.tests.internal.platforms;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.swingui.TestRunner;
-
-/**
- * Oracle 9i Thin Driver Test
- */
-public class Oracle9iTests extends DTPPlatformTests {
-
- public static void main( String[] args) {
- TestRunner.main( new String[] { "-c", Oracle9iTests.class.getName()});
- }
-
- public static Test suite() {
- return new TestSuite( Oracle9iTests.class);
- }
-
- public Oracle9iTests( String name) {
- super( name);
- }
-
- protected String databaseVendor() {
- return "Oracle";
- }
-
- protected String databaseVersion() {
- return "9";
- }
-
- protected String driverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- protected String driverDefinitionId() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- protected String driverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.9.driverTemplate";
- }
-
- protected String driverName() {
- return "Oracle 9i Thin Driver";
- }
-
- protected String getConfigName() {
- return "oracle9i.properties";
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServer2005Tests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServer2005Tests.java
deleted file mode 100644
index a0f5034f6d..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServer2005Tests.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.db.tests.internal.platforms;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.swingui.TestRunner;
-
-/**
- * SQL Server 2005 Driver Test
- */
-public class SQLServer2005Tests extends DTPPlatformTests {
-
- public static void main( String[] args) {
- TestRunner.main( new String[] { "-c", SQLServer2005Tests.class.getName()});
- }
-
- public static Test suite() {
- return new TestSuite( SQLServer2005Tests.class);
- }
-
- public SQLServer2005Tests( String name) {
- super( name);
- }
-
- protected String databaseVendor() {
- return "SQLServer";
- }
-
- protected String databaseVersion() {
- return "2005";
- }
-
- protected String providerId() {
- return "org.eclipse.datatools.connectivity.db.generic.connectionProfile";
- }
-
- protected String driverName() {
- return "Microsoft SQL Server 2005 JDBC Driver";
- }
-
- protected String driverDefinitionType() {
- return "org.eclipse.datatools.enablement.msft.sqlserver.2005.driverTemplate";
- }
-
- protected String driverDefinitionId() {
- return "DriverDefn.Microsoft SQL Server 2005 JDBC Driver";
- }
-
- protected String driverClass() {
- return "com.microsoft.sqlserver.jdbc.SQLServerDriver";
- }
-
- protected String getConfigName() {
- return "sqlserver2005.properties";
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.classpath b/jpa/tests/org.eclipse.jpt.utility.tests/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.project b/jpa/tests/org.eclipse.jpt.utility.tests/.project
deleted file mode 100644
index aa5271e003..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.utility.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index c74f41d1cd..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:11:44 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 84b5c4c710..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:55:58 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 1870613633..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,12 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.utility.tests
-Bundle-Version: 1.0.0
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.jpt.utility,
- org.junit;bundle-version="[3.0.0,4.0.0)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jpt.utility.tests.internal;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.iterators;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/about.html b/jpa/tests/org.eclipse.jpt.utility.tests/about.html
deleted file mode 100644
index 9e73bdabb6..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>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
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>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
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/build.properties b/jpa/tests/org.eclipse.jpt.utility.tests/build.properties
deleted file mode 100644
index ebe9c08ef9..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 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
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties
deleted file mode 100644
index 9995768587..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 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 = Java Persistence API Utility Tests
-providerName = Eclipse.org
-
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java
deleted file mode 100644
index ed3e6f2814..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 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.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.BitTools;
-
-public class BitToolsTests extends TestCase {
-
- public BitToolsTests(String name) {
- super(name);
- }
-
- public void testAllFlagsAreSetIntInt() {
- assertTrue(BitTools.allFlagsAreSet(0x0003, 0x0001));
- assertTrue(BitTools.allFlagsAreSet(0x0303, 0x0001));
- assertTrue(BitTools.allFlagsAreSet(0x0303, 0x0101));
- assertTrue(BitTools.allFlagsAreSet(0x0303, 0x0103));
-
- assertFalse(BitTools.allFlagsAreSet(0x0303, 0x1103));
- assertFalse(BitTools.allFlagsAreSet(0x0000, 0x1103));
- }
-
- public void testAllFlagsAreSetIntIntArray() {
- assertTrue(BitTools.allFlagsAreSet(0x0003, new int[] { 0x0001 }));
- assertTrue(BitTools.allFlagsAreSet(0x0303, new int[] { 0x0001 }));
- assertTrue(BitTools.allFlagsAreSet(0x0303, new int[] { 0x0100, 0x0001 }));
- assertTrue(BitTools.allFlagsAreSet(0x0303, new int[] { 0x0100, 0x0002, 0x0001 }));
-
- assertFalse(BitTools.allFlagsAreSet(0x0303, new int[] { 0x1000, 0x0100, 0x0002, 0x0001 }));
- assertFalse(BitTools.allFlagsAreSet(0x0000, new int[] { 0x1000, 0x0100, 0x0002, 0x0001 }));
- }
-
- public void testAnyFlagsAreSetIntInt() {
- assertTrue(BitTools.anyFlagsAreSet(0x0003, 0x0001));
- assertTrue(BitTools.anyFlagsAreSet(0xFFFF, 0x0001));
- assertTrue(BitTools.anyFlagsAreSet(0x0003, 0xFFFF));
-
- assertFalse(BitTools.anyFlagsAreSet(0x0303, 0x1010));
- assertFalse(BitTools.anyFlagsAreSet(0x0000, 0xFFFF));
- }
-
- public void testAnyFlagsAreSetIntIntArray() {
- assertTrue(BitTools.anyFlagsAreSet(0x0003, new int[] { 0x0001 }));
- assertTrue(BitTools.anyFlagsAreSet(0xFFFF, new int[] { 0x0001 }));
- assertTrue(BitTools.anyFlagsAreSet(0x0303, new int[] { 0xF000, 0x0F00, 0x00F0, 0x000F }));
-
- assertFalse(BitTools.anyFlagsAreSet(0x0303, new int[] { 0x1000, 0x0010 }));
- assertFalse(BitTools.anyFlagsAreSet(0x0000, new int[] { 0xF000, 0x0F00, 0x00F0, 0x000F }));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java
deleted file mode 100644
index 504b621daa..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java
+++ /dev/null
@@ -1,548 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-import java.util.Map.Entry;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-public class ClassToolsTests extends TestCase {
-
- private static String testStaticField;
-
- public ClassToolsTests(String name) {
- super(name);
- }
-
- /**
- * Return the compiler-generated class name. The Eclipse compiler generates
- * "local" classes with names in the form "com.foo.Outer$1$Local"; while the
- * JDK compiler generates "com.foo.Outer$1Local". There might be other
- * differences.... ~bjv
- */
- public static String compilerDependentClassNameFor(String className) {
- int index = className.indexOf("$1$");
- if (index == -1) {
- return className;
- }
- try {
- Class.forName(className);
- } catch (ClassNotFoundException ex) {
- return className.substring(0, index + 2) + className.substring(index + 3);
- }
- return className;
- }
-
- private static String munge(String className) {
- return compilerDependentClassNameFor(className);
- }
-
- public void testAllFields() {
- int fieldCount = 0;
- fieldCount += java.util.Vector.class.getDeclaredFields().length;
- fieldCount += java.util.AbstractList.class.getDeclaredFields().length;
- fieldCount += java.util.AbstractCollection.class.getDeclaredFields().length;
- fieldCount += java.lang.Object.class.getDeclaredFields().length;
- Field[] fields = ClassTools.allFields(java.util.Vector.class);
- assertEquals(fieldCount, fields.length);
- assertTrue(CollectionTools.contains(this.names(fields), "modCount"));
- assertTrue(CollectionTools.contains(this.names(fields), "serialVersionUID"));
- assertTrue(CollectionTools.contains(this.names(fields), "capacityIncrement"));
- assertTrue(CollectionTools.contains(this.names(fields), "elementCount"));
- assertTrue(CollectionTools.contains(this.names(fields), "elementData"));
- assertTrue(fields[0].isAccessible());
- }
-
- public void testAllMethods() {
- int methodCount = 0;
- methodCount += java.util.Vector.class.getDeclaredMethods().length;
- methodCount += java.util.AbstractList.class.getDeclaredMethods().length;
- methodCount += java.util.AbstractCollection.class.getDeclaredMethods().length;
- methodCount += java.lang.Object.class.getDeclaredMethods().length;
- Method[] methods = ClassTools.allMethods(java.util.Vector.class);
- assertEquals(methodCount, methods.length);
- assertTrue(CollectionTools.contains(this.names(methods), "wait"));
- assertTrue(CollectionTools.contains(this.names(methods), "addElement"));
- assertTrue(methods[0].isAccessible());
- }
-
- public void testNewInstanceClass() {
- Vector<?> v = ClassTools.newInstance(java.util.Vector.class);
- assertNotNull(v);
- assertEquals(0, v.size());
- }
-
- public void testNewInstanceClassClassObject() {
- int initialCapacity = 200;
- Vector<?> v = ClassTools.newInstance(java.util.Vector.class, int.class, new Integer(initialCapacity));
- assertNotNull(v);
- assertEquals(0, v.size());
- Object[] elementData = (Object[]) ClassTools.getFieldValue(v, "elementData");
- assertEquals(initialCapacity, elementData.length);
- }
-
- public void testNewInstanceClassClassArrayObjectArray() {
- int initialCapacity = 200;
- Class<?>[] parmTypes = new Class[1];
- parmTypes[0] = int.class;
- Object[] parms = new Object[1];
- parms[0] = new Integer(initialCapacity);
- Vector<?> v = ClassTools.newInstance(java.util.Vector.class, parmTypes, parms);
- assertNotNull(v);
- assertEquals(0, v.size());
- Object[] elementData = (Object[]) ClassTools.getFieldValue(v, "elementData");
- assertEquals(initialCapacity, elementData.length);
-
- parms[0] = new Integer(-1);
- boolean exCaught = false;
- try {
- v = ClassTools.newInstance(java.util.Vector.class, parmTypes, parms);
- } catch (RuntimeException ex) {
- exCaught = true;
- }
- assertTrue("RuntimeException not thrown", exCaught);
-
- parmTypes[0] = java.lang.String.class;
- parms[0] = "foo";
- exCaught = false;
- try {
- v = ClassTools.attemptNewInstance(java.util.Vector.class, parmTypes, parms);
- } catch (NoSuchMethodException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchMethodException not thrown", exCaught);
- }
-
- public void testGetFieldValue() {
- int initialCapacity = 200;
- Vector<?> v = new Vector<Object>(initialCapacity);
- Object[] elementData = (Object[]) ClassTools.getFieldValue(v, "elementData");
- assertEquals(initialCapacity, elementData.length);
-
- // test inherited field
- Integer modCountInteger = (Integer) ClassTools.getFieldValue(v, "modCount");
- int modCount = modCountInteger.intValue();
- assertEquals(0, modCount);
-
- boolean exCaught = false;
- Object bogusFieldValue = null;
- try {
- bogusFieldValue = ClassTools.attemptToGetFieldValue(v, "bogusField");
- } catch (NoSuchFieldException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchFieldException not thrown: " + bogusFieldValue, exCaught);
- }
-
- public void testExecuteMethodObjectString() {
- Vector<String> v = new Vector<String>();
- int size = ((Integer) ClassTools.executeMethod(v, "size")).intValue();
- assertEquals(0, size);
-
- v.addElement("foo");
- size = ((Integer) ClassTools.executeMethod(v, "size")).intValue();
- assertEquals(1, size);
- }
-
- public void testExecuteMethodObjectStringClassObject() {
- Vector<String> v = new Vector<String>();
- boolean booleanResult = ((Boolean) ClassTools.executeMethod(v, "add", Object.class, "foo")).booleanValue();
- assertTrue(booleanResult);
- assertTrue(v.contains("foo"));
- Object voidResult = ClassTools.executeMethod(v, "addElement", Object.class, "bar");
- assertNull(voidResult);
- }
-
- public void testExecuteMethodObjectStringClassArrayObjectArray() {
- Vector<String> v = new Vector<String>();
- Class<?>[] parmTypes = new Class[1];
- parmTypes[0] = java.lang.Object.class;
- Object[] parms = new Object[1];
- parms[0] = "foo";
- boolean booleanResult = ((Boolean) ClassTools.executeMethod(v, "add", parmTypes, parms)).booleanValue();
- assertTrue(booleanResult);
- assertTrue(v.contains("foo"));
-
- boolean exCaught = false;
- Object bogusMethodReturnValue = null;
- try {
- bogusMethodReturnValue = ClassTools.attemptToExecuteMethod(v, "bogusMethod", parmTypes, parms);
- } catch (NoSuchMethodException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchMethodException not thrown: " + bogusMethodReturnValue, exCaught);
- }
-
- public void testExecuteStaticMethodClassString() {
- Double randomObject = (Double) ClassTools.executeStaticMethod(java.lang.Math.class, "random");
- assertNotNull(randomObject);
- double random = randomObject.doubleValue();
- assertTrue(random >= 0);
- assertTrue(random < 1);
- }
-
- public void testExecuteStaticMethodClassStringClassObject() {
- String s = (String) ClassTools.executeStaticMethod(java.lang.String.class, "valueOf", boolean.class, Boolean.TRUE);
- assertNotNull(s);
- assertEquals("true", s);
- }
-
- public void testExecuteStaticMethodClassStringClassArrayObjectArray() {
- Class<?>[] parmTypes = new Class[1];
- parmTypes[0] = boolean.class;
- Object[] parms = new Object[1];
- parms[0] = Boolean.TRUE;
- String s = (String) ClassTools.executeStaticMethod(java.lang.String.class, "valueOf", parmTypes, parms);
- assertNotNull(s);
- assertEquals("true", s);
-
- boolean exCaught = false;
- Object bogusStaticMethodReturnValue = null;
- try {
- bogusStaticMethodReturnValue = ClassTools.attemptToExecuteStaticMethod(java.lang.String.class, "bogusStaticMethod", parmTypes, parms);
- } catch (NoSuchMethodException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchMethodException not thrown: " + bogusStaticMethodReturnValue, exCaught);
-
- // test non-static method
- exCaught = false;
- try {
- bogusStaticMethodReturnValue = ClassTools.attemptToExecuteStaticMethod(java.lang.String.class, "toString");
- } catch (NoSuchMethodException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchMethodException not thrown: " + bogusStaticMethodReturnValue, exCaught);
- }
-
- public void testSetFieldValue() {
- Vector<String> v = new Vector<String>();
- Object[] newElementData = new Object[5];
- newElementData[0] = "foo";
- ClassTools.setFieldValue(v, "elementData", newElementData);
- ClassTools.setFieldValue(v, "elementCount", new Integer(1));
- // test inherited field
- ClassTools.setFieldValue(v, "modCount", new Integer(1));
- assertTrue(v.contains("foo"));
-
- boolean exCaught = false;
- try {
- ClassTools.attemptToSetFieldValue(v, "bogusField", "foo");
- } catch (NoSuchFieldException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchFieldException not thrown", exCaught);
- }
-
- public void testSetStaticFieldValue() {
- ClassTools.setStaticFieldValue(this.getClass(), "testStaticField", "new value");
- assertEquals(testStaticField, "new value");
-
- boolean exCaught = false;
- try {
- ClassTools.attemptToSetStaticFieldValue(this.getClass(), "bogusStaticField", "new value");
- } catch (NoSuchFieldException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchFieldException not thrown", exCaught);
- }
-
- public void testShortName() {
- assertEquals("Vector", ClassTools.shortClassNameForObject(new java.util.Vector<Object>()));
- assertEquals("Vector", ClassTools.shortNameFor(java.util.Vector.class));
- }
-
- public void testNestedName() {
- Map<String, String> map = new HashMap<String, String>();
- map.put("foo", "bar");
- Entry<String, String> entry = map.entrySet().iterator().next();
- assertEquals("Entry", ClassTools.nestedClassNameForObject(entry));
- assertEquals("Entry", ClassTools.nestedNameFor(java.util.Map.Entry.class));
- }
-
- public void testPackageName() {
- assertEquals("java.util", ClassTools.packageNameFor(java.util.Vector.class));
- assertEquals("java.util", ClassTools.packageNameFor(java.util.Map.Entry.class));
- }
-
- public void testArrayDepthFor() {
- assertEquals(0, ClassTools.arrayDepthFor(java.util.Vector.class));
- assertEquals(0, ClassTools.arrayDepthFor(int.class));
- assertEquals(0, ClassTools.arrayDepthFor(void.class));
- assertEquals(1, ClassTools.arrayDepthFor(java.util.Vector[].class));
- assertEquals(1, ClassTools.arrayDepthFor(int[].class));
- assertEquals(3, ClassTools.arrayDepthFor(java.util.Vector[][][].class));
- assertEquals(3, ClassTools.arrayDepthFor(int[][][].class));
- }
-
- public void testArrayDepthForObject() {
- assertEquals(0, ClassTools.arrayDepthForObject(new java.util.Vector<Object>()));
- assertEquals(1, ClassTools.arrayDepthForObject(new java.util.Vector[0]));
- assertEquals(1, ClassTools.arrayDepthForObject(new int[0]));
- assertEquals(3, ClassTools.arrayDepthForObject(new java.util.Vector[0][0][0]));
- assertEquals(3, ClassTools.arrayDepthForObject(new int[0][0][0]));
- }
-
- public void testArrayDepthForClassNamed() {
- assertEquals(0, ClassTools.arrayDepthForClassNamed(java.util.Vector.class.getName()));
- assertEquals(0, ClassTools.arrayDepthForClassNamed(int.class.getName()));
- assertEquals(0, ClassTools.arrayDepthForClassNamed(void.class.getName()));
- assertEquals(1, ClassTools.arrayDepthForClassNamed(java.util.Vector[].class.getName()));
- assertEquals(1, ClassTools.arrayDepthForClassNamed(int[].class.getName()));
- assertEquals(3, ClassTools.arrayDepthForClassNamed(java.util.Vector[][][].class.getName()));
- assertEquals(3, ClassTools.arrayDepthForClassNamed(int[][][].class.getName()));
- }
-
- public void testElementTypeFor() {
- assertEquals(java.util.Vector.class, ClassTools.elementTypeFor(java.util.Vector.class));
- assertEquals(int.class, ClassTools.elementTypeFor(int.class));
- assertEquals(void.class, ClassTools.elementTypeFor(void.class));
- assertEquals(java.util.Vector.class, ClassTools.elementTypeFor(java.util.Vector[].class));
- assertEquals(int.class, ClassTools.elementTypeFor(int[].class));
- assertEquals(java.util.Vector.class, ClassTools.elementTypeFor(java.util.Vector[][][].class));
- assertEquals(int.class, ClassTools.elementTypeFor(int[][][].class));
- }
-
- public void testElementTypeForObject() {
- assertEquals(java.util.Vector.class, ClassTools.elementTypeForObject(new java.util.Vector<Object>()));
- assertEquals(java.util.Vector.class, ClassTools.elementTypeForObject(new java.util.Vector[0]));
- assertEquals(int.class, ClassTools.elementTypeForObject(new int[0]));
- assertEquals(java.util.Vector.class, ClassTools.elementTypeForObject(new java.util.Vector[0][0][0]));
- assertEquals(int.class, ClassTools.elementTypeForObject(new int[0][0][0]));
- }
-
- public void testElementTypeNameFor() {
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameFor(java.util.Vector.class));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameFor(int.class));
- assertEquals(void.class.getName(), ClassTools.elementTypeNameFor(void.class));
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameFor(java.util.Vector[].class));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameFor(int[].class));
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameFor(java.util.Vector[][][].class));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameFor(int[][][].class));
- }
-
- public void testElementTypeNameForClassNamed() {
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameForClassNamed(java.util.Vector.class.getName()));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameForClassNamed(int.class.getName()));
- assertEquals(void.class.getName(), ClassTools.elementTypeNameForClassNamed(void.class.getName()));
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameForClassNamed(java.util.Vector[].class.getName()));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameForClassNamed(int[].class.getName()));
- assertEquals(java.util.Vector.class.getName(), ClassTools.elementTypeNameForClassNamed(java.util.Vector[][][].class.getName()));
- assertEquals(int.class.getName(), ClassTools.elementTypeNameForClassNamed(int[][][].class.getName()));
- }
-
- public void testClassCodes() {
- assertEquals("byte", ClassTools.classNameForCode('B'));
- assertEquals("char", ClassTools.classNameForCode('C'));
- assertEquals("double", ClassTools.classNameForCode('D'));
- assertEquals("float", ClassTools.classNameForCode('F'));
- assertEquals("int", ClassTools.classNameForCode('I'));
- assertEquals("long", ClassTools.classNameForCode('J'));
- assertEquals("short", ClassTools.classNameForCode('S'));
- assertEquals("boolean", ClassTools.classNameForCode('Z'));
- assertEquals("void", ClassTools.classNameForCode('V'));
-
- boolean exCaught = false;
- try {
- ClassTools.classNameForCode('X');
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown", exCaught);
- }
-
- public void testClassNamedIsTopLevel() throws Exception {
- assertTrue(ClassTools.classNamedIsTopLevel(java.util.Map.class.getName())); // top-level
- assertFalse(ClassTools.classNamedIsTopLevel(java.util.Map.Entry.class.getName())); // member
- assertFalse(ClassTools.classNamedIsTopLevel(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local
- assertFalse(ClassTools.classNamedIsTopLevel(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName()));
- Class<?> localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassTools.classNamedIsTopLevel(array.getClass().getName()));
- }
-
- public void testClassNamedIsMember() throws Exception {
- assertFalse(ClassTools.classNamedIsMember(java.util.Map.class.getName())); // top-level
- assertTrue(ClassTools.classNamedIsMember(java.util.Map.Entry.class.getName())); // member
- assertFalse(ClassTools.classNamedIsMember(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local
- assertFalse(ClassTools.classNamedIsMember(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassTools.classNamedIsMember(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassTools.classNamedIsMember(array.getClass().getName()));
- Class<?> localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassTools.classNamedIsMember(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassTools.classNamedIsMember(array.getClass().getName()));
-
- // test a few edge cases
- assertTrue(ClassTools.classNamedIsMember("java.util.Map$a1"));
- assertTrue(ClassTools.classNamedIsMember("java.util.Map$a1$aaa$bbb"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map$1a1$aaa"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map$1a"));
- assertTrue(ClassTools.classNamedIsMember("java.util.Map$a12345$b12345"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map$12345a"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map$333"));
- assertFalse(ClassTools.classNamedIsMember("java.util.Map3$333"));
- }
-
- public void testClassNamedIsLocal() throws Exception {
- class LocalClass {
- void foo() {
- System.getProperty("foo");
- }
- }
- new LocalClass().foo();
- assertFalse(ClassTools.classNamedIsLocal(java.util.Map.class.getName())); // top-level
- assertFalse(ClassTools.classNamedIsLocal(java.util.Map.Entry.class.getName())); // member
- assertTrue(ClassTools.classNamedIsLocal(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local
- assertFalse(ClassTools.classNamedIsLocal(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName()));
- Class<?> localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassTools.classNamedIsLocal(array.getClass().getName()));
-
- // test a few edge cases
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map$a1"));
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map$a1$aaa$bbb"));
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$11$aaa"));
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$1$a")); // eclipse naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2$abc")); // eclipse naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2$abc1")); // eclipse naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$1a")); // jdk naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2abc")); // jdk naming convention
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$2abc1")); // jdk naming convention
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map$a12345$b12345"));
- assertTrue(ClassTools.classNamedIsLocal("java.util.Map$12345$a1234"));
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map$333"));
- assertFalse(ClassTools.classNamedIsLocal("java.util.Map3$333"));
- }
-
- public void testClassNamedIsAnonymous() throws Exception {
- assertFalse(ClassTools.classNamedIsAnonymous(java.util.Map.class.getName())); // top-level
- assertFalse(ClassTools.classNamedIsAnonymous(java.util.Map.Entry.class.getName())); // member
- assertFalse(ClassTools.classNamedIsAnonymous(Class.forName(munge(this.getClass().getName() + "$1$LocalClass")).getName())); // local
- assertTrue(ClassTools.classNamedIsAnonymous(Class.forName("java.util.Vector$1").getName())); // anonymous
-
- Object[] array = new java.util.Map[0]; // top-level
- assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName()));
- array = new java.util.Map.Entry[0]; // member
- assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName()));
- Class<?> localClass = Class.forName(munge(this.getClass().getName() + "$1$LocalClass")); // local
- array = (Object[]) Array.newInstance(localClass, 0);
- assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName()));
- Class<?> anonClass = Class.forName("java.util.Vector$1"); // local
- array = (Object[]) Array.newInstance(anonClass, 0);
- assertFalse(ClassTools.classNamedIsAnonymous(array.getClass().getName()));
-
- // test a few edge cases
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$a1"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$a1$aaa$bbb"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$1a1$aaa"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$1$a"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$1a"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$a12345$b12345"));
- assertFalse(ClassTools.classNamedIsAnonymous("java.util.Map$12345$a1234"));
- assertTrue(ClassTools.classNamedIsAnonymous("java.util.Map$333"));
- assertTrue(ClassTools.classNamedIsAnonymous("java.util.Map3$333"));
- }
-
- public void testCodeForClass() {
- assertEquals('I', ClassTools.codeForClass(int.class));
- assertEquals('B', ClassTools.codeForClass(byte.class));
- }
-
- public void testCodeForClassNamed() {
- assertEquals('I', ClassTools.codeForClassNamed(int.class.getName()));
- assertEquals('I', ClassTools.codeForClassNamed("int"));
- assertEquals('B', ClassTools.codeForClassNamed(byte.class.getName()));
- assertEquals('B', ClassTools.codeForClassNamed("byte"));
- }
-
- public void testClassForTypeDeclaration() throws Exception {
- assertEquals(int.class, ClassTools.classForTypeDeclaration("int", 0));
- assertEquals(int[].class, ClassTools.classForTypeDeclaration("int", 1));
- assertEquals(int[][][].class, ClassTools.classForTypeDeclaration("int", 3));
-
- assertEquals(Object.class, ClassTools.classForTypeDeclaration("java.lang.Object", 0));
- assertEquals(Object[][][].class, ClassTools.classForTypeDeclaration("java.lang.Object", 3));
-
- assertEquals(void.class, ClassTools.classForTypeDeclaration("void", 0));
- try {
- ClassTools.classForTypeDeclaration(void.class.getName(), 1);
- fail("should not get here...");
- } catch (ClassNotFoundException ex) {
- // expected
- }
- }
-
- public void testClassNameForTypeDeclaration() throws Exception {
- assertEquals(int.class.getName(), ClassTools.classNameForTypeDeclaration("int", 0));
- assertEquals(int[].class.getName(), ClassTools.classNameForTypeDeclaration("int", 1));
- assertEquals(int[][][].class.getName(), ClassTools.classNameForTypeDeclaration("int", 3));
-
- assertEquals(Object.class.getName(), ClassTools.classNameForTypeDeclaration("java.lang.Object", 0));
- assertEquals(Object[][][].class.getName(), ClassTools.classNameForTypeDeclaration("java.lang.Object", 3));
-
- assertEquals(void.class.getName(), ClassTools.classNameForTypeDeclaration("void", 0));
- try {
- ClassTools.classNameForTypeDeclaration(void.class.getName(), 1);
- fail("should not get here...");
- } catch (IllegalArgumentException ex) {
- // expected
- }
- }
-
- private Iterator<String> names(Field[] fields) {
- return new TransformationIterator<Field, String>(CollectionTools.iterator(fields)) {
- @Override
- protected String transform(Field field) {
- return field.getName();
- }
- };
- }
-
- private Iterator<String> names(Method[] methods) {
- return new TransformationIterator<Method, String>(CollectionTools.iterator(methods)) {
- @Override
- protected String transform(Method method) {
- return method.getName();
- }
- };
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java
deleted file mode 100644
index 54beea0c81..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.Classpath;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class ClasspathTests extends TestCase {
- private static final String JAVA_HOME = System.getProperty("java.home");
-
- public ClasspathTests(String name) {
- super(name);
- }
-
- public void testCompressed() {
- String path = "";
-
- // no changes
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\i18n.jar;C:\\jdk\\i18n.jar;C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;;;;C:\\jdk\\jaws.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;;;")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- // no changes
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\..\\jdk\\i18n.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- path = new Classpath(this.morph("C:\\jdk1\\jdk2\\jdk3\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk1\\jdk2\\jdk3\\..\\..\\..\\jdk1\\jdk2\\jdk3\\i18n.jar;C:\\jdk\\jaws.jar")).compressed().path();
- assertEquals(this.morph("C:\\jdk1\\jdk2\\jdk3\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar"), path);
-
- }
-
- public void testConvertToClassName() {
- String fileName = "java/lang/String.class";
- File file = new File(fileName);
- String className = Classpath.convertToClassName(file);
- assertEquals(java.lang.String.class.getName(), className);
- }
-
- public void testConvertToClass() throws ClassNotFoundException {
- String fileName = "java/lang/String.class";
- File file = new File(fileName);
- Class<?> javaClass = Classpath.convertToClass(file);
- assertEquals(java.lang.String.class, javaClass);
- }
-
- public void testConvertToArchiveClassFileEntryName() {
- String fileName = Classpath.convertToArchiveClassFileEntryName(java.lang.String.class);
- assertEquals("java/lang/String.class", fileName);
- }
-
- public void testConvertToClassFileName() {
- char sc = File.separatorChar;
- String fileName = Classpath.convertToClassFileName(java.lang.String.class);
- assertEquals("java" + sc + "lang" + sc + "String.class", fileName);
- }
-
- public void testConvertToJavaFileName() {
- char sc = File.separatorChar;
- String fileName = Classpath.convertToJavaFileName(java.lang.String.class.getName());
- assertEquals("java" + sc + "lang" + sc + "String.java", fileName);
- }
-
- public void testConvertToURLs() {
- URL[] entries = new Classpath(this.morph("C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).urls();
- int i = 0;
- assertEquals(this.morphURL("/C:/jdk/rt.jar"), entries[i++].getPath());
- assertEquals(this.morphURL("/C:/jdk/i18n.jar"), entries[i++].getPath());
- assertEquals(this.morphURL("/C:/jdk/jaws.jar"), entries[i++].getPath());
- assertEquals(this.morphURL("/C:/foo/classes"), entries[i++].getPath());
- assertEquals(this.morphURL("/C:/bar/bar.jar"), entries[i++].getPath());
- assertEquals(i, entries.length);
- }
-
- public void testEntries() {
- Classpath cp = new Classpath(this.morph("C:\\jdk\\rt.jar;;.;C:\\jdk\\i18n.jar;;;C:\\jdk\\jaws.jar;;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\bar\\bar.jar;"));
- Classpath.Entry[] entries = cp.getEntries();
- int i = 0;
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entries[i++].fileName());
- assertEquals(this.morph("."), entries[i++].fileName());
- assertEquals(this.morph("C:\\jdk\\i18n.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\jdk\\jaws.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\foo\\classes"), entries[i++].fileName());
- assertEquals(this.morph("C:\\bar\\bar.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\bar\\bar.jar"), entries[i++].fileName());
- assertEquals(i, entries.length);
-
- cp = cp.compressed();
- entries = cp.getEntries();
- i = 0;
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entries[i++].fileName());
- assertEquals(this.morph("."), entries[i++].fileName());
- assertEquals(this.morph("C:\\jdk\\i18n.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\jdk\\jaws.jar"), entries[i++].fileName());
- assertEquals(this.morph("C:\\foo\\classes"), entries[i++].fileName());
- assertEquals(this.morph("C:\\bar\\bar.jar"), entries[i++].fileName());
- assertEquals(i, entries.length);
- }
-
- public void testEntryForFileNamed() {
- Classpath.Entry entry = null;
-
- // in the middle - qualified
- entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\rt.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // in the middle - unqualified
- entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;rt.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.fileName());
-
- // at the beginning - qualified
- entry = new Classpath(this.morph("C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // at the beginning - unqualified
- entry = new Classpath(this.morph("rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.fileName());
-
- // at the end - qualified
- entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\jdk\\rt.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // at the end - unqualified
- entry = new Classpath(this.morph("C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;rt.jar")).entryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.fileName());
-
- // alone - qualified
- entry = new Classpath(this.morph("C:\\jdk\\rt.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // alone - unqualified
- entry = new Classpath("rt.jar").entryForFileNamed("rt.jar");
- assertEquals("rt.jar", entry.fileName());
-
- // trick entry at the beginning
- entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // trick entry in the middle
- entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rtrtrt.jar;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // trick entry at the end
- entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rtrtrt.jar;C:\\jdk\\rt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\jdk\\rtrtrt.jar")).entryForFileNamed("rt.jar");
- assertEquals(this.morph("C:\\jdk\\rt.jar"), entry.fileName());
-
- // missing
- entry = new Classpath(this.morph("rt.jar.new;C:\\jdk\\rtrtrt.jar;C:\\jdk\\i18n.jar;C:\\jdk\\jaws.jar;C:\\foo\\classes;C:\\bar\\bar.jar;C:\\jdk\\rtrtrt.jar")).entryForFileNamed("rt.jar");
- assertEquals("path entry should not be found", null, entry);
-
- }
-
- public void testLocationForClass() {
- Class<?> javaClass = Classpath.class;
- File entry = new File(Classpath.locationFor(javaClass));
- if (entry.isFile() || entry.isDirectory()) {
- assertTrue(entry.exists());
- }
- if (entry.isDirectory()) {
- assertTrue(new File(entry, Classpath.convertToClassFileName(javaClass)).exists());
- }
- }
-
- public void testRtJarName() throws IOException {
- File rtFile = new File(Classpath.rtJarName());
- assertTrue("rt.jar does not exist", rtFile.exists());
-
- JarFile rtJarFile = new JarFile(rtFile);
- JarEntry entry = rtJarFile.getJarEntry("java/lang/Object.class");
- rtJarFile.close();
- assertTrue("bogus rt.jar", entry != null);
- }
-
- public void testJREClassNames() {
- assertTrue("Vector is missing from JRE class names", CollectionTools.contains(Classpath.bootClasspath().classNames(), java.util.Vector.class.getName()));
- assertTrue("File is missing from JRE class names", CollectionTools.contains(Classpath.bootClasspath().classNames(), java.io.File.class.getName()));
- }
-
- public void testJavaExtensionDirectoryNames() {
- char sep = File.separatorChar;
- String stdExtDirName = JAVA_HOME + sep + "lib" + sep + "ext";
- assertTrue("standard extension dir name missing: " + stdExtDirName, CollectionTools.contains(Classpath.javaExtensionDirectoryNames(), stdExtDirName));
- }
-
- public void testJavaExtensionDirectories() {
- char sep = File.separatorChar;
- File stdExtDir = new File(JAVA_HOME + sep + "lib" + sep + "ext");
- assertTrue("standard extension dir missing: " + stdExtDir.getParent(), CollectionTools.contains(Classpath.javaExtensionDirectories(), stdExtDir));
- }
-
- //Commented out due to incompatibility with IBM JDK (used in Eclipse WTP Build)
- //TODO Test should be revised to be compatible with IBM JDK
- // public void testJavaExtensionClasspathEntries() {
- // char sep = File.separatorChar;
- // String jdk = System.getProperty("java.version");
- // if (jdk.startsWith("1.4") || jdk.startsWith("1.5")) {
- // Collection jarNames = new ArrayList();
- // Classpath.Entry[] entries = Classpath.javaExtensionClasspath().getEntries();
- // for (int i = 0; i < entries.length; i++) {
- // jarNames.add(entries[i].fileName());
- // }
- // String stdExtJarName = JAVA_HOME + sep + "lib" + sep + "ext" + sep + "dnsns.jar";
- // assertTrue("jdk 1.4.x standard extension jar missing: " + stdExtJarName, jarNames.contains(stdExtJarName));
- // } else {
- // fail("we need to update this test for the current jdk");
- // }
- // }
-
- //Commented out due to incompatibility with IBM JDK (used in Eclipse WTP Build)
- //TODO Test should be revised to be compatible with IBM JDK
- // public void testJavaExtensionClassNames() {
- // String jdk = System.getProperty("java.version");
- // if (jdk.startsWith("1.4") || jdk.startsWith("1.5")) {
- // String className = "sun.net.spi.nameservice.dns.DNSNameService";
- // assertTrue("jdk 1.4.x standard extension class missing: " + className,
- // CollectionTools.contains(Classpath.javaExtensionClasspath().classNames(), className));
- // } else {
- // fail("we need to update this test for the current jdk");
- // }
- // }
-
- public void testJavaClasspathClassNames() {
- String className = this.getClass().getName();
- ClassLoader cl = this.getClass().getClassLoader();
- // make sure we are running under the "normal" class loader;
- // when the tests are executed as an ANT task, they are run under
- // an ANT class loader and the "Java" classpath does not include this class
- if (cl.getClass().getName().startsWith("sun.misc")) {
- assertTrue("class missing: " + className, CollectionTools.contains(Classpath.javaClasspath().classNames(), className));
- }
- }
-
- /**
- * morph the specified path to a platform-independent path
- */
- private String morph(String path) {
- String result = path;
- result = result.replace('\\', File.separatorChar);
- result = result.replace(';', File.pathSeparatorChar);
- if (!CollectionTools.contains(File.listRoots(), new File("C:\\"))) {
- result = result.replaceAll("C:", "");
- }
- return result;
- }
-
- /**
- * morph the specified URL to a platform-independent path
- */
- private String morphURL(String url) {
- String result = url;
- if (!CollectionTools.contains(File.listRoots(), new File("C:\\"))) {
- result = result.replaceAll("/C:", "");
- }
- return result;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java
deleted file mode 100644
index 027984029e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java
+++ /dev/null
@@ -1,1972 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.Range;
-import org.eclipse.jpt.utility.internal.ReverseComparator;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class CollectionToolsTests extends TestCase {
-
- public CollectionToolsTests(String name) {
- super(name);
- }
-
- public void testAddObjectArrayObject1() {
- Object[] a = CollectionTools.add(this.buildObjectArray1(), "twenty");
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, "twenty"));
- assertEquals("twenty", a[a.length-1]);
- }
-
- public void testAddObjectArrayObject2() {
- String[] a = CollectionTools.add(this.buildStringArray1(), "twenty");
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, "twenty"));
- assertEquals("twenty", a[a.length-1]);
- }
-
- public void testAddObjectArrayIntObject1() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = CollectionTools.add(a, 2, "X");
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "a", "b", "X", "c", "d" }, a));
- }
-
- public void testAddObjectArrayIntObject2() {
- String[] a = new String[] { "a", "b", "c", "d" };
- a = CollectionTools.add(a, 2, "X");
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new String[] { "a", "b", "X", "c", "d" }, a));
- }
-
- public void testAddObjectArrayIntObjectException() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- boolean exCaught = false;
- try {
- a = CollectionTools.add(a, 33, "X");
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddCharArrayChar() {
- char[] a = CollectionTools.add(this.buildCharArray(), 'd');
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- }
-
- public void testAddCharArrayIntChar() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.add(a, 2, 'X');
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'X', 'c', 'd' }, a));
- }
-
- public void testAddIntArrayInt() {
- int[] a = CollectionTools.add(this.buildIntArray(), 30);
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- }
-
- public void testAddIntArrayIntInt() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.add(a, 2, 99);
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 1, 2, 99, 3, 4 }, a));
- }
-
- public void testAddAllCollectionIterator1() {
- List<String> l1 = this.buildStringList1();
- List<String> l2 = this.buildStringList2();
- Set<String> s1 = this.buildStringSet1();
- List<String> l3 = this.buildStringList1(); // same elements as s1
-
- assertTrue(CollectionTools.addAll(l1, l2.iterator()));
- assertEquals(6, l1.size());
- assertTrue(l1.containsAll(l2));
-
- assertFalse(CollectionTools.addAll(s1, l3.iterator()));
- assertEquals(3, s1.size());
- assertTrue(s1.containsAll(l3));
- }
-
- public void testAddAllCollectionIterator2() {
- List<Object> l1 = this.buildObjectList1();
- List<String> l2 = this.buildStringList2();
- Set<Object> s1 = this.buildObjectSet1();
- List<String> l3 = this.buildStringList1(); // same elements as s1
-
- assertTrue(CollectionTools.addAll(l1, l2.iterator()));
- assertEquals(6, l1.size());
- assertTrue(l1.containsAll(l2));
-
- assertFalse(CollectionTools.addAll(s1, l3.iterator()));
- assertEquals(3, s1.size());
- assertTrue(s1.containsAll(l3));
- }
-
- public void testAddAllCollectionObjectArray1() {
- List<String> l = this.buildStringList1();
- String[] a = this.buildStringArray1();
- Set<String> s = this.buildStringSet1();
-
- assertTrue(CollectionTools.addAll(l, a));
- assertEquals(6, l.size());
- assertTrue(l.containsAll(CollectionTools.collection(a)));
-
- assertFalse(CollectionTools.addAll(s, a));
- assertEquals(3, s.size());
- assertTrue(s.containsAll(CollectionTools.collection(a)));
- }
-
- public void testAddAllCollectionObjectArray2() {
- List<Object> l = this.buildObjectList1();
- String[] a = this.buildStringArray1();
- Set<Object> s = this.buildObjectSet1();
-
- assertTrue(CollectionTools.addAll(l, a));
- assertEquals(6, l.size());
- assertTrue(l.containsAll(CollectionTools.collection(a)));
-
- assertFalse(CollectionTools.addAll(s, a));
- assertEquals(3, s.size());
- assertTrue(s.containsAll(CollectionTools.collection(a)));
- }
-
- public void testAddAllObjectArrayCollection1() {
- String[] a = this.buildStringArray1();
- Collection<String> c = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, c);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayCollection2() {
- Object[] a = this.buildObjectArray1();
- Collection<String> c = this.buildStringList2();
- Object[] newArray = CollectionTools.addAll(a, c);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayIterator1() {
- String[] a = this.buildStringArray1();
- Iterator<String> i = this.buildStringList1().iterator();
- String[] newArray = CollectionTools.addAll(a, i);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIterator2() {
- String[] a = this.buildStringArray1();
- Iterator<Object> i = this.buildObjectList1().iterator();
- Object[] newArray = CollectionTools.addAll(a, i);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildObjectList1()));
- }
-
- public void testAddAllObjectArrayObjectArray1() {
- Object[] a1 = this.buildObjectArray1();
- Object[] a2 = this.buildObjectArray2();
- Object[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a1));
- assertTrue(CollectionTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayObjectArray2() {
- String[] a1 = this.buildStringArray1();
- String[] a2 = this.buildStringArray2();
- String[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a1));
- assertTrue(CollectionTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayObjectArray3() {
- Object[] a1 = this.buildObjectArray1();
- String[] a2 = this.buildStringArray2();
- Object[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a1));
- assertTrue(CollectionTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayIntObjectArray1() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = CollectionTools.addAll(a, 2, new Object[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "a", "b", "X", "X", "X", "c", "d" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray2() {
- String[] a = new String[] { "a", "b", "c", "d" };
- a = CollectionTools.addAll(a, 2, new String[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new String[] { "a", "b", "X", "X", "X", "c", "d" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray3() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = CollectionTools.addAll(a, 2, new String[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "a", "b", "X", "X", "X", "c", "d" }, a));
- }
-
- public void testAddAllCharArrayCharArray() {
- char[] a = CollectionTools.addAll(this.buildCharArray(), new char[] { 'd', 'e' });
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- assertTrue(CollectionTools.contains(a, 'e'));
- }
-
- public void testAddAllCharArrayIntCharArray() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.addAll(a, 2, new char[] { 'X', 'X', 'X' });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'X', 'X', 'X', 'c', 'd' }, a));
- }
-
- public void testAddAllIntArrayIntArray() {
- int[] a = CollectionTools.addAll(this.buildIntArray(), new int[] { 30, 40 });
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- assertTrue(CollectionTools.contains(a, 40));
- }
-
- public void testAddAllIntArrayIntIntArray() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.addAll(a, 2, new int[] { 99, 99, 99 });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 1, 2, 99, 99, 99, 3, 4 }, a));
- }
-
- public void testArrayIterator() {
- Object[] a = CollectionTools.array(this.buildStringList1().iterator());
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorObjectArray1() {
- String[] a = CollectionTools.array(this.buildStringList1().iterator(), new String[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorObjectArray2() {
- Object[] a = CollectionTools.array(this.buildStringList1().iterator(), new Object[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testBagEnumeration1() {
- Bag<String> b = CollectionTools.bag(this.buildStringVector1().elements());
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringVector1()));
- }
-
- public void testBagEnumeration2() {
- Bag<Object> b = CollectionTools.<Object>bag(this.buildStringVector1().elements());
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringVector1()));
- }
-
- public void testBagIterator1() {
- Bag<String> b = CollectionTools.bag(this.buildStringList1().iterator());
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringList1()));
- }
-
- public void testBagIterator2() {
- Collection<String> c = new ArrayList<String>();
- c.add("zero");
- c.add("one");
- c.add("two");
- c.add("three");
- Bag<Object> b = CollectionTools.<Object>bag(c.iterator());
- assertEquals(4, b.size());
- assertTrue(b.containsAll(c));
- }
-
- public void testBagObjectArray1() {
- Bag<String> b = CollectionTools.bag(this.buildStringArray1());
- assertEquals(3, b.size());
- assertTrue(CollectionTools.containsAll(b, this.buildStringArray1()));
- }
-
- public void testBagObjectArray2() {
- Bag<String> b = CollectionTools.bag("foo", "bar", "baz");
- assertEquals(3, b.size());
- assertTrue(CollectionTools.containsAll(b, new Object[]{"foo", "bar", "baz"}));
- }
-
- public void testCollectionEnumeration1() {
- Collection<String> c = CollectionTools.collection(this.buildStringVector1().elements());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringVector1()));
- }
-
- public void testCollectionEnumeration2() {
- Collection<Object> c = CollectionTools.<Object>collection(this.buildStringVector1().elements());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringVector1()));
- }
-
- public void testCollectionIterator1() {
- Collection<String> c = CollectionTools.collection(this.buildStringList1().iterator());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionIterator2() {
- Collection<Object> c = CollectionTools.<Object>collection(this.buildStringList1().iterator());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionObjectArray() {
- Collection<String> c = CollectionTools.collection(this.buildStringArray1());
- assertEquals(3, c.size());
- assertTrue(CollectionTools.containsAll(c, this.buildStringArray1()));
- }
-
- public void testContainsEnumerationObject1() {
- Vector<String> v = this.buildStringVector1();
- assertTrue(CollectionTools.contains(v.elements(), "one"));
- assertFalse(CollectionTools.contains(v.elements(), null));
- v.add(null);
- assertTrue(CollectionTools.contains(v.elements(), null));
- }
-
- public void testContainsEnumerationObject2() {
- Vector<Object> c = new Vector<Object>();
- c.add("zero");
- c.add("one");
- c.add("two");
- c.add("three");
- String one = "one";
- assertTrue(CollectionTools.contains(c.elements(), one));
- assertFalse(CollectionTools.contains(c.elements(), null));
- c.add(null);
- assertTrue(CollectionTools.contains(c.elements(), null));
- }
-
- public void testContainsIteratorObject1() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.contains(c.iterator(), "one"));
- assertFalse(CollectionTools.contains(c.iterator(), null));
- c.add(null);
- assertTrue(CollectionTools.contains(c.iterator(), null));
- }
-
- public void testContainsIteratorObject2() {
- Collection<Object> c = new HashBag<Object>();
- c.add("zero");
- c.add("one");
- c.add("two");
- c.add("three");
- String one = "one";
- assertTrue(CollectionTools.contains(c.iterator(), one));
- assertFalse(CollectionTools.contains(c.iterator(), null));
- c.add(null);
- assertTrue(CollectionTools.contains(c.iterator(), null));
- }
-
- public void testContainsObjectArrayObject() {
- Object[] a = this.buildObjectArray1();
- assertTrue(CollectionTools.contains(a, "one"));
- assertFalse(CollectionTools.contains(a, null));
- Object[] a2 = CollectionTools.add(a, null);
- assertTrue(CollectionTools.contains(a2, null));
- }
-
- public void testContainsCharArrayChar() {
- char[] a = this.buildCharArray();
- assertTrue(CollectionTools.contains(a, 'a'));
- assertFalse(CollectionTools.contains(a, 'z'));
- char[] a2 = CollectionTools.add(a, 'z');
- assertTrue(CollectionTools.contains(a2, 'z'));
- }
-
- public void testContainsIntArrayInt() {
- int[] a = this.buildIntArray();
- assertTrue(CollectionTools.contains(a, 10));
- assertFalse(CollectionTools.contains(a, 55));
- int[] a2 = CollectionTools.add(a, 55);
- assertTrue(CollectionTools.contains(a2, 55));
- }
-
- public void testContainsAllCollectionIterator1() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), this.buildStringList1().iterator()));
- }
-
- public void testContainsAllCollectionIterator2() {
- Collection<Object> c1 = new ArrayList<Object>();
- c1.add("zero");
- c1.add("one");
- c1.add("two");
- Collection<String> c2 = new ArrayList<String>();
- c2.add("two");
- c2.add("zero");
- c2.add("one");
- assertTrue(CollectionTools.containsAll(c1, c2.iterator()));
- }
-
- public void testContainsAllCollectionObjectArray1() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), this.buildObjectArray1()));
- }
-
- public void testContainsAllCollectionObjectArray2() {
- Object[] a = new Object[] { "zero", "one", "two" };
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), a));
- }
-
- public void testContainsAllIteratorCollection1() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList1()));
- }
-
- public void testContainsAllIteratorCollection2() {
- Collection<Object> c1 = new ArrayList<Object>();
- c1.add("zero");
- c1.add("one");
- c1.add("two");
- Collection<String> c2 = new ArrayList<String>();
- c2.add("zero");
- c2.add("one");
- c2.add("two");
- assertTrue(CollectionTools.containsAll(c1.iterator(), c2));
- }
-
- public void testContainsAllIteratorIterator1() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList1().iterator()));
- }
-
- public void testContainsAllIteratorIterator2() {
- Collection<Object> c1 = new ArrayList<Object>();
- c1.add("zero");
- c1.add("one");
- c1.add("two");
- Collection<String> c2 = new ArrayList<String>();
- c2.add("zero");
- c2.add("one");
- c2.add("two");
- assertTrue(CollectionTools.containsAll(c1.iterator(), c2.iterator()));
- }
-
- public void testContainsAllIteratorObjectArray() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildObjectArray1()));
- }
-
- public void testContainsAllObjectArrayCollection() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList1()));
- }
-
- public void testContainsAllObjectArrayIterator() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList1().iterator()));
- }
-
- public void testContainsAllObjectArrayObjectArray() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildObjectArray1()));
- }
-
- public void testContainsAllCharArrayCharArray() {
- assertTrue(CollectionTools.containsAll(this.buildCharArray(), this.buildCharArray()));
- }
-
- public void testContainsAllIntArrayIntArray() {
- assertTrue(CollectionTools.containsAll(this.buildIntArray(), this.buildIntArray()));
- }
-
- public void testDiffEnd() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = new String("a");
- String b_ = new String("b");
- String c_ = new String("c");
- String d_ = new String("d");
- String e_ = new String("e");
- assertTrue((a != a_) && a.equals(a_));
- assertTrue((b != b_) && b.equals(b_));
- assertTrue((c != c_) && c.equals(c_));
- assertTrue((d != d_) && d.equals(d_));
- assertTrue((e != e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(-1, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(-1, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(4, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(-1, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(2, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, CollectionTools.diffEnd(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(-1, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, CollectionTools.diffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(-1, CollectionTools.diffEnd(array1, array2));
- }
-
- public void testDiffRange() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = a;
- String b_ = b;
- String c_ = c;
- String d_ = d;
- String e_ = e;
- assertTrue((a == a_) && a.equals(a_));
- assertTrue((b == b_) && b.equals(b_));
- assertTrue((c == c_) && c.equals(c_));
- assertTrue((d == d_) && d.equals(d_));
- assertTrue((e == e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(5, -1), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(new Range(1, -1), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(new Range(0, 4), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(new Range(0, -1), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(new Range(0, 2), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(new Range(0, 0), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(new Range(3, 3), CollectionTools.diffRange(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(new Range(5, -1), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(2, 2), CollectionTools.diffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(new Range(5, -1), CollectionTools.diffRange(array1, array2));
- }
-
- public void testDiffStart() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = new String("a");
- String b_ = new String("b");
- String c_ = new String("c");
- String d_ = new String("d");
- String e_ = new String("e");
- assertTrue((a != a_) && a.equals(a_));
- assertTrue((b != b_) && b.equals(b_));
- assertTrue((c != c_) && c.equals(c_));
- assertTrue((d != d_) && d.equals(d_));
- assertTrue((e != e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(5, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(1, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(4, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(0, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(0, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(0, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, e_, c_, d_ };
- assertEquals(2, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, CollectionTools.diffStart(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c__));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(5, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, CollectionTools.diffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(5, CollectionTools.diffStart(array1, array2));
- }
-
- public void testEqualsListIteratorListIterator() {
- List<String> list1 = new ArrayList<String>();
- list1.add("1000");
- list1.add("2000");
- list1.add("3000");
- list1.add("4000");
-
- List<String> list2 = new ArrayList<String>();
- for (int i = 0; i < list1.size(); i++) {
- list2.add(String.valueOf((i + 1) * 1000));
- }
- assertFalse(CollectionTools.identical(list1.listIterator(), list2.listIterator()));
- assertTrue(CollectionTools.equals(list1.listIterator(), list2.listIterator()));
- }
-
- public void testGetListIteratorInt() {
- List<String> list = this.buildStringList1();
- String o = CollectionTools.get(list.listIterator(), 1);
- assertEquals("one", o);
- list.add(null);
- o = CollectionTools.get(list.listIterator(), list.size() - 1);
- assertNull(o);
-
- boolean exCaught = false;
- try {
- CollectionTools.get(list.listIterator(), list.size());
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testIdenticalObjectArrayObjectArray() {
- Object[] a1 = new Object[4];
- for (int i = 0; i < a1.length; i++) {
- a1[i] = String.valueOf(i * 1000);
- }
-
- Object[] a2 = new Object[a1.length];
- for (int i = 0; i < a2.length; i++) {
- a2[i] = a1[i];
- }
-
- assertTrue(CollectionTools.identical(a1, a2));
- a2[2] = "2000";
- assertFalse(CollectionTools.identical(a1, a2));
- assertTrue(Arrays.equals(a1, a2));
- }
-
- public void testIdenticalListIteratorListIterator() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
-
- List<String> list2 = new ArrayList<String>();
- for (String s : list1) {
- list2.add(s);
- }
- assertTrue(CollectionTools.identical(list1.listIterator(), list2.listIterator()));
- assertTrue(CollectionTools.equals(list1.listIterator(), list2.listIterator()));
- }
-
- public void testIdentityDiffEnd() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = a;
- String b_ = b;
- String c_ = c;
- String d_ = d;
- String e_ = e;
- assertTrue((a == a_) && a.equals(a_));
- assertTrue((b == b_) && b.equals(b_));
- assertTrue((c == c_) && c.equals(c_));
- assertTrue((d == d_) && d.equals(d_));
- assertTrue((e == e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(4, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(2, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, CollectionTools.identityDiffEnd(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(2, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, CollectionTools.identityDiffEnd(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(-1, CollectionTools.identityDiffEnd(array1, array2));
- }
-
- public void testIdentityDiffRange() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = a;
- String b_ = b;
- String c_ = c;
- String d_ = d;
- String e_ = e;
- assertTrue((a == a_) && a.equals(a_));
- assertTrue((b == b_) && b.equals(b_));
- assertTrue((c == c_) && c.equals(c_));
- assertTrue((d == d_) && d.equals(d_));
- assertTrue((e == e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(5, -1), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(new Range(1, -1), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(new Range(0, 4), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(new Range(0, -1), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { b_, c_, a_, d_, e_ };
- assertEquals(new Range(0, 2), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(new Range(0, 0), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(new Range(3, 3), CollectionTools.identityDiffRange(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(new Range(2, 2), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(new Range(2, 2), CollectionTools.identityDiffRange(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(new Range(5, -1), CollectionTools.identityDiffRange(array1, array2));
- }
-
- public void testIdentityDiffStart() {
- String a = "a";
- String b = "b";
- String c = "c";
- String d = "d";
- String e = "e";
- String a_ = a;
- String b_ = b;
- String c_ = c;
- String d_ = d;
- String e_ = e;
- assertTrue((a == a_) && a.equals(a_));
- assertTrue((b == b_) && b.equals(b_));
- assertTrue((c == c_) && c.equals(c_));
- assertTrue((d == d_) && d.equals(d_));
- assertTrue((e == e_) && e.equals(e_));
- String[] array1;
- String[] array2;
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(5, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a };
- array2 = new String[] { a_ };
- assertEquals(1, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(4, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(4, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(0, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[0];
- assertEquals(0, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[0];
- array2 = new String[0];
- assertEquals(0, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, e_, c_, d_ };
- assertEquals(2, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, c, e };
- array2 = new String[] { a_, b_, c_, d_ };
- assertEquals(3, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { b, c, d, e };
- array2 = new String[] { a_, c_, d_, e_ };
- assertEquals(0, CollectionTools.identityDiffStart(array1, array2));
-
- String c__ = new String(c);
- assertTrue((c != c__) && c.equals(c_));
- array1 = new String[] { a, b, c, d, e };
- array2 = new String[] { a_, b_, c__, d_, e_ };
- assertEquals(2, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, c_, d_, e_ };
- assertEquals(2, CollectionTools.identityDiffStart(array1, array2));
-
- array1 = new String[] { a, b, null, d, e };
- array2 = new String[] { a_, b_, null, d_, e_ };
- assertEquals(5, CollectionTools.identityDiffStart(array1, array2));
- }
-
- public void testIndexOfListIteratorObject1() {
- List<String> list = this.buildStringList1();
- assertEquals(1, CollectionTools.indexOf(list.listIterator(), "one"));
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.indexOf(list.listIterator(), null));
- }
-
- public void testIndexOfListIteratorObject2() {
- List<Object> list = new ArrayList<Object>();
- list.add("0");
- list.add("1");
- list.add("2");
- list.add("3");
-
- String one = "1";
- assertEquals(1, CollectionTools.indexOf(list.listIterator(), one));
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.indexOf(list.listIterator(), null));
- }
-
- public void testIndexOfObjectArrayObject() {
- Object[] a = this.buildObjectArray1();
- assertEquals(1, CollectionTools.indexOf(a, "one"));
- a = CollectionTools.add(a, null);
- assertEquals(a.length - 1, CollectionTools.indexOf(a, null));
- }
-
- public void testIndexOfCharArrayChar() {
- char[] a = this.buildCharArray();
- assertEquals(1, CollectionTools.indexOf(a, 'b'));
- a = CollectionTools.add(a, 'd');
- assertEquals(a.length - 1, CollectionTools.indexOf(a, 'd'));
- }
-
- public void testIndexOfIntArrayInt() {
- int[] a = this.buildIntArray();
- assertEquals(1, CollectionTools.indexOf(a, 10));
- a = CollectionTools.add(a, 30);
- assertEquals(a.length - 1, CollectionTools.indexOf(a, 30));
- }
-
- public void testInsertionIndexOfListComparable() {
- List<String> list = Arrays.asList(new String[] { "A", "C", "D" });
- assertEquals(1, CollectionTools.insertionIndexOf(list, "B"));
-
- list = Arrays.asList(new String[] { "A", "B", "C", "D" });
- assertEquals(2, CollectionTools.insertionIndexOf(list, "B"));
-
- list = Arrays.asList(new String[] { "A", "B", "B", "B", "C", "D" });
- assertEquals(4, CollectionTools.insertionIndexOf(list, "B"));
-
- list = Arrays.asList(new String[] { "A", "B", "B", "B", "C", "D" });
- assertEquals(6, CollectionTools.insertionIndexOf(list, "E"));
-
- list = Arrays.asList(new String[] { "B", "B", "B", "C", "D" });
- assertEquals(0, CollectionTools.insertionIndexOf(list, "A"));
-
- list = Arrays.asList(new String[] { "A", "A", "B", "B", "C", "D" });
- assertEquals(2, CollectionTools.insertionIndexOf(list, "A"));
- }
-
- public void testInsertionIndexOfListObjectComparator() {
- Comparator<String> c = new ReverseComparator<String>();
- List<String> list = Arrays.asList(new String[] { "D", "C", "A" });
- assertEquals(2, CollectionTools.insertionIndexOf(list, "B", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "A" });
- assertEquals(3, CollectionTools.insertionIndexOf(list, "B", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "B", "B", "A" });
- assertEquals(5, CollectionTools.insertionIndexOf(list, "B", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "B", "B", "A" });
- assertEquals(0, CollectionTools.insertionIndexOf(list, "E", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "B", "B" });
- assertEquals(5, CollectionTools.insertionIndexOf(list, "A", c));
-
- list = Arrays.asList(new String[] { "D", "C", "B", "B", "A", "A" });
- assertEquals(6, CollectionTools.insertionIndexOf(list, "A", c));
- }
-
- public void testInsertionIndexOfObjectArrayComparable() {
- String[] a = new String[] { "A", "C", "D" };
- assertEquals(1, CollectionTools.insertionIndexOf(a, "B"));
-
- a = new String[] { "A", "B", "C", "D" };
- assertEquals(2, CollectionTools.insertionIndexOf(a, "B"));
-
- a = new String[] { "A", "B", "B", "B", "C", "D" };
- assertEquals(4, CollectionTools.insertionIndexOf(a, "B"));
-
- a = new String[] { "A", "B", "B", "B", "C", "D" };
- assertEquals(6, CollectionTools.insertionIndexOf(a, "E"));
-
- a = new String[] { "B", "B", "B", "C", "D" };
- assertEquals(0, CollectionTools.insertionIndexOf(a, "A"));
-
- a = new String[] { "A", "A", "B", "B", "C", "D" };
- assertEquals(2, CollectionTools.insertionIndexOf(a, "A"));
- }
-
- public void testInsertionIndexOfObjectArrayObjectComparator() {
- Comparator<String> c = new ReverseComparator<String>();
- String[] a = new String[] { "D", "C", "A" };
- assertEquals(2, CollectionTools.insertionIndexOf(a, "B", c));
-
- a = new String[] { "D", "C", "B", "A" };
- assertEquals(3, CollectionTools.insertionIndexOf(a, "B", c));
-
- a = new String[] { "D", "C", "B", "B", "B", "A" };
- assertEquals(5, CollectionTools.insertionIndexOf(a, "B", c));
-
- a = new String[] { "D", "C", "B", "B", "B", "A" };
- assertEquals(0, CollectionTools.insertionIndexOf(a, "E", c));
-
- a = new String[] { "D", "C", "B", "B", "B" };
- assertEquals(5, CollectionTools.insertionIndexOf(a, "A", c));
-
- a = new String[] { "D", "C", "B", "B", "A", "A" };
- assertEquals(6, CollectionTools.insertionIndexOf(a, "A", c));
- }
-
- public void testIteratorObjectArray() {
- String[] a = this.buildStringArray1();
- int i = 0;
- for (Iterator<String> stream = CollectionTools.iterator(a); stream.hasNext(); i++) {
- assertEquals(a[i], stream.next());
- }
- }
-
- public void testLastIndexOfListIteratorObject() {
- List<String> list = this.buildStringList1();
- assertEquals(1, CollectionTools.lastIndexOf(list.listIterator(), "one"));
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.lastIndexOf(list.listIterator(), null));
- }
-
- public void testLastIndexOfObjectArrayObject() {
- Object[] a = this.buildObjectArray1();
- assertEquals(1, CollectionTools.lastIndexOf(a, "one"));
- a = CollectionTools.add(a, null);
- assertEquals(a.length - 1, CollectionTools.lastIndexOf(a, null));
- }
-
- public void testLastIndexOfCharArrayChar() {
- char[] a = this.buildCharArray();
- assertEquals(1, CollectionTools.lastIndexOf(a, 'b'));
- a = CollectionTools.add(a, 'd');
- assertEquals(a.length - 1, CollectionTools.lastIndexOf(a, 'd'));
- }
-
- public void testLastIndexOfIntArrayInt() {
- int[] a = this.buildIntArray();
- assertEquals(1, CollectionTools.lastIndexOf(a, 10));
- a = CollectionTools.add(a, 30);
- assertEquals(a.length - 1, CollectionTools.lastIndexOf(a, 30));
- }
-
- public void testListIterator1() {
- List<String> list = CollectionTools.list(this.buildStringList1().iterator());
- assertEquals(this.buildStringList1(), list);
- }
-
- public void testListIterator2() {
- List<String> list1 = new ArrayList<String>();
- list1.add("0");
- list1.add("1");
- list1.add("2");
- list1.add("3");
-
- List<Object> list2 = CollectionTools.<Object>list(list1.iterator());
- assertEquals(list1, list2);
- }
-
- public void testListObjectArray() {
- List<String> list = CollectionTools.list(this.buildStringArray1());
- assertEquals(this.buildStringList1(), list);
- }
-
- public void testListIteratorObjectArray() {
- String[] a = this.buildStringArray1();
- int i = 0;
- for (ListIterator<String> stream = CollectionTools.listIterator(a); stream.hasNext(); i++) {
- assertEquals(a[i], stream.next());
- }
- }
-
- public void testListIteratorObjectArrayInt() {
- String[] a = this.buildStringArray1();
- int i = 1;
- for (ListIterator<String> stream = CollectionTools.listIterator(a, 1); stream.hasNext(); i++) {
- assertEquals(a[i], stream.next());
- }
- }
-
- public void testMaxCharArray() {
- assertEquals('c', CollectionTools.max(this.buildCharArray()));
- }
-
- public void testMaxIntArray() {
- assertEquals(20, CollectionTools.max(this.buildIntArray()));
- }
-
- public void testMinCharArray() {
- assertEquals('a', CollectionTools.min(this.buildCharArray()));
- }
-
- public void testMinIntArray() {
- assertEquals(0, CollectionTools.min(this.buildIntArray()));
- }
-
- public void testRemoveAllObjectArrayObjectArray() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- String[] a2 = new String[] { "E", "B" };
- String[] a3 = CollectionTools.removeAll(a1, a2);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllCharArrayCharArray() {
- char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' };
- char[] a2 = new char[] { 'E', 'B' };
- assertTrue(Arrays.equals(new char[] { 'A', 'A', 'C', 'C', 'D', 'D', 'F', 'F' }, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllIntArrayIntArray() {
- int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 };
- int[] a2 = new int[] { 5, 2 };
- assertTrue(Arrays.equals(new int[] { 1, 1, 3, 3, 4, 4, 6, 6 }, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveObjectArrayObject1() {
- Object[] a = this.buildObjectArray1();
- a = CollectionTools.add(a, "three");
- a = CollectionTools.add(a, "four");
- a = CollectionTools.add(a, "five");
-
- assertEquals(6, a.length);
- assertTrue(CollectionTools.contains(a, "three"));
- a = CollectionTools.remove(a, "three");
- assertEquals(5, a.length);
- assertFalse(CollectionTools.contains(a, "three"));
- assertTrue(CollectionTools.contains(a, "four"));
- assertTrue(CollectionTools.contains(a, "five"));
- }
-
- public void testRemoveObjectArrayObject2() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.add(a, "three");
- a = CollectionTools.add(a, "four");
- a = CollectionTools.add(a, "five");
-
- assertEquals(6, a.length);
- assertTrue(CollectionTools.contains(a, "three"));
- a = CollectionTools.remove(a, "three");
- assertEquals(5, a.length);
- assertFalse(CollectionTools.contains(a, "three"));
- assertTrue(CollectionTools.contains(a, "four"));
- assertTrue(CollectionTools.contains(a, "five"));
- }
-
- public void testRemoveCharArrayChar() {
- char[] a = this.buildCharArray();
- a = CollectionTools.add(a, 'd');
- a = CollectionTools.add(a, 'e');
- a = CollectionTools.add(a, 'f');
-
- assertEquals(6, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- a = CollectionTools.remove(a, 'd');
- assertEquals(5, a.length);
- assertFalse(CollectionTools.contains(a, 'd'));
- assertTrue(CollectionTools.contains(a, 'e'));
- assertTrue(CollectionTools.contains(a, 'f'));
- }
-
- public void testRemoveIntArrayInt() {
- int[] a = this.buildIntArray();
- a = CollectionTools.add(a, 30);
- a = CollectionTools.add(a, 40);
- a = CollectionTools.add(a, 50);
-
- assertEquals(6, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- a = CollectionTools.remove(a, 30);
- assertEquals(5, a.length);
- assertFalse(CollectionTools.contains(a, 30));
- assertTrue(CollectionTools.contains(a, 40));
- assertTrue(CollectionTools.contains(a, 50));
- }
-
- public void testRemoveAllCollectionIterator1() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.removeAll(c, this.buildStringList1().iterator()));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
-
- c = this.buildStringList1();
- assertFalse(CollectionTools.removeAll(c, this.buildStringList2().iterator()));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
- }
-
- public void testRemoveAllCollectionIterator2() {
- Collection<String> c = new ArrayList<String>();
- c.add("a");
- c.add("a");
- c.add("b");
- c.add("c");
- c.add("d");
- c.add("d");
- String[] a = new String[] { "a", "d" };
- assertTrue(CollectionTools.removeAll(c, new ArrayIterator<String>(a)));
- assertEquals(2, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- assertFalse(CollectionTools.removeAll(c, new ArrayIterator<String>(a)));
- }
-
- public void testRemoveAllCollectionIterator3() {
- Collection<Object> c = new ArrayList<Object>();
- c.add("a");
- c.add("a");
- c.add("b");
- c.add("c");
- c.add("d");
- c.add("d");
- String[] a = new String[] { "a", "d" };
- assertTrue(CollectionTools.removeAll(c, new ArrayIterator<String>(a)));
- assertEquals(2, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- assertFalse(CollectionTools.removeAll(c, new ArrayIterator<String>(a)));
- }
-
- public void testRemoveAllCollectionObjectArray1() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.removeAll(c, this.buildObjectArray1()));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
-
- c = this.buildStringList1();
- assertFalse(CollectionTools.removeAll(c, this.buildObjectArray2()));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
- }
-
- public void testRemoveAllCollectionObjectArray2() {
- Collection<String> c = new ArrayList<String>();
- c.add("a");
- c.add("a");
- c.add("b");
- c.add("c");
- c.add("d");
- c.add("d");
- String[] a = new String[] { "a", "d" };
- assertTrue(CollectionTools.removeAll(c, a));
- assertEquals(2, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- assertFalse(CollectionTools.removeAll(c, a));
- }
-
- public void testRemoveAllCollectionObjectArray3() {
- Collection<String> c = new ArrayList<String>();
- c.add("a");
- c.add("b");
- c.add("c");
- c.add("d");
- c.add("a");
- c.add("d");
- c.add("d");
- c.add("a");
- c.add("c");
- String[] a = new String[] { "a", "d" };
- assertTrue(CollectionTools.removeAll(c, a));
- assertEquals(3, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- assertFalse(CollectionTools.removeAll(c, a));
- }
-
- public void testRemoveAllOccurrencesCollectionObject() {
- Collection<String> c = this.buildStringList1();
- assertEquals(3, c.size());
- assertFalse(CollectionTools.removeAllOccurrences(c, "three"));
- assertTrue(CollectionTools.removeAllOccurrences(c, "two"));
- assertFalse(CollectionTools.removeAllOccurrences(c, "two"));
- assertEquals(2, c.size());
-
- c.add("five");
- c.add("five");
- c.add("five");
- assertEquals(5, c.size());
- assertTrue(CollectionTools.removeAllOccurrences(c, "five"));
- assertFalse(CollectionTools.removeAllOccurrences(c, "five"));
- assertEquals(2, c.size());
-
- c.add(null);
- c.add(null);
- c.add(null);
- assertEquals(5, c.size());
- assertTrue(CollectionTools.removeAllOccurrences(c, null));
- assertFalse(CollectionTools.removeAllOccurrences(c, null));
- assertEquals(2, c.size());
- }
-
- public void testRemoveAllOccurrencesObjectArrayObject() {
- String[] a = this.buildStringArray1();
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, "three");
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, "two");
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, "two");
- assertEquals(2, a.length);
-
- a = CollectionTools.add(a, "five");
- a = CollectionTools.add(a, "five");
- a = CollectionTools.add(a, "five");
- assertEquals(5, a.length);
- a = CollectionTools.removeAllOccurrences(a, "five");
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, "five");
- assertEquals(2, a.length);
-
- a = CollectionTools.add(a, null);
- a = CollectionTools.add(a, null);
- a = CollectionTools.add(a, null);
- assertEquals(5, a.length);
- a = CollectionTools.removeAllOccurrences(a, null);
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, null);
- assertEquals(2, a.length);
- }
-
- public void testRemoveAllOccurrencesCharArrayChar() {
- char[] a = this.buildCharArray();
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'd');
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'b');
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'b');
- assertEquals(2, a.length);
-
- a = CollectionTools.add(a, 'g');
- a = CollectionTools.add(a, 'g');
- a = CollectionTools.add(a, 'g');
- assertEquals(5, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'g');
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, 'g');
- assertEquals(2, a.length);
- }
-
- public void testRemoveAllOccurrencesIntArrayInt() {
- int[] a = this.buildIntArray();
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, 55);
- assertEquals(3, a.length);
- a = CollectionTools.removeAllOccurrences(a, 10);
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, 10);
- assertEquals(2, a.length);
-
- a = CollectionTools.add(a, 77);
- a = CollectionTools.add(a, 77);
- a = CollectionTools.add(a, 77);
- assertEquals(5, a.length);
- a = CollectionTools.removeAllOccurrences(a, 77);
- assertEquals(2, a.length);
- a = CollectionTools.removeAllOccurrences(a, 77);
- assertEquals(2, a.length);
- }
-
- public void testRemoveElementAtIndexObjectArrayInt() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.removeElementAtIndex(a, 3);
- assertTrue(Arrays.equals(new String[] { "A", "B", "A", "A", "D" }, a));
- }
-
- public void testRemoveElementAtIndexCharArrayInt() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = CollectionTools.removeElementAtIndex(a, 3);
- assertTrue(Arrays.equals(new char[] { 'A', 'B', 'A', 'A', 'D' }, a));
- }
-
- public void testRemoveElementAtIndexIntArrayInt() {
- int[] a = new int[] { 8, 6, 7, 33, 2, 11 };
- a = CollectionTools.removeElementAtIndex(a, 3);
- assertTrue(Arrays.equals(new int[] { 8, 6, 7, 2, 11 }, a));
- }
-
- public void testReplaceAllObjectArray1() {
- Object[] a = new Object[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.replaceAll(a, "A", "Z");
- assertTrue(Arrays.equals(new Object[] { "Z", "B", "Z", "C", "Z", "D" }, a));
- }
-
- public void testReplaceAllObjectArray2() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.replaceAll(a, "A", "Z");
- assertTrue(Arrays.equals(new String[] { "Z", "B", "Z", "C", "Z", "D" }, a));
- }
-
- public void testReplaceAllCharArray() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = CollectionTools.replaceAll(a, 'A', 'Z');
- assertTrue(Arrays.equals(new char[] { 'Z', 'B', 'Z', 'C', 'Z', 'D' }, a));
- }
-
- public void testReplaceAllIntArray() {
- int[] a = new int[] { 0, 1, 0, 7, 0, 99 };
- a = CollectionTools.replaceAll(a, 0, 13);
- assertTrue(Arrays.equals(new int[] { 13, 1, 13, 7, 13, 99 }, a));
- }
-
- public void testRetainAllCollectionIterator1() {
- Collection<String> c = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, this.buildStringList1().iterator()));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- assertTrue(CollectionTools.retainAll(c, this.buildStringList2().iterator()));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionIterator2() {
- Collection<Object> c1 = new ArrayList<Object>();
- c1.add("zero");
- c1.add("one");
- c1.add("two");
-
- Collection<String> c2 = new ArrayList<String>();
- c2.add("zero");
- c2.add("one");
- c2.add("two");
-
- assertFalse(CollectionTools.retainAll(c1, c2.iterator()));
- assertEquals(c2.size(), c1.size());
- assertEquals(c2, c1);
-
- Collection<String> c3 = new ArrayList<String>();
- c3.add("three");
- c3.add("four");
- c3.add("five");
-
- assertTrue(CollectionTools.retainAll(c1, c3.iterator()));
- assertEquals(0, c1.size());
- assertFalse(c1.contains("one"));
- assertFalse(c1.contains("two"));
- assertFalse(c1.contains("three"));
- }
-
- public void testRetainAllCollectionObjectArray() {
- Collection<String> c = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, this.buildObjectArray1()));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- assertTrue(CollectionTools.retainAll(c, this.buildObjectArray2()));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllObjectArrayObjectArray() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Object[] a2 = new Object[] { "E", "B", new Integer(7) };
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, CollectionTools.retainAll(a1, a2)));
- }
-
- public void testRetainAllCharArrayCharArray() {
- char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' };
- char[] a2 = new char[] { 'E', 'B' };
- assertTrue(Arrays.equals(new char[] { 'B', 'B', 'E', 'E' }, CollectionTools.retainAll(a1, a2)));
- }
-
- public void testRetainAllIntArrayIntArray() {
- int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 };
- int[] a2 = new int[] { 5, 2 };
- assertTrue(Arrays.equals(new int[] { 2, 2, 5, 5 }, CollectionTools.retainAll(a1, a2)));
- }
-
- public void testReverseObjectArray1() {
- Object[] a = this.buildObjectArray1();
- a = CollectionTools.reverse(a);
- assertEquals("two", a[0]);
- assertEquals("one", a[1]);
- assertEquals("zero", a[2]);
- }
-
- public void testReverseObjectArray2() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.reverse(a);
- assertEquals("two", a[0]);
- assertEquals("one", a[1]);
- assertEquals("zero", a[2]);
- }
-
- public void testReverseCharArray() {
- char[] a = this.buildCharArray();
- a = CollectionTools.reverse(a);
- assertEquals('c', a[0]);
- assertEquals('b', a[1]);
- assertEquals('a', a[2]);
- }
-
- public void testReverseIntArray() {
- int[] a = this.buildIntArray();
- a = CollectionTools.reverse(a);
- assertEquals(20, a[0]);
- assertEquals(10, a[1]);
- assertEquals(0, a[2]);
- }
-
- public void testReverseListIterator1() {
- List<String> actual = CollectionTools.reverseList(this.buildStringList1().iterator());
- List<String> expected = this.buildStringList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testReverseListIterator2() {
- List<Object> actual = CollectionTools.<Object>reverseList(this.buildStringList1().iterator());
- List<Object> expected = this.buildObjectList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testRotateObjectArray() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.rotate(a);
- assertEquals("two", a[0]);
- assertEquals("zero", a[1]);
- assertEquals("one", a[2]);
- }
-
- public void testRotateObjectArrayInt() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.rotate(a, 2);
- assertEquals("one", a[0]);
- assertEquals("two", a[1]);
- assertEquals("zero", a[2]);
- }
-
- public void testRotateCharArray() {
- char[] a = this.buildCharArray();
- a = CollectionTools.rotate(a);
- assertEquals('c', a[0]);
- assertEquals('a', a[1]);
- assertEquals('b', a[2]);
- }
-
- public void testRotateCharArrayInt() {
- char[] a = this.buildCharArray();
- a = CollectionTools.rotate(a, 2);
- assertEquals('b', a[0]);
- assertEquals('c', a[1]);
- assertEquals('a', a[2]);
- }
-
- public void testRotateIntArray() {
- int[] a = this.buildIntArray();
- a = CollectionTools.rotate(a);
- assertEquals(20, a[0]);
- assertEquals(0, a[1]);
- assertEquals(10, a[2]);
- }
-
- public void testRotateIntArrayInt() {
- int[] a = this.buildIntArray();
- a = CollectionTools.rotate(a, 2);
- assertEquals(10, a[0]);
- assertEquals(20, a[1]);
- assertEquals(0, a[2]);
- }
-
- public void testSetIterator1() {
- assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().iterator()));
- }
-
- public void testSetIterator2() {
- Set<String> set1 = new HashSet<String>();
- set1.add("0");
- set1.add("1");
- set1.add("2");
- set1.add("3");
-
- Set<Object> set2 = CollectionTools.<Object>set(set1.iterator());
- assertEquals(set1, set2);
- }
-
- public void testSetObjectArray() {
- assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().toArray()));
- }
-
- public void testShuffleObjectArray() {
- String[] array1 = this.buildStringArray1();
- String[] array2 = CollectionTools.shuffle(this.buildStringArray1());
- assertEquals(array1.length, array2.length);
- assertTrue(CollectionTools.containsAll(array1, array2));
- }
-
- public void testShuffleCharArray() {
- char[] array1 = this.buildCharArray();
- char[] array2 = CollectionTools.shuffle(this.buildCharArray());
- assertEquals(array1.length, array2.length);
- assertTrue(CollectionTools.containsAll(array1, array2));
- }
-
- public void testShuffleIntArray() {
- int[] array1 = this.buildIntArray();
- int[] array2 = CollectionTools.shuffle(this.buildIntArray());
- assertEquals(array1.length, array2.length);
- assertTrue(CollectionTools.containsAll(array1, array2));
- }
-
- public void testSingletonIterator1() {
- Iterator<String> stream = CollectionTools.singletonIterator("foo");
- assertTrue(stream.hasNext());
- assertEquals("foo", stream.next());
- }
-
- public void testSingletonIterator2() {
- Iterator<Object> stream = CollectionTools.<Object>singletonIterator("foo");
- assertTrue(stream.hasNext());
- assertEquals("foo", stream.next());
- }
-
- public void testSingletonIterator3() {
- Iterator<Object> stream = CollectionTools.singletonIterator((Object) "foo");
- assertTrue(stream.hasNext());
- assertEquals("foo", stream.next());
- }
-
- public void testSizeIterator() {
- assertEquals(3, CollectionTools.size(this.buildObjectList1().iterator()));
- }
-
- public void testSortedSetIterator1() {
- assertEquals(this.buildSortedStringSet1(), CollectionTools.set(this.buildSortedStringSet1().iterator()));
- }
-
- public void testSortedSetIterator2() {
- SortedSet<String> ss1 = new TreeSet<String>();
- ss1.add("0");
- ss1.add("2");
- ss1.add("3");
- ss1.add("1");
-
- SortedSet<String> set2 = CollectionTools.<String>sortedSet(ss1.iterator());
- assertEquals(ss1, set2);
- }
-
- public void testSortedSetObjectArray() {
- assertEquals(this.buildSortedStringSet1(), CollectionTools.set(this.buildSortedStringSet1().toArray()));
- }
-
- public void testSwapObjectArray() {
- String[] a = this.buildStringArray1();
- a = CollectionTools.swap(a, 1, 2);
- assertEquals("zero", a[0]);
- assertEquals("two", a[1]);
- assertEquals("one", a[2]);
- }
-
- public void testSwapCharArray() {
- char[] a = this.buildCharArray();
- a = CollectionTools.swap(a, 1, 2);
- assertEquals('a', a[0]);
- assertEquals('c', a[1]);
- assertEquals('b', a[2]);
- }
-
- public void testSwapIntArray() {
- int[] a = this.buildIntArray();
- a = CollectionTools.swap(a, 1, 2);
- assertEquals(0, a[0]);
- assertEquals(20, a[1]);
- assertEquals(10, a[2]);
- }
-
- public void testRemoveDuplicateElementsList() {
- List<String> list = this.buildStringVector1();
- list.add("zero");
- list.add("zero");
- list.add("two");
- list.add("zero");
- list = CollectionTools.removeDuplicateElements(list);
- int i = 0;
- assertEquals("zero", list.get(i++));
- assertEquals("one", list.get(i++));
- assertEquals("two", list.get(i++));
- assertEquals(i, list.size());
- }
-
- public void testRemoveDuplicateElementsObjectArray1() {
- List<String> list = this.buildStringVector1();
- list.add("zero");
- list.add("zero");
- list.add("two");
- list.add("zero");
- String[] array = CollectionTools.removeDuplicateElements(list.toArray(new String[list.size()]));
- int i = 0;
- assertEquals("zero", array[i++]);
- assertEquals("one", array[i++]);
- assertEquals("two", array[i++]);
- assertEquals(i, array.length);
- }
-
- public void testRemoveDuplicateElementsObjectArray2() {
- List<String> list = this.buildStringVector1();
- list.add("zero");
- list.add("zero");
- list.add("two");
- list.add("zero");
- String[] array = CollectionTools.removeDuplicateElements(list.toArray(new String[list.size()]));
- int i = 0;
- assertEquals("zero", array[i++]);
- assertEquals("one", array[i++]);
- assertEquals("two", array[i++]);
- assertEquals(i, array.length);
- }
-
- public void testVectorIterator1() {
- Vector<String> v = CollectionTools.vector(this.buildStringList1().iterator());
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorIterator2() {
- Vector<Object> v = CollectionTools.<Object>vector(this.buildStringList1().iterator());
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorObjectArray() {
- Vector<String> v = CollectionTools.vector(this.buildStringArray1());
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- private Object[] buildObjectArray1() {
- return new Object[] { "zero", "one", "two" };
- }
-
- private String[] buildStringArray1() {
- return new String[] { "zero", "one", "two" };
- }
-
- private char[] buildCharArray() {
- return new char[] { 'a', 'b', 'c' };
- }
-
- private int[] buildIntArray() {
- return new int[] { 0, 10, 20 };
- }
-
- private Object[] buildObjectArray2() {
- return new Object[] { "three", "four", "five" };
- }
-
- private String[] buildStringArray2() {
- return new String[] { "three", "four", "five" };
- }
-
- private Vector<String> buildStringVector1() {
- Vector<String> v = new Vector<String>();
- this.addToCollection1(v);
- return v;
- }
-
- private List<String> buildStringList1() {
- List<String> l = new ArrayList<String>();
- this.addToCollection1(l);
- return l;
- }
-
- private List<Object> buildObjectList1() {
- List<Object> l = new ArrayList<Object>();
- this.addToCollection1(l);
- return l;
- }
-
- private void addToCollection1(Collection<? super String> c) {
- c.add("zero");
- c.add("one");
- c.add("two");
- }
-
- private List<String> buildStringList2() {
- List<String> l = new ArrayList<String>();
- this.addToCollection2(l);
- return l;
- }
-
- private void addToCollection2(Collection<? super String> c) {
- c.add("three");
- c.add("four");
- c.add("five");
- }
-
- private Set<String> buildStringSet1() {
- Set<String> s = new HashSet<String>();
- this.addToCollection1(s);
- return s;
- }
-
- private Set<Object> buildObjectSet1() {
- Set<Object> s = new HashSet<Object>();
- this.addToCollection1(s);
- return s;
- }
-
- private SortedSet<String> buildSortedStringSet1() {
- SortedSet<String> s = new TreeSet<String>();
- this.addToCollection1(s);
- return s;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java
deleted file mode 100644
index adcccf0992..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java
+++ /dev/null
@@ -1,594 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.FileTools;
-
-public class FileToolsTests extends TestCase {
- private File tempDir;
-
- public FileToolsTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.tempDir = this.buildTempDir();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- this.deleteDir(this.tempDir);
- }
-
- public void testFilesIn() {
- Collection<File> files = CollectionTools.collection(FileTools.filesIn(this.tempDir.getPath()));
- assertEquals("invalid file count", 3, files.size());
- }
-
- public void testDirectoriesIn() {
- Collection<File> files = CollectionTools.collection(FileTools.directoriesIn(this.tempDir.getPath()));
- assertEquals("invalid directory count", 2, files.size());
- }
-
- public void testFilesInTree() {
- Collection<File> files = CollectionTools.collection(FileTools.filesInTree(this.tempDir.getPath()));
- assertEquals("invalid file count", 9, files.size());
- }
-
- public void testDirectoriesInTree() {
- Collection<File> files = CollectionTools.collection(FileTools.directoriesInTree(this.tempDir.getPath()));
- assertEquals("invalid directory count", 3, files.size());
- }
-
- public void testDeleteDirectory() throws IOException {
- // build another temporary directory just for this test
- File dir = this.buildTempDir();
- assertTrue("temporary directory not created", dir.exists());
- FileTools.deleteDirectory(dir.getPath());
- assertFalse("temporary directory not deleted", dir.exists());
- }
-
- public void testDeleteDirectoryContents() throws IOException {
- // build another temporary directory just for this test
- File dir = this.buildTempDir();
- assertTrue("temporary directory not created", dir.exists());
- FileTools.deleteDirectoryContents(dir.getPath());
- assertTrue("temporary directory should not have been deleted", dir.exists());
- assertTrue("temporary directory contents not deleted", dir.listFiles().length == 0);
- dir.delete();
- }
-
- public void testCopyToFile() throws IOException {
- File destFile = new File(this.tempDir, "destfile.txt");
- this.copyToFile(destFile, "testCopyToFile");
- }
-
- public void testCopyToPreExistingFile() throws IOException {
- File destFile = new File(this.tempDir, "destfile.txt");
- Writer writer = new OutputStreamWriter(new FileOutputStream(destFile));
- writer.write("this text should be replaced...");
- writer.close();
- this.copyToFile(destFile, "testCopyToPreExistingFile");
- }
-
- private void copyToFile(File destFile, String writeString) throws IOException {
- File sourceFile = new File(this.tempDir, "sourcefile.txt");
- char[] readBuffer = new char[writeString.length()];
-
- Writer writer = new OutputStreamWriter(new FileOutputStream(sourceFile));
- writer.write(writeString);
- writer.close();
-
- FileTools.copyToFile(sourceFile, destFile);
-
- Reader reader = new InputStreamReader(new FileInputStream(destFile));
- reader.read(readBuffer);
- reader.close();
- String readString = new String(readBuffer);
- assertEquals(writeString, readString);
- }
-
- public void testCopyToDirectory() throws IOException {
- File sourceFile = new File(this.tempDir, "sourcefile.txt");
- String writeString = "testCopyToDirectory";
-
- File destDir = new File(this.tempDir, "destdir");
- destDir.mkdir();
- File destFile = new File(destDir, "sourcefile.txt");
- char[] readBuffer = new char[writeString.length()];
-
- Writer writer = new OutputStreamWriter(new FileOutputStream(sourceFile));
- writer.write(writeString);
- writer.close();
-
- FileTools.copyToDirectory(sourceFile, destDir);
-
- Reader reader = new InputStreamReader(new FileInputStream(destFile));
- reader.read(readBuffer);
- reader.close();
- String readString = new String(readBuffer);
- assertEquals(writeString, readString);
- }
-
- public void testFilter() throws IOException {
- String prefix = "XXXtestFileXXX";
- File testFile1 = new File(this.tempDir, prefix + "1");
- testFile1.createNewFile();
- File testFile2 = new File(this.tempDir, prefix + "2");
- testFile2.createNewFile();
-
- FileFilter filter = this.buildFileFilter(prefix);
- Iterator<File> filteredFilesIterator = FileTools.filter(FileTools.filesIn(this.tempDir), filter);
- Collection<File> filteredFiles = CollectionTools.collection(filteredFilesIterator);
- assertEquals(2, filteredFiles.size());
- assertTrue(filteredFiles.contains(testFile1));
- assertTrue(filteredFiles.contains(testFile2));
- }
-
- private FileFilter buildFileFilter(final String prefix) {
- return new FileFilter() {
- public boolean accept(File file) {
- return file.getName().startsWith(prefix);
- }
- };
- }
-
- public void testStripExtension() {
- assertEquals("foo", FileTools.stripExtension("foo.xml"));
- assertEquals("foo.bar", FileTools.stripExtension("foo.bar.xml"));
- assertEquals("foo", FileTools.stripExtension("foo"));
- assertEquals("foo", FileTools.stripExtension("foo."));
- }
-
- public void testExtension() {
- assertEquals(".xml", FileTools.extension("foo.xml"));
- assertEquals(".xml", FileTools.extension("foo.bar.xml"));
- assertEquals("", FileTools.extension("foo"));
- assertEquals("", FileTools.extension("foo,xml"));
- assertEquals(".", FileTools.extension("foo."));
- }
-
- public void testEmptyTemporaryDirectory() throws IOException {
- File tempDir1 = FileTools.temporaryDirectory();
- File testFile1 = new File(tempDir1, "junk");
- testFile1.createNewFile();
-
- File tempDir2 = FileTools.emptyTemporaryDirectory();
- assertEquals(tempDir1, tempDir2);
- assertTrue(tempDir2.isDirectory());
- assertEquals(0, tempDir2.listFiles().length);
- tempDir2.delete();
- }
-
- public void testCanonicalFileName() {
- File file1 = new File("foo");
- file1 = new File(file1, "bar");
- file1 = new File(file1, "baz");
- file1 = new File(file1, "..");
- file1 = new File(file1, "..");
- file1 = new File(file1, "bar");
- file1 = new File(file1, "baz");
- File file2 = new File(System.getProperty("user.dir"));
- file2 = new File(file2, "foo");
- file2 = new File(file2, "bar");
- file2 = new File(file2, "baz");
- File file3 = FileTools.canonicalFile(file1);
- assertEquals(file2, file3);
- }
-
- private boolean isExecutingOnWindows() {
- return this.isExecutingOn("Windows");
- }
-
- // private boolean isExecutingOnLinux() {
- // return this.isExecutingOn("Linux");
- // }
- //
- private boolean isExecutingOn(String osName) {
- return System.getProperty("os.name").indexOf(osName) != -1;
- }
-
- public void testPathFiles() {
- File[] expected;
- File[] actual;
-
- if (this.isExecutingOnWindows()) {
- expected = new File[] { new File("C:/"), new File("C:/foo"), new File("C:/foo/bar"), new File("C:/foo/bar/baz.txt") };
- actual = this.pathFiles(new File("C:/foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
- }
-
- expected = new File[] { new File("/"), new File("/foo"), new File("/foo/bar"), new File("/foo/bar/baz.txt") };
- actual = this.pathFiles(new File("/foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
-
- expected = new File[] { new File("foo"), new File("foo/bar"), new File("foo/bar/baz.txt") };
- actual = this.pathFiles(new File("foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
-
- expected = new File[] { new File(".."), new File("../foo"), new File("../foo/bar"), new File("../foo/bar/baz.txt") };
- actual = this.pathFiles(new File("../foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
-
- expected = new File[] { new File("."), new File("./foo"), new File("./foo/bar"), new File("./foo/bar/baz.txt") };
- actual = this.pathFiles(new File("./foo/bar/baz.txt"));
- assertTrue(Arrays.equals(expected, actual));
- }
-
- private File[] pathFiles(File file) {
- return (File[]) ClassTools.executeStaticMethod(FileTools.class, "pathFiles", File.class, file);
- }
-
- public void testRelativeParentFile() {
- assertEquals(new File(".."), this.relativeParentFile(1));
- assertEquals(new File("../.."), this.relativeParentFile(2));
- assertEquals(new File("../../.."), this.relativeParentFile(3));
-
- boolean exCaught = false;
- try {
- File file = this.relativeParentFile(0);
- fail("invalid return: " + file);
- } catch (RuntimeException ex) {
- if (ex.getCause() instanceof InvocationTargetException) {
- InvocationTargetException ite = (InvocationTargetException) ex.getCause();
- if (ite.getTargetException() instanceof IllegalArgumentException) {
- exCaught = true;
- }
- }
- }
- assertTrue(exCaught);
- }
-
- private File relativeParentFile(int len) {
- return (File) ClassTools.executeStaticMethod(FileTools.class, "relativeParentFile", int.class, new Integer(len));
- }
-
- public void testConvertToRelativeFile() {
- String prefix = this.isExecutingOnWindows() ? "C:" : "";
- File file;
- File dir;
- File relativeFile;
-
- if (this.isExecutingOnWindows()) {
- // on Windows, a drive must be specified for a file to be absolute (i.e. not relative)
- this.verifyUnchangedRelativeFile("/dir1/dir2/file.txt", "C:/dir1/dir2");
- // different drives
- this.verifyUnchangedRelativeFile("D:/dir1/dir2/file.txt", "C:/dir1/dir2");
- }
- this.verifyUnchangedRelativeFile("dir1/dir2/file.txt", prefix + "/dir1/dir2");
- this.verifyUnchangedRelativeFile("./dir1/dir2/file.txt", prefix + "/dir1/dir2");
- this.verifyUnchangedRelativeFile("../../dir1/dir2/file.txt", prefix + "/dir1/dir2");
-
- file = new File(prefix + "/dir1/dir2");
- dir = new File(prefix + "/dir1/dir2");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("."), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/../dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/dir3/dir4/dir5/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("dir3/dir4/dir5/file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("../../../file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("../file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2/dirA/dirB/dirC/file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("../../../dirA/dirB/dirC/file.txt"), relativeFile);
-
- file = new File(prefix + "/dir1/dir2");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("../../.."), relativeFile);
-
- file = new File(prefix + "/My Documents/My Workspace/Project 1/lib/toplink.jar");
- dir = new File(prefix + "/My Documents/My Workspace/Project 1");
- relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(new File("lib/toplink.jar"), relativeFile);
- }
-
- private void verifyUnchangedRelativeFile(String fileName, String dirName) {
- File file = new File(fileName);
- File dir = new File(dirName);
- File relativeFile = FileTools.convertToRelativeFile(file, dir);
- assertEquals(file, relativeFile);
- }
-
- public void testConvertToAbsoluteFile() {
- String prefix = this.isExecutingOnWindows() ? "C:" : "";
- File file;
- File dir;
- File absoluteFile;
-
- if (this.isExecutingOnWindows()) {
- // on Windows, a drive must be specified for a file to be absolute (i.e. not relative)
- this.verifyUnchangedAbsoluteFile("C:/dir1/dir2/file.txt", "C:/dir1/dir2");
- // different drives
- this.verifyUnchangedAbsoluteFile("D:/dir1/dir2/file.txt", "C:/dir1/dir2");
- }
- this.verifyUnchangedAbsoluteFile(prefix + "/dir1/dir2/file.txt", prefix + "/dir1/dir2");
- this.verifyUnchangedAbsoluteFile(prefix + "/./dir1/dir2/file.txt", prefix + "/dir1/dir2");
- this.verifyUnchangedAbsoluteFile(prefix + "/dir1/dir2/../../dir1/dir2/file.txt", prefix + "/dir1/dir2");
-
- file = new File(".");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2"), absoluteFile);
-
- file = new File("./file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- file = new File("file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- file = new File("../dir2/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- file = new File("dir3/dir4/dir5/file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/dir3/dir4/dir5/file.txt"), absoluteFile);
-
- file = new File("../../../file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- // too many ".." directories will resolve to the root;
- // this is consistent with Windows and Linux command shells
- file = new File("../../../../../../../../file.txt");
- dir = new File(prefix + "/dir1/dir2");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/file.txt"), absoluteFile);
-
- file = new File("../file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/file.txt"), absoluteFile);
-
- file = new File("../../../dirA/dirB/dirC/file.txt");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2/dirA/dirB/dirC/file.txt"), absoluteFile);
-
- file = new File("../../..");
- dir = new File(prefix + "/dir1/dir2/dir3/dir4/dir5");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/dir1/dir2"), absoluteFile);
-
- file = new File("lib/toplink.jar");
- dir = new File(prefix + "/My Documents/My Workspace/Project 1");
- absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(new File(prefix + "/My Documents/My Workspace/Project 1/lib/toplink.jar"), absoluteFile);
- }
-
- public void testFileNameIsReserved() {
- boolean expected = this.isExecutingOnWindows();
- assertEquals(expected, FileTools.fileNameIsReserved("CON"));
- assertEquals(expected, FileTools.fileNameIsReserved("con"));
- assertEquals(expected, FileTools.fileNameIsReserved("cON"));
- assertEquals(expected, FileTools.fileNameIsReserved("AUX"));
- assertEquals(expected, FileTools.fileNameIsReserved("COM3"));
- assertEquals(expected, FileTools.fileNameIsReserved("LPT3"));
- assertEquals(expected, FileTools.fileNameIsReserved("nUL"));
- assertEquals(expected, FileTools.fileNameIsReserved("Prn"));
- }
-
- public void testFileHasAnyReservedComponents() {
- boolean expected = this.isExecutingOnWindows();
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("C:/CON")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("/con/foo")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("c:/temp/cON")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("bar//baz//AUX")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("COM3//ttt")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("d:/LPT3/xxx")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("c:/my docs and stuff/tuesday/nUL")));
- assertEquals(expected, FileTools.fileHasAnyReservedComponents(new File("Prn")));
- }
-
- public void testShortenFileNameFile() {
- if (this.isExecutingOnWindows()) {
- this.verifyShortenFileNameFileWin();
- } else {
- this.verifyShortenFileNameFileNonWin();
- }
- }
-
- private void verifyShortenFileNameFileWin() {
- File file = new File("C:\\Documents and Settings\\Administrator\\Desktop\\Project\\Text.txt");
- String fileName = FileTools.shortenFileName(file);
- assertEquals("C:\\Documents and Settings\\...\\Desktop\\Project\\Text.txt", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
-
- file = new File("C:/");
- fileName = FileTools.shortenFileName(file);
- assertEquals("C:\\", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- private void verifyShortenFileNameFileNonWin() {
- File file = new File("/home/administrator/documents and settings/desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(file);
- assertEquals("/home/administrator/.../desktop/Project/Text.txt", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
-
- file = new File("/home");
- fileName = FileTools.shortenFileName(file);
- assertEquals("/home", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- public void testShortenFileNameFileInt() {
- if (this.isExecutingOnWindows()) {
- this.verifyShortenFileNameFileIntWin();
- } else {
- this.verifyShortenFileNameFileIntNonWin();
- }
- }
-
- private void verifyShortenFileNameFileIntWin() {
- File file = new File("C:\\Documents and Settings\\Administrator\\Desktop\\Project\\Text.txt");
- String fileName = FileTools.shortenFileName(file, 31);
- assertEquals("C:\\...\\Desktop\\Project\\Text.txt", fileName);
- assertEquals(31, fileName.length());
-
- file = new File("C:/This is the file name.txt");
- fileName = FileTools.shortenFileName(file, 10);
- assertEquals("C:\\This is the file name.txt", fileName);
- assertEquals(28, fileName.length());
- }
-
- private void verifyShortenFileNameFileIntNonWin() {
- File file = new File("/home/administrator/documents and settings/desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(file, 31);
- assertEquals("/home/.../desktop/Project/Text.txt", fileName);
- assertEquals(34, fileName.length());
-
- file = new File("/This is the file name.txt");
- fileName = FileTools.shortenFileName(file, 10);
- assertEquals("/This is the file name.txt", fileName);
- assertEquals(26, fileName.length());
- }
-
- public void testShortenFileNameURL() throws Exception {
- if (this.isExecutingOnWindows()) {
- this.verifyShortenFileNameURLWin();
- } else {
- this.verifyShortenFileNameURLNonWin();
- }
- }
-
- private void verifyShortenFileNameURLWin() throws Exception {
- URL url = new URL("file", "", "C:/Documents and Settings/Administrator/Desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(url);
- assertEquals("C:\\Documents and Settings\\...\\Desktop\\Project\\Text.txt", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- private void verifyShortenFileNameURLNonWin() throws Exception {
- URL url = new URL("file", "", "/home/administrator/documents and settings/desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(url);
- assertEquals("/home/administrator/.../desktop/Project/Text.txt", fileName);
- assertTrue(fileName.length() <= FileTools.MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- public void testShortenFileNameURLInt() throws Exception {
- if (this.isExecutingOnWindows()) {
- this.verifyShortenFileNameURLIntWin();
- } else {
- this.verifyShortenFileNameURLIntNonWin();
- }
- }
-
- private void verifyShortenFileNameURLIntWin() throws Exception {
- URL url = new URL("file", "", "/C:/Documents and Settings/Administrator/Desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(url, 31);
- assertEquals("C:\\...\\Desktop\\Project\\Text.txt", fileName);
- assertEquals(31, fileName.length());
- }
-
- private void verifyShortenFileNameURLIntNonWin() throws Exception {
- URL url = new URL("file", "", "/home/administrator/documents and settings/desktop/Project/Text.txt");
- String fileName = FileTools.shortenFileName(url, 31);
- assertEquals("/home/.../desktop/Project/Text.txt", fileName);
- assertEquals(34, fileName.length());
- }
-
- private void verifyUnchangedAbsoluteFile(String fileName, String dirName) {
- File file = new File(fileName);
- File dir = new File(dirName);
- File absoluteFile = FileTools.convertToAbsoluteFile(file, dir);
- assertEquals(file, absoluteFile);
- }
-
- private File buildTempDir() throws IOException {
- // build a new directory for each test, to prevent any cross-test effects
- File dir = FileTools.newTemporaryDirectory(ClassTools.shortClassNameForObject(this) + "." + this.getName());
-
- File file0a = new File(dir, "file0a");
- file0a.createNewFile();
- File file0b = new File(dir, "file0b");
- file0b.createNewFile();
- File file0c = new File(dir, "file0c");
- file0c.createNewFile();
-
- File subdir1 = new File(dir, "subdir1");
- subdir1.mkdir();
- File file1a = new File(subdir1, "file1a");
- file1a.createNewFile();
- File file1b = new File(subdir1, "file1b");
- file1b.createNewFile();
-
- File subdir2 = new File(dir, "subdir2");
- subdir2.mkdir();
- File file2a = new File(subdir2, "file2a");
- file2a.createNewFile();
- File file2b = new File(subdir2, "file2b");
- file2b.createNewFile();
-
- File subdir3 = new File(subdir2, "subdir3");
- subdir3.mkdir();
- File file3a = new File(subdir3, "file3a");
- file3a.createNewFile();
- File file3b = new File(subdir3, "file3b");
- file3b.createNewFile();
-
- return dir;
- }
-
- private void deleteDir(File dir) {
- FileTools.deleteDirectory(dir);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java
deleted file mode 100644
index 51120c9eb2..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-
-public class HashBagTests extends TestCase {
- private HashBag<String> bag;
-
- public HashBagTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.bag = this.buildBag();
- }
-
- private HashBag<String> buildBag() {
- HashBag<String> b = new HashBag<String>();
- b.add(null);
- b.add(new String("one"));
- b.add(new String("two"));
- b.add(new String("two"));
- b.add(new String("three"));
- b.add(new String("three"));
- b.add(new String("three"));
- b.add(new String("four"));
- b.add(new String("four"));
- b.add(new String("four"));
- b.add(new String("four"));
- return b;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- private Collection<String> buildCollection() {
- Collection<String> c = new ArrayList<String>();
- c.add(new String("foo"));
- c.add(new String("foo"));
- c.add(new String("bar"));
- c.add(new String("bar"));
- c.add(new String("bar"));
- return c;
- }
-
- public void testCtorCollection() {
- Collection<String> c = this.buildCollection();
- Bag<String> b = new HashBag<String>(c);
- for (String s : c) {
- assertTrue("missing element", b.contains(s));
- }
- }
-
- public void testCtorIntFloat() {
- boolean exCaught;
-
- exCaught = false;
- try {
- this.bag = new HashBag<String>(-20, 0.66f);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown", exCaught);
-
- exCaught = false;
- try {
- this.bag = new HashBag<String>(20, -0.66f);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown", exCaught);
- }
-
- public void testAdd() {
- // the other adds took place in setUp
- assertTrue("incorrect return value", this.bag.add("five"));
-
- assertTrue("missing element", this.bag.contains("one"));
- assertTrue("missing element", this.bag.contains("two"));
- assertTrue("missing element", this.bag.contains("three"));
- assertTrue("missing element", this.bag.contains("four"));
- assertTrue("missing element", this.bag.contains("five"));
- }
-
- public void testAddAll() {
- Collection<String> c = this.buildCollection();
- assertTrue("incorrect return value", this.bag.addAll(c));
- for (String s : c) {
- assertTrue("missing element", this.bag.contains(s));
- }
- }
-
- public void testClear() {
- assertTrue("missing element", this.bag.contains("one"));
- assertTrue("missing element", this.bag.contains("two"));
- assertTrue("missing element", this.bag.contains("three"));
- assertTrue("missing element", this.bag.contains("four"));
- assertTrue("missing element", this.bag.contains(null));
- assertEquals("invalid size", 11, this.bag.size());
- this.bag.clear();
- assertFalse("malingering element", this.bag.contains("one"));
- assertFalse("malingering element", this.bag.contains("two"));
- assertFalse("malingering element", this.bag.contains("three"));
- assertFalse("malingering element", this.bag.contains("four"));
- assertFalse("malingering element", this.bag.contains(null));
- assertEquals("invalid size", 0, this.bag.size());
- }
-
- public void testClone() {
- Bag<String> bag2 = this.bag.clone();
- assertTrue("bad clone", this.bag != bag2);
- assertEquals("bad clone", this.bag, bag2);
- assertTrue("bad clone", this.bag.hashCode() == bag2.hashCode());
- }
-
- public void testContains() {
- assertTrue("missing element", this.bag.contains(null));
- assertTrue("missing element", this.bag.contains("one"));
- assertTrue("missing element", this.bag.contains("two"));
- assertTrue("missing element", this.bag.contains("three"));
- assertTrue("missing element", this.bag.contains("four"));
- assertTrue("missing element", this.bag.contains(new String("four")));
- assertTrue("missing element", this.bag.contains("fo" + "ur"));
- assertFalse("element found", this.bag.contains("five"));
- }
-
- public void testContainsAll() {
- Collection<String> c = new ArrayList<String>();
- c.add(null);
- c.add(new String("one"));
- c.add(new String("two"));
- c.add(new String("three"));
- c.add(new String("four"));
- assertTrue("missing element(s)", this.bag.containsAll(c));
- }
-
- public void testCount() {
- assertEquals("bad count", 0, this.bag.count("zero"));
- assertEquals("bad count", 1, this.bag.count("one"));
- assertEquals("bad count", 2, this.bag.count("two"));
- assertEquals("bad count", 3, this.bag.count("three"));
- assertEquals("bad count", 4, this.bag.count("four"));
- assertEquals("bad count", 0, this.bag.count("five"));
- }
-
- public void testEquals() {
- Bag<String> bag2 = this.buildBag();
- assertEquals("bags are not equal", this.bag, bag2);
- bag2.add("five");
- assertFalse("bags are equal", this.bag.equals(bag2));
- Collection<String> c = new ArrayList<String>(this.bag);
- assertFalse("bags are not equal to collections", this.bag.equals(c));
- }
-
- public void testHashCode() {
- Bag<String> bag2 = this.buildBag();
- assertEquals("bad hash code", this.bag.hashCode(), bag2.hashCode());
- }
-
- public void testIsEmpty() {
- assertFalse("bag is empty", this.bag.isEmpty());
- this.bag.clear();
- assertTrue("bag is not empty", this.bag.isEmpty());
- this.bag.add("foo");
- assertFalse("bag is empty", this.bag.isEmpty());
- }
-
- public void testEmptyIterator() {
- this.bag.clear();
- Iterator<String> iterator = this.bag.iterator();
- assertFalse("iterator is not empty", iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + element, exCaught);
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- public void testIterator() {
- int i = 0;
- Iterator<String> iterator = this.bag.iterator();
- assertTrue("iterator is empty", iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals("invalid hasNext() loop", 11, i);
- assertFalse("iterator should be empty now", iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + element, exCaught);
-
- iterator.remove();
- assertEquals("iterator did not remove element", 10, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
-
- // start over
- iterator = this.bag.iterator();
- this.bag.add("five");
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue("ConcurrentModificationException not thrown", exCaught);
- }
-
- public void testUniqueIterator() {
- int i = 0;
- Iterator<String> iterator = this.bag.uniqueIterator();
- assertTrue("iterator is empty", iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals("invalid hasNext() loop", 5, i);
- assertFalse("iterator should be empty now", iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + element, exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- Object next = null;
- while (iterator.hasNext() && !"four".equals(next)) {
- next = iterator.next();
- }
- iterator.remove();
- assertEquals("iterator did not remove all copies of element", 7, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- this.bag.add("five");
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue("ConcurrentModificationException not thrown", exCaught);
- }
-
- public void testHashingDistribution() throws Exception {
- Bag<String> bigBag = new HashBag<String>();
- for (int i = 0; i < 10000; i++) {
- bigBag.add("object" + i);
- }
-
- java.lang.reflect.Field field = bigBag.getClass().getDeclaredField("table");
- field.setAccessible(true);
- Object[] table = (Object[]) field.get(bigBag);
- int bucketCount = table.length;
- int filledBucketCount = 0;
- for (Object o : table) {
- if (o != null) {
- filledBucketCount++;
- }
- }
- float loadFactor = ((float) filledBucketCount) / ((float) bucketCount);
- assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor > 0.20);
- assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor < 0.75);
- }
-
- public void testRemove() {
- assertTrue("incorrect return value", this.bag.remove("one"));
- assertFalse("element still present", this.bag.contains("one"));
- assertFalse("incorrect return value", this.bag.remove("one"));
-
- assertTrue("incorrect return value", this.bag.remove("two"));
- assertTrue("incorrect return value", this.bag.remove("two"));
- assertFalse("element still present", this.bag.contains("one"));
- assertFalse("incorrect return value", this.bag.remove("one"));
- }
-
- public void testRemoveAll() {
- Collection<String> c = new ArrayList<String>();
- c.add("one");
- c.add("three");
- assertTrue("incorrect return value", this.bag.removeAll(c));
- assertFalse("element still present", this.bag.contains("one"));
- assertFalse("element still present", this.bag.contains("three"));
- assertFalse("incorrect return value", this.bag.remove("one"));
- assertFalse("incorrect return value", this.bag.remove("three"));
- assertFalse("incorrect return value", this.bag.removeAll(c));
- }
-
- public void testRetainAll() {
- Collection<String> c = new ArrayList<String>();
- c.add("one");
- c.add("three");
- assertTrue("incorrect return value", this.bag.retainAll(c));
- assertTrue("element removed", this.bag.contains("one"));
- assertTrue("element removed", this.bag.contains("three"));
- assertFalse("element still present", this.bag.contains("two"));
- assertFalse("element still present", this.bag.contains("four"));
- assertFalse("incorrect return value", this.bag.remove("two"));
- assertFalse("incorrect return value", this.bag.remove("four"));
- assertFalse("incorrect return value", this.bag.retainAll(c));
- }
-
- public void testSize() {
- assertTrue("incorrect size", this.bag.size() == 11);
- this.bag.add("five");
- this.bag.add("five");
- this.bag.add("five");
- this.bag.add("five");
- this.bag.add("five");
- assertEquals("incorrect size", 16, this.bag.size());
- }
-
- public void testSerialization() throws Exception {
- Bag<String> bag2 = TestTools.serialize(this.bag);
-
- assertTrue("same object?", this.bag != bag2);
- assertEquals("incorrect size", 11, bag2.size());
- assertEquals("unequal bag", this.bag, bag2);
- // look for similar elements
- assertTrue("missing element", bag2.contains(null));
- assertTrue("missing element", bag2.contains("one"));
- assertTrue("missing element", bag2.contains("two"));
- assertTrue("missing element", bag2.contains("three"));
- assertTrue("missing element", bag2.contains("four"));
-
- int nullCount = 0, oneCount = 0, twoCount = 0, threeCount = 0, fourCount = 0;
- for (String s : bag2) {
- if (s == null) {
- nullCount++;
- } else if (s.equals("one")) {
- oneCount++;
- } else if (s.equals("two")) {
- twoCount++;
- } else if (s.equals("three")) {
- threeCount++;
- } else if (s.equals("four")) {
- fourCount++;
- }
- }
- assertEquals("bad element count", 1, nullCount);
- assertEquals("bad element count", 1, oneCount);
- assertEquals("bad element count", 2, twoCount);
- assertEquals("bad element count", 3, threeCount);
- assertEquals("bad element count", 4, fourCount);
- }
-
- public void testToArray() {
- Object[] a = this.bag.toArray();
- assertEquals("incorrect length", 11, a.length);
- assertTrue("missing element", CollectionTools.contains(a, null));
- assertTrue("missing element", CollectionTools.contains(a, "one"));
- assertTrue("missing element", CollectionTools.contains(a, "two"));
- assertTrue("missing element", CollectionTools.contains(a, "three"));
- assertTrue("missing element", CollectionTools.contains(a, "four"));
- }
-
- public void testToArrayObjectArray() {
- String[] a = new String[12];
- a[11] = "not null";
- String[] b = this.bag.toArray(a);
- assertEquals("different array", a, b);
- assertEquals("incorrect length", 12, a.length);
- assertTrue("missing element", CollectionTools.contains(a, null));
- assertTrue("missing element", CollectionTools.contains(a, "one"));
- assertTrue("missing element", CollectionTools.contains(a, "two"));
- assertTrue("missing element", CollectionTools.contains(a, "three"));
- assertTrue("missing element", CollectionTools.contains(a, "four"));
- assertTrue("missing null element", a[11] == null);
- }
-
- public void testToString() {
- String s = this.bag.toString();
- assertTrue("invalid string prefix", s.startsWith("["));
- assertTrue("invalid string suffix", s.endsWith("]"));
- int commaCount = 0;
- for (int i = 0; i < s.length(); i++) {
- if (s.charAt(i) == ',') {
- commaCount++;
- }
- }
- assertEquals("invalid number of commas", 10, commaCount);
- assertTrue("missing element toString()", s.indexOf("one") != -1);
- assertTrue("missing element toString()", s.indexOf("two") != -1);
- assertTrue("missing element toString()", s.indexOf("three") != -1);
- assertTrue("missing element toString()", s.indexOf("four") != -1);
- assertTrue("missing element toString()", s.indexOf("null") != -1);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java
deleted file mode 100644
index c96213249b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import java.io.StringWriter;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.IndentingPrintWriter;
-
-public class IndentingPrintWriterTests extends TestCase {
- StringWriter sw1;
- StringWriter sw2;
- IndentingPrintWriter ipw1;
- IndentingPrintWriter ipw2;
-
- static final String CR = System.getProperty("line.separator");
-
- public IndentingPrintWriterTests(String name) {
- super(name);
- }
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
- this.sw1 = new StringWriter();
- this.ipw1 = new IndentingPrintWriter(this.sw1);
- this.sw2 = new StringWriter();
- this.ipw2 = new IndentingPrintWriter(this.sw2, " "); // indent with 4 spaces instead of a tab
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIndent() {
- assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel());
- this.ipw1.indent();
- assertEquals("wrong indent level", 1, this.ipw1.getIndentLevel());
- }
-
- public void testUndent() {
- assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel());
- this.ipw1.indent();
- assertEquals("wrong indent level", 1, this.ipw1.getIndentLevel());
- this.ipw1.undent();
- assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel());
- }
-
- public void testIncrementIndentLevel() {
- assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel());
- this.ipw1.incrementIndentLevel();
- assertEquals("wrong indent level", 1, this.ipw1.getIndentLevel());
- }
-
- public void testDecrementIndentLevel() {
- assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel());
- this.ipw1.incrementIndentLevel();
- assertEquals("wrong indent level", 1, this.ipw1.getIndentLevel());
- this.ipw1.decrementIndentLevel();
- assertEquals("wrong indent level", 0, this.ipw1.getIndentLevel());
- }
-
- public void testPrintTab() {
- String expected = "foo0" + CR + "\tfoo1" + CR + "\tfoo1" + CR + "\t\tfoo2" + CR + "\tfoo1" + CR + "\tfoo1" + CR + "foo0" + CR;
-
- this.ipw1.println("foo0");
- this.ipw1.indent();
- this.ipw1.println("foo1");
- this.ipw1.println("foo1");
- this.ipw1.indent();
- this.ipw1.println("foo2");
- this.ipw1.undent();
- this.ipw1.println("foo1");
- this.ipw1.println("foo1");
- this.ipw1.undent();
- this.ipw1.println("foo0");
-
- assertEquals("bogus output", expected, this.sw1.toString());
- }
-
- public void testPrintSpaces() {
- String expected = "foo0" + CR + " foo1" + CR + " foo1" + CR + " foo2" + CR + " foo1" + CR + " foo1" + CR + "foo0" + CR;
-
- this.ipw2.println("foo0");
- this.ipw2.indent();
- this.ipw2.println("foo1");
- this.ipw2.println("foo1");
- this.ipw2.indent();
- this.ipw2.println("foo2");
- this.ipw2.undent();
- this.ipw2.println("foo1");
- this.ipw2.println("foo1");
- this.ipw2.undent();
- this.ipw2.println("foo0");
-
- assertEquals("bogus output", expected, this.sw2.toString());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java
deleted file mode 100644
index 40f152dfa9..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import java.sql.Types;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.JDBCType;
-
-public class JDBCTypeTests extends TestCase {
-
- public JDBCTypeTests(String name) {
- super(name);
- }
-
- public void testTypesSize() {
- assertEquals(Types.class.getDeclaredFields().length, JDBCType.types().length);
- }
-
- public void testName() {
- JDBCType jdbcType;
- jdbcType = JDBCType.type(Types.VARCHAR);
- assertEquals("VARCHAR", jdbcType.getName());
-
- jdbcType = JDBCType.type(Types.INTEGER);
- assertEquals("INTEGER", jdbcType.getName());
- }
-
- public void testCode() {
- JDBCType jdbcType;
- jdbcType = JDBCType.type(Types.VARCHAR);
- assertEquals(Types.VARCHAR, jdbcType.getCode());
-
- jdbcType = JDBCType.type(Types.INTEGER);
- assertEquals(Types.INTEGER, jdbcType.getCode());
- }
-
- public void testInvalidTypeCode() throws Exception {
- boolean exCaught = false;
- try {
- JDBCType jdbcType = JDBCType.type(55);
- fail("invalid JDBCType: " + jdbcType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidTypeName() throws Exception {
- boolean exCaught = false;
- try {
- JDBCType jdbcType = JDBCType.type("VARCHAR2");
- fail("invalid JDBCType: " + jdbcType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java
deleted file mode 100644
index 1a0c0b826f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.JavaType;
-
-public class JavaTypeTests extends TestCase {
-
- public JavaTypeTests(String name) {
- super(name);
- }
-
- public void testInvalidElementTypeNull() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new JavaType(null, 0);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidElementTypeEmpty() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new JavaType("", 0);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidElementTypeArray() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new JavaType(java.lang.Object[].class.getName(), 0);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidArrayDepthNegative() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new JavaType(java.lang.Object.class.getName(), -2);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidVoidArray() throws Exception {
- boolean exCaught = false;
- try {
- JavaType javaType = new JavaType(void.class.getName(), 2);
- fail("invalid JavaType: " + javaType);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testElementTypeName() throws Exception {
- JavaType javaType;
- javaType = new JavaType(java.lang.Object.class);
- assertEquals("java.lang.Object", javaType.getElementTypeName());
-
- javaType = new JavaType(java.lang.Object[].class);
- assertEquals("java.lang.Object", javaType.getElementTypeName());
-
- javaType = new JavaType(int.class);
- assertEquals("int", javaType.getElementTypeName());
-
- javaType = new JavaType(int[].class);
- assertEquals("int", javaType.getElementTypeName());
-
- javaType = new JavaType(void.class);
- assertEquals("void", javaType.getElementTypeName());
-
- javaType = new JavaType(java.util.Map.Entry.class);
- assertEquals("java.util.Map$Entry", javaType.getElementTypeName());
-
- javaType = new JavaType(java.util.Map.Entry[][].class);
- assertEquals("java.util.Map$Entry", javaType.getElementTypeName());
- }
-
- public void testArrayDepth() throws Exception {
- JavaType javaType;
- javaType = new JavaType(java.lang.Object.class);
- assertEquals(0, javaType.getArrayDepth());
-
- javaType = new JavaType(java.lang.Object[].class);
- assertEquals(1, javaType.getArrayDepth());
-
- javaType = new JavaType(int.class);
- assertEquals(0, javaType.getArrayDepth());
-
- javaType = new JavaType(int[].class);
- assertEquals(1, javaType.getArrayDepth());
-
- javaType = new JavaType(void.class);
- assertEquals(0, javaType.getArrayDepth());
-
- javaType = new JavaType(java.util.Map.Entry.class);
- assertEquals(0, javaType.getArrayDepth());
-
- javaType = new JavaType(java.util.Map.Entry[][].class);
- assertEquals(2, javaType.getArrayDepth());
- }
-
- public void testIsArray() throws Exception {
- JavaType javaType;
- javaType = new JavaType(java.lang.Object.class);
- assertFalse(javaType.isArray());
-
- javaType = new JavaType(java.lang.Object[].class);
- assertTrue(javaType.isArray());
-
- javaType = new JavaType(int.class);
- assertFalse(javaType.isArray());
-
- javaType = new JavaType(int[].class);
- assertTrue(javaType.isArray());
-
- javaType = new JavaType(void.class);
- assertFalse(javaType.isArray());
-
- javaType = new JavaType(java.util.Map.Entry.class);
- assertFalse(javaType.isArray());
-
- javaType = new JavaType(java.util.Map.Entry[][].class);
- assertTrue(javaType.isArray());
- }
-
- public void testJavaClass() throws Exception {
- this.verifyJavaClass(java.lang.Object.class);
- this.verifyJavaClass(java.lang.Object[].class);
- this.verifyJavaClass(int.class);
- this.verifyJavaClass(int[].class);
- this.verifyJavaClass(void.class);
- this.verifyJavaClass(java.util.Map.Entry.class);
- this.verifyJavaClass(java.util.Map.Entry[][].class);
- }
-
- private void verifyJavaClass(Class<?> javaClass) throws Exception {
- JavaType javaType = new JavaType(javaClass);
- assertEquals(javaClass, javaType.javaClass());
- }
-
- public void testJavaClassName() throws Exception {
- JavaType javaType;
- javaType = new JavaType(java.lang.Object.class);
- assertEquals("java.lang.Object", javaType.javaClassName());
-
- javaType = new JavaType(java.lang.Object[].class);
- assertEquals("[Ljava.lang.Object;", javaType.javaClassName());
-
- javaType = new JavaType(int.class);
- assertEquals("int", javaType.javaClassName());
-
- javaType = new JavaType(int[].class);
- assertEquals("[I", javaType.javaClassName());
-
- javaType = new JavaType(void.class);
- assertEquals("void", javaType.javaClassName());
-
- javaType = new JavaType(java.util.Map.Entry.class);
- assertEquals("java.util.Map$Entry", javaType.javaClassName());
-
- javaType = new JavaType(java.util.Map.Entry[][].class);
- assertEquals("[[Ljava.util.Map$Entry;", javaType.javaClassName());
- }
-
- public void testDescribes() throws Exception {
- this.verifyDescribes(java.lang.Object.class);
- this.verifyDescribes(java.lang.Object[].class);
- this.verifyDescribes(int.class);
- this.verifyDescribes(int[].class);
- this.verifyDescribes(void.class);
- this.verifyDescribes(java.util.Map.Entry.class);
- this.verifyDescribes(java.util.Map.Entry[][].class);
- }
-
- private void verifyDescribes(Class<?> javaClass) throws Exception {
- JavaType javaType = new JavaType(javaClass);
- assertTrue(javaType.describes(javaClass));
- }
-
- public void testDeclaration() throws Exception {
- JavaType javaType;
- javaType = new JavaType(java.lang.Object.class);
- assertEquals("java.lang.Object", javaType.declaration());
-
- javaType = new JavaType(java.lang.Object[].class);
- assertEquals("java.lang.Object[]", javaType.declaration());
-
- javaType = new JavaType(int.class);
- assertEquals("int", javaType.declaration());
-
- javaType = new JavaType(int[].class);
- assertEquals("int[]", javaType.declaration());
-
- javaType = new JavaType(void.class);
- assertEquals("void", javaType.declaration());
-
- javaType = new JavaType(java.util.Map.Entry.class);
- assertEquals("java.util.Map.Entry", javaType.declaration());
-
- javaType = new JavaType(java.util.Map.Entry[][].class);
- assertEquals("java.util.Map.Entry[][]", javaType.declaration());
- }
-
- public void testIsPrimitive() throws Exception {
- JavaType javaType;
- javaType = new JavaType(java.lang.Object.class);
- assertFalse(javaType.isPrimitive());
-
- javaType = new JavaType(java.lang.Object[].class);
- assertFalse(javaType.isPrimitive());
-
- javaType = new JavaType(int.class);
- assertTrue(javaType.isPrimitive());
-
- javaType = new JavaType(int[].class);
- assertFalse(javaType.isPrimitive());
-
- javaType = new JavaType(void.class);
- assertTrue(javaType.isPrimitive());
-
- javaType = new JavaType(java.util.Map.Entry.class);
- assertFalse(javaType.isPrimitive());
-
- javaType = new JavaType(java.util.Map.Entry[][].class);
- assertFalse(javaType.isPrimitive());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java
deleted file mode 100644
index 82143f3bb4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.tests.internal.iterators.JptUtilityIteratorsTests;
-
-/**
- * decentralize test creation code
- */
-public class JptUtilityTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(ClassTools.packageNameFor(JptUtilityTests.class));
-
- suite.addTest(JptUtilityIteratorsTests.suite());
-
- suite.addTestSuite(BitToolsTests.class);
- suite.addTestSuite(ClasspathTests.class);
- suite.addTestSuite(ClassToolsTests.class);
- suite.addTestSuite(CollectionToolsTests.class);
- suite.addTestSuite(FileToolsTests.class);
- suite.addTestSuite(HashBagTests.class);
- suite.addTestSuite(IndentingPrintWriterTests.class);
- suite.addTestSuite(JavaTypeTests.class);
- suite.addTestSuite(JDBCTypeTests.class);
- suite.addTestSuite(NameToolsTests.class);
- suite.addTestSuite(ReverseComparatorTests.class);
- suite.addTestSuite(StringToolsTests.class);
- suite.addTestSuite(XMLStringEncoderTests.class);
-
- return suite;
- }
-
- private JptUtilityTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java
deleted file mode 100644
index 164fa49e03..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.NameTools;
-
-public class NameToolsTests extends TestCase {
-
- public NameToolsTests(String name) {
- super(name);
- }
-
- public void testStringAbsentIgnoreCase() {
- List<String> colorCollection = this.buildColorCollection();
- String returned = NameTools.uniqueNameForIgnoreCase("Taupe", colorCollection);
- assertEquals("Taupe", returned);
- }
-
- public void testStringPresentCaseDiffers() {
- List<String> colorCollection = this.buildColorCollection();
- String returned = NameTools.uniqueNameFor("green", colorCollection);
- assertEquals("green", returned);
- }
-
- public void testStringPresentIgnoreCase() {
- List<String> colorCollection = this.buildColorCollection();
- String returned = NameTools.uniqueNameForIgnoreCase("green", colorCollection);
- assertEquals("green2", returned);
- }
-
- public void testStringPresentWithAppendices() {
- List<String> colorCollection = this.buildColorCollection();
- colorCollection.add("Red1");
- colorCollection.add("red2");
- String returned = NameTools.uniqueNameForIgnoreCase("red", colorCollection);
- colorCollection.remove("Red1");
- colorCollection.remove("red2");
- assertEquals("red3", returned);
- }
-
- private List<String> buildColorCollection() {
- List<String> colorCollection = new ArrayList<String>();
- colorCollection.add("Red");
- colorCollection.add("Orange");
- colorCollection.add("Yellow");
- colorCollection.add("Green");
- colorCollection.add("Blue");
- colorCollection.add("Indigo");
- colorCollection.add("Violet");
- return colorCollection;
- }
-
- public void testUniqueNameForCollection1() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("Oracle Corporation");
- strings.add("Oracle2");
- strings.add("oracle1");
- strings.add("Oracl");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings));
- assertEquals("Test", NameTools.uniqueNameFor("Test", strings));
-
- assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings));
- assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings));
- assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings));
- }
-
- public void testUniqueNameForCollection2() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("oracle");
- strings.add("Oracle2");
- strings.add("Oracle1");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings));
- assertEquals("Test", NameTools.uniqueNameFor("Test", strings));
-
- strings.add("Oracle Corporation");
- assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings));
- assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings));
- assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings));
- }
-
- public void testUniqueNameForCollection3() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("Oracle");
- strings.add("Oracle2");
- strings.add("Oracle1");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings));
- }
-
- public void testUniqueNameForIterator1() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("Oracle Corporation");
- strings.add("Oracle2");
- strings.add("oracle1");
- strings.add("Oracl");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings.iterator()));
- assertEquals("Test", NameTools.uniqueNameFor("Test", strings.iterator()));
-
- assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings.iterator()));
- assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings.iterator()));
- assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings.iterator()));
- }
-
- public void testUniqueNameForIterator2() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("oracle");
- strings.add("Oracle2");
- strings.add("Oracle1");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings.iterator()));
- assertEquals("Test", NameTools.uniqueNameFor("Test", strings.iterator()));
-
- strings.add("Oracle Corporation");
- assertEquals("Oracle3", NameTools.uniqueNameForIgnoreCase("Oracle", strings.iterator()));
- assertEquals("oracle3", NameTools.uniqueNameForIgnoreCase("oracle", strings.iterator()));
- assertEquals("Test", NameTools.uniqueNameForIgnoreCase("Test", strings.iterator()));
- }
-
- public void testUniqueNameForIterator3() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("Oracle");
- strings.add("Oracle2");
- strings.add("Oracle1");
-
- assertEquals("Oracle3", NameTools.uniqueNameFor("Oracle", strings.iterator()));
- }
-
- public void testUniqueJavaNameForCollection() {
- Collection<String> strings = new ArrayList<String>();
- strings.add("Oracle");
- strings.add("Oracle");
- strings.add("Oracle2");
- strings.add("Oracle1");
-
- assertEquals("private2", NameTools.uniqueJavaNameFor("private", strings.iterator()));
- assertEquals("class2", NameTools.uniqueJavaNameFor("class", strings.iterator()));
- }
-
- public void testBuildQualifiedDatabaseObjectName() {
- assertEquals("catalog.schema.name", NameTools.buildQualifiedDatabaseObjectName("catalog", "schema", "name"));
- assertEquals("catalog..name", NameTools.buildQualifiedDatabaseObjectName("catalog", null, "name"));
- assertEquals("schema.name", NameTools.buildQualifiedDatabaseObjectName(null, "schema", "name"));
- assertEquals("name", NameTools.buildQualifiedDatabaseObjectName(null, null, "name"));
- }
-
- public void testJavaReservedWords() {
- assertTrue(CollectionTools.contains(NameTools.javaReservedWords(), "class"));
- assertFalse(CollectionTools.contains(NameTools.javaReservedWords(), "Class"));
- assertTrue(CollectionTools.contains(NameTools.javaReservedWords(), "private"));
- }
-
- public void testconvertToJavaIdentifierString() {
- assertEquals("foo", NameTools.convertToJavaIdentifier("foo"));
- assertEquals("foo1", NameTools.convertToJavaIdentifier("foo1"));
- assertEquals("Private", NameTools.convertToJavaIdentifier("private"));
- assertEquals("_foo", NameTools.convertToJavaIdentifier("1foo"));
- assertEquals("foo_", NameTools.convertToJavaIdentifier("foo%"));
- assertEquals("foo__bar__", NameTools.convertToJavaIdentifier("foo bar "));
- }
-
- public void testconvertToJavaIdentifierStringChar() {
- assertEquals("foo", NameTools.convertToJavaIdentifier("foo", '$'));
- assertEquals("foo1", NameTools.convertToJavaIdentifier("foo1", '$'));
- assertEquals("Private", NameTools.convertToJavaIdentifier("private", '$'));
- assertEquals("$foo", NameTools.convertToJavaIdentifier("1foo", '$'));
- assertEquals("foo$", NameTools.convertToJavaIdentifier("foo%", '$'));
- assertEquals("foo$$bar$$", NameTools.convertToJavaIdentifier("foo bar ", '$'));
-
- boolean exCaught = false;
- try {
- String s = NameTools.convertToJavaIdentifier("1foo", '7');
- fail("invalid string: \"" + s + "\"");
- } catch (IllegalArgumentException ex) {
- if (ex.getMessage().indexOf('7') != -1) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- String s = NameTools.convertToJavaIdentifier("foo%", '^');
- fail("invalid string: \"" + s + "\"");
- } catch (IllegalArgumentException ex) {
- if (ex.getMessage().indexOf('^') != -1) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java
deleted file mode 100644
index d7f2cce428..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.Range;
-
-public class RangeTests extends TestCase {
-
- public RangeTests(String name) {
- super(name);
- }
-
- public void testIncludes() {
- Range range = new Range(5, 17);
- assertFalse(range.includes(-55));
- assertFalse(range.includes(0));
- assertFalse(range.includes(4));
- assertTrue(range.includes(5));
- assertTrue(range.includes(6));
- assertTrue(range.includes(16));
- assertTrue(range.includes(17));
- assertFalse(range.includes(18));
- assertFalse(range.includes(200));
- }
-
- public void testEquals() {
- Range range1 = new Range(5, 17);
- Range range2 = new Range(5, 17);
- assertNotSame(range1, range2);
- assertEquals(range1, range1);
- assertEquals(range1, range2);
- assertEquals(range2, range1);
- assertEquals(range1.hashCode(), range2.hashCode());
-
- range2 = new Range(17, 5);
- assertFalse(range1.equals(range2));
- assertFalse(range2.equals(range1));
- // although they are unequal, they can have the same hash code
- assertEquals(range1.hashCode(), range2.hashCode());
-
- range2 = new Range(5, 15);
- assertFalse(range1.equals(range2));
- assertFalse(range2.equals(range1));
- }
-
- public void testClone() {
- Range range1 = new Range(5, 17);
- Range range2 = range1.clone();
- assertNotSame(range1, range2);
- assertEquals(range1, range1);
- assertEquals(range1, range2);
- assertEquals(range2, range1);
- assertEquals(range1.hashCode(), range2.hashCode());
- }
-
- public void testSerialization() throws Exception {
- Range range1 = new Range(5, 17);
- Range range2 = TestTools.serialize(range1);
- assertNotSame(range1, range2);
- assertEquals(range1, range1);
- assertEquals(range1, range2);
- assertEquals(range2, range1);
- assertEquals(range1.hashCode(), range2.hashCode());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java
deleted file mode 100644
index 7ae00fdc2e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ReverseComparator;
-
-public class ReverseComparatorTests extends TestCase {
- private Comparator<String> naturalReverseComparator;
- private Comparator<String> customComparator;
- private Comparator<String> customReverseComparator;
-
- public ReverseComparatorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.naturalReverseComparator = new ReverseComparator<String>();
- this.customComparator = this.buildCustomComparator();
- this.customReverseComparator = new ReverseComparator<String>(this.customComparator);
- }
-
- private Comparator<String> buildCustomComparator() {
- return new Comparator<String>() {
- public int compare(String s1, String s2) {
- String lower1 = s1.toLowerCase();
- String lower2 = s2.toLowerCase();
- int result = lower1.compareTo(lower2);
- if (result == 0) {
- return s1.compareTo(s2); // use case to differentiate "equal" strings
- }
- return result;
- }
- };
- }
-
- private List<String> buildUnsortedList() {
- List<String> result = new ArrayList<String>();
- result.add("T");
- result.add("Z");
- result.add("Y");
- result.add("M");
- result.add("m");
- result.add("a");
- result.add("B");
- result.add("b");
- result.add("A");
- return result;
- }
-
- private List<String> buildNaturallySortedList() {
- List<String> result = new ArrayList<String>(this.buildUnsortedList());
- Collections.sort(result);
- return result;
- }
-
- private List<String> buildCustomSortedList() {
- List<String> result = new ArrayList<String>(this.buildUnsortedList());
- Collections.sort(result, this.customComparator);
- return result;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testNatural() {
- List<String> list = this.buildUnsortedList();
- Collections.sort(list, this.naturalReverseComparator);
- this.verifyList(this.buildNaturallySortedList(), list);
- }
-
- public void testCustom() {
- List<String> list = this.buildUnsortedList();
- Collections.sort(list, this.customReverseComparator);
- this.verifyList(this.buildCustomSortedList(), list);
- }
-
- private void verifyList(List<String> normal, List<String> reverse) {
- int size = normal.size();
- int max = size - 1;
- for (int i = 0; i < size; i++) {
- assertEquals(normal.get(i), reverse.get(max - i));
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java
deleted file mode 100644
index 454cb81651..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java
+++ /dev/null
@@ -1,833 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import java.io.StringWriter;
-import java.io.Writer;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-public class StringToolsTests extends TestCase {
-
- public StringToolsTests(String name) {
- super(name);
- }
-
- // ********** padding/truncating **********
-
- public void testPad() {
- assertEquals("fred", StringTools.pad("fred", 4));
- assertEquals("fred ", StringTools.pad("fred", 6));
- boolean exThrown = false;
- try {
- assertEquals("fr", StringTools.pad("fred", 2));
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadCharArray() {
- assertEquals("fred", new String(StringTools.pad(new char[] { 'f', 'r', 'e', 'd' }, 4)));
- assertEquals("fred ", new String(StringTools.pad(new char[] { 'f', 'r', 'e', 'd' }, 6)));
- boolean exThrown = false;
- try {
- assertEquals("fr", new String(StringTools.pad(new char[] { 'f', 'r', 'e', 'd' }, 2)));
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadOnWriter() {
- Writer writer;
- writer = new StringWriter();
- StringTools.padOn("fred", 4, writer);
- assertEquals("fred", writer.toString());
-
- writer = new StringWriter();
- StringTools.padOn("fred", 6, writer);
- assertEquals("fred ", writer.toString());
-
- writer = new StringWriter();
- boolean exThrown = false;
- try {
- StringTools.padOn("fred", 2, writer);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadOnStringBuffer() {
- StringBuffer sb;
- sb = new StringBuffer();
- StringTools.padOn("fred", 4, sb);
- assertEquals("fred", sb.toString());
-
- sb = new StringBuffer();
- StringTools.padOn("fred", 6, sb);
- assertEquals("fred ", sb.toString());
-
- sb = new StringBuffer();
- boolean exThrown = false;
- try {
- StringTools.padOn("fred", 2, sb);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testPadOrTruncate() {
- assertEquals("fred", StringTools.padOrTruncate("fred", 4));
- assertEquals("fred ", StringTools.padOrTruncate("fred", 6));
- assertEquals("fr", StringTools.padOrTruncate("fred", 2));
- }
-
- public void testPadOrTruncateCharArray() {
- assertEquals("fred", new String(StringTools.padOrTruncate(new char[] { 'f', 'r', 'e', 'd' }, 4)));
- assertEquals("fred ", new String(StringTools.padOrTruncate(new char[] { 'f', 'r', 'e', 'd' }, 6)));
- assertEquals("fr", new String(StringTools.padOrTruncate(new char[] { 'f', 'r', 'e', 'd' }, 2)));
- }
-
- public void testPadOrTruncateOnWriter() {
- this.verifyPadOrTruncateOnWriter("fred", "fred", 4);
- this.verifyPadOrTruncateOnWriter("fred ", "fred", 6);
- this.verifyPadOrTruncateOnWriter("fr", "fred", 2);
- }
-
- private void verifyPadOrTruncateOnWriter(String expected, String string, int length) {
- Writer writer = new StringWriter();
- StringTools.padOrTruncateOn(string, length, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testPadOrTruncateOnStringBuffer() {
- this.verifyPadOrTruncateOnStringBuffer("fred", "fred", 4);
- this.verifyPadOrTruncateOnStringBuffer("fred ", "fred", 6);
- this.verifyPadOrTruncateOnStringBuffer("fr", "fred", 2);
- }
-
- private void verifyPadOrTruncateOnStringBuffer(String expected, String string, int length) {
- StringBuffer sb = new StringBuffer();
- StringTools.padOrTruncateOn(string, length, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testZeroPad() {
- assertEquals("1234", StringTools.zeroPad("1234", 4));
- assertEquals("001234", StringTools.zeroPad("1234", 6));
- boolean exThrown = false;
- try {
- assertEquals("12", StringTools.zeroPad("1234", 2));
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadCharArray() {
- assertEquals("1234", new String(StringTools.zeroPad(new char[] { '1', '2', '3', '4' }, 4)));
- assertEquals("001234", new String(StringTools.zeroPad(new char[] { '1', '2', '3', '4' }, 6)));
- boolean exThrown = false;
- try {
- assertEquals("12", new String(StringTools.zeroPad(new char[] { '1', '2', '3', '4' }, 2)));
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadOnWriter() {
- Writer writer;
- writer = new StringWriter();
- StringTools.zeroPadOn("1234", 4, writer);
- assertEquals("1234", writer.toString());
-
- writer = new StringWriter();
- StringTools.zeroPadOn("1234", 6, writer);
- assertEquals("001234", writer.toString());
-
- writer = new StringWriter();
- boolean exThrown = false;
- try {
- StringTools.zeroPadOn("1234", 2, writer);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadOnStringBuffer() {
- StringBuffer sb;
- sb = new StringBuffer();
- StringTools.zeroPadOn("1234", 4, sb);
- assertEquals("1234", sb.toString());
-
- sb = new StringBuffer();
- StringTools.zeroPadOn("1234", 6, sb);
- assertEquals("001234", sb.toString());
-
- sb = new StringBuffer();
- boolean exThrown = false;
- try {
- StringTools.zeroPadOn("1234", 2, sb);
- fail();
- } catch (IllegalArgumentException ex) {
- exThrown = true;
- }
- assertTrue(exThrown);
- }
-
- public void testZeroPadOrTruncate() {
- assertEquals("1234", StringTools.zeroPadOrTruncate("1234", 4));
- assertEquals("001234", StringTools.zeroPadOrTruncate("1234", 6));
- assertEquals("34", StringTools.zeroPadOrTruncate("1234", 2));
- }
-
- public void testZeroPadOrTruncateCharArray() {
- assertEquals("1234", new String(StringTools.zeroPadOrTruncate(new char[] { '1', '2', '3', '4' }, 4)));
- assertEquals("001234", new String(StringTools.zeroPadOrTruncate(new char[] { '1', '2', '3', '4' }, 6)));
- assertEquals("34", new String(StringTools.zeroPadOrTruncate(new char[] { '1', '2', '3', '4' }, 2)));
- }
-
- public void testZeroPadOrTruncateOnWriter() {
- this.verifyZeroPadOrTruncateOnWriter("1234", "1234", 4);
- this.verifyZeroPadOrTruncateOnWriter("001234", "1234", 6);
- this.verifyZeroPadOrTruncateOnWriter("34", "1234", 2);
- }
-
- private void verifyZeroPadOrTruncateOnWriter(String expected, String string, int length) {
- Writer writer = new StringWriter();
- StringTools.zeroPadOrTruncateOn(string, length, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testZeroPadOrTruncateOnStringBuffer() {
- this.verifyZeroPadOrTruncateOnStringBuffer("1234", "1234", 4);
- this.verifyZeroPadOrTruncateOnStringBuffer("001234", "1234", 6);
- this.verifyZeroPadOrTruncateOnStringBuffer("34", "1234", 2);
- }
-
- private void verifyZeroPadOrTruncateOnStringBuffer(String expected, String string, int length) {
- StringBuffer sb = new StringBuffer();
- StringTools.zeroPadOrTruncateOn(string, length, sb);
- assertEquals(expected, sb.toString());
- }
-
- // ********** wrapping **********
-
- public void testWrap() {
- this.verifyWrap("Employee", "123", "123Employee123");
- this.verifyWrap("123", "123", "123123123");
- this.verifyWrap("", "123", "123123");
- }
-
- private void verifyWrap(String string, String wrap, String expectedString) {
- assertEquals(expectedString, StringTools.wrap(string, wrap));
- }
-
- public void testWrapOnWriter() {
- this.verifyWrapOnWriter("Employee", "123", "123Employee123");
- this.verifyWrapOnWriter("123", "123", "123123123");
- this.verifyWrapOnWriter("", "123", "123123");
- }
-
- private void verifyWrapOnWriter(String string, String wrap, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.wrapOn(string, wrap, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testWrapOnStringBuffer() {
- this.verifyWrapOnStringBuffer("Employee", "123", "123Employee123");
- this.verifyWrapOnStringBuffer("123", "123", "123123123");
- this.verifyWrapOnStringBuffer("", "123", "123123");
- }
-
- private void verifyWrapOnStringBuffer(String string, String wrap, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.wrapOn(string, wrap, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testQuote() {
- this.verifyQuote("Employee", "\"Employee\"");
- this.verifyQuote("123", "\"123\"");
- this.verifyQuote("", "\"\"");
- }
-
- private void verifyQuote(String string, String expectedString) {
- assertEquals(expectedString, StringTools.quote(string));
- }
-
- public void testQuoteOnWriter() {
- this.verifyQuoteOnWriter("Employee", "\"Employee\"");
- this.verifyQuoteOnWriter("123", "\"123\"");
- this.verifyQuoteOnWriter("", "\"\"");
- }
-
- private void verifyQuoteOnWriter(String string, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.quoteOn(string, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testQuoteOnStringBuffer() {
- this.verifyQuoteOnStringBuffer("Employee", "\"Employee\"");
- this.verifyQuoteOnStringBuffer("123", "\"123\"");
- this.verifyQuoteOnStringBuffer("", "\"\"");
- }
-
- private void verifyQuoteOnStringBuffer(String string, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.quoteOn(string, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- // ********** removing characters **********
-
- public void testRemoveFirstOccurrence() {
- this.verifyRemoveFirstOccurrence("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrence("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrence("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrence("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrence("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrence(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, StringTools.removeFirstOccurrence(string, charToRemove));
- }
-
- public void testRemoveFirstOccurrenceCharArray() {
- this.verifyRemoveFirstOccurrenceCharArray("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrenceCharArray("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrenceCharArray("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrenceCharArray("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrenceCharArray("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrenceCharArray(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, new String(StringTools.removeFirstOccurrence(string.toCharArray(), charToRemove)));
- }
-
- public void testRemoveFirstOccurrenceOnWriter() {
- this.verifyRemoveFirstOccurrenceOnWriter("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnWriter("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrenceOnWriter("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrenceOnWriter("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnWriter("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrenceOnWriter(String string, char charToRemove, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.removeFirstOccurrenceOn(string, charToRemove, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testRemoveFirstOccurrenceOnStringBuffer() {
- this.verifyRemoveFirstOccurrenceOnStringBuffer("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnStringBuffer("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrenceOnStringBuffer("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrenceOnStringBuffer("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnStringBuffer("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrenceOnStringBuffer(String string, char charToRemove, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.removeFirstOccurrenceOn(string, charToRemove, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testRemoveAllOccurrences() {
- this.verifyRemoveAllOccurrences("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrences(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrences("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrences(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrences(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, StringTools.removeAllOccurrences(string, charToRemove));
- }
-
- public void testRemoveAllOccurrencesCharArray() {
- this.verifyRemoveAllOccurrencesCharArray("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrencesCharArray(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrencesCharArray("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrencesCharArray(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrencesCharArray(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, new String(StringTools.removeAllOccurrences(string.toCharArray(), charToRemove)));
- }
-
- public void testRemoveAllOccurrencesOnWriter() {
- this.verifyRemoveAllOccurrencesOnWriter("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrencesOnWriter(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrencesOnWriter("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrencesOnWriter(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrencesOnWriter(String string, char charToRemove, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.removeAllOccurrencesOn(string, charToRemove, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testRemoveAllOccurrencesOnStringBuffer() {
- this.verifyRemoveAllOccurrencesOnStringBuffer("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrencesOnStringBuffer(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrencesOnStringBuffer("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrencesOnStringBuffer(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrencesOnStringBuffer(String string, char charToRemove, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.removeAllOccurrencesOn(string, charToRemove, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- // ********** common prefix **********
-
- public void testCommonPrefixLength() {
- assertEquals(3, StringTools.commonPrefixLength("fooZZZ", "fooBBB"));
- assertEquals(3, StringTools.commonPrefixLength("foo", "fooBBB"));
- assertEquals(3, StringTools.commonPrefixLength("fooZZZ", "foo"));
- assertEquals(3, StringTools.commonPrefixLength("foo", "foo"));
- }
-
- public void testCommonPrefixLengthMax() {
- assertEquals(2, StringTools.commonPrefixLength("fooZZZ", "fooBBB", 2));
- assertEquals(2, StringTools.commonPrefixLength("foo", "fooBBB", 2));
- assertEquals(2, StringTools.commonPrefixLength("fooZZZ", "foo", 2));
- assertEquals(2, StringTools.commonPrefixLength("foo", "foo", 2));
- }
-
- // ********** capitalization **********
-
- public void testCapitalizeCharArray() {
- this.verifyCapitalizeCharArray("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeCharArray("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeCharArray(" ", new char[] { ' ', ' ', ' ' });
- this.verifyCapitalizeCharArray("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyCapitalizeCharArray("", new char[0]);
- this.verifyCapitalizeCharArray("A", new char[] { 'a' });
- this.verifyCapitalizeCharArray("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyCapitalizeCharArray(String expected, char[] string) {
- assertEquals(expected, new String(StringTools.capitalize(string)));
- }
-
- public void testCapitalizeString() {
- this.verifyCapitalizeString("Oracle", "Oracle");
- this.verifyCapitalizeString("Oracle", "oracle");
- this.verifyCapitalizeString(" ", " ");
- this.verifyCapitalizeString("ORACLE", "ORACLE");
- this.verifyCapitalizeString("", "");
- this.verifyCapitalizeString("A", "a");
- this.verifyCapitalizeString("\u00C9cole", "\u00E9cole"); // �cole->�COLE
- }
-
- private void verifyCapitalizeString(String expected, String string) {
- assertEquals(expected, StringTools.capitalize(string));
- }
-
- public void testCapitalizeOnCharArrayStringBuffer() {
- this.verifyCapitalizeOnCharArrayStringBuffer("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayStringBuffer("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayStringBuffer(" ", new char[] { ' ', ' ', ' ' });
- this.verifyCapitalizeOnCharArrayStringBuffer("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyCapitalizeOnCharArrayStringBuffer("", new char[0]);
- this.verifyCapitalizeOnCharArrayStringBuffer("A", new char[] { 'a' });
- this.verifyCapitalizeOnCharArrayStringBuffer("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyCapitalizeOnCharArrayStringBuffer(String expected, char[] string) {
- StringBuffer sb = new StringBuffer();
- StringTools.capitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testCapitalizeOnStringStringBuffer() {
- this.verifyCapitalizeOnStringStringBuffer("Oracle", "Oracle");
- this.verifyCapitalizeOnStringStringBuffer("Oracle", "oracle");
- this.verifyCapitalizeOnStringStringBuffer(" ", " ");
- this.verifyCapitalizeOnStringStringBuffer("ORACLE", "ORACLE");
- this.verifyCapitalizeOnStringStringBuffer("", "");
- this.verifyCapitalizeOnStringStringBuffer("A", "a");
- this.verifyCapitalizeOnStringStringBuffer("\u00C9cole", "\u00E9cole"); // �cole->�COLE
- }
-
- private void verifyCapitalizeOnStringStringBuffer(String expected, String string) {
- StringBuffer sb = new StringBuffer();
- StringTools.capitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testCapitalizeOnCharArrayWriter() {
- this.verifyCapitalizeOnCharArrayWriter("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayWriter("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayWriter(" ", new char[] { ' ', ' ', ' ' });
- this.verifyCapitalizeOnCharArrayWriter("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyCapitalizeOnCharArrayWriter("", new char[0]);
- this.verifyCapitalizeOnCharArrayWriter("A", new char[] { 'a' });
- this.verifyCapitalizeOnCharArrayWriter("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyCapitalizeOnCharArrayWriter(String expected, char[] string) {
- Writer writer = new StringWriter();
- StringTools.capitalizeOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testCapitalizeOnStringWriter() {
- this.verifyCapitalizeOnStringWriter("Oracle", "Oracle");
- this.verifyCapitalizeOnStringWriter("Oracle", "oracle");
- this.verifyCapitalizeOnStringWriter(" ", " ");
- this.verifyCapitalizeOnStringWriter("ORACLE", "ORACLE");
- this.verifyCapitalizeOnStringWriter("", "");
- this.verifyCapitalizeOnStringWriter("A", "a");
- this.verifyCapitalizeOnStringWriter("\u00C9cole", "\u00E9cole"); // �cole->�COLE
- }
-
- private void verifyCapitalizeOnStringWriter(String expected, String string) {
- Writer writer = new StringWriter();
- StringTools.capitalizeOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testUnapitalizeCharArray() {
- this.verifyUncapitalizeCharArray("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeCharArray("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeCharArray(" ", new char[] { ' ', ' ', ' ' });
- this.verifyUncapitalizeCharArray("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyUncapitalizeCharArray("", new char[0]);
- this.verifyUncapitalizeCharArray("a", new char[] { 'A' });
- this.verifyUncapitalizeCharArray("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyUncapitalizeCharArray(String expected, char[] string) {
- assertEquals(expected, new String(StringTools.uncapitalize(string)));
- }
-
- public void testUncapitalizeString() {
- this.verifyUncapitalizeString("oracle", "Oracle");
- this.verifyUncapitalizeString("oracle", "oracle");
- this.verifyUncapitalizeString(" ", " ");
- this.verifyUncapitalizeString("ORACLE", "ORACLE");
- this.verifyUncapitalizeString("", "");
- this.verifyUncapitalizeString("a", "A");
- this.verifyUncapitalizeString("\u00E9cole", "\u00C9cole"); // �cole->�COLE
- }
-
- private void verifyUncapitalizeString(String expected, String string) {
- assertEquals(expected, StringTools.uncapitalize(string));
- }
-
- public void testUncapitalizeOnCharArrayStringBuffer() {
- this.verifyUncapitalizeOnCharArrayStringBuffer("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayStringBuffer("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayStringBuffer(" ", new char[] { ' ', ' ', ' ' });
- this.verifyUncapitalizeOnCharArrayStringBuffer("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyUncapitalizeOnCharArrayStringBuffer("", new char[0]);
- this.verifyUncapitalizeOnCharArrayStringBuffer("a", new char[] { 'A' });
- this.verifyUncapitalizeOnCharArrayStringBuffer("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyUncapitalizeOnCharArrayStringBuffer(String expected, char[] string) {
- StringBuffer sb = new StringBuffer();
- StringTools.uncapitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUncapitalizeOnStringStringBuffer() {
- this.verifyUncapitalizeOnStringStringBuffer("oracle", "Oracle");
- this.verifyUncapitalizeOnStringStringBuffer("oracle", "oracle");
- this.verifyUncapitalizeOnStringStringBuffer(" ", " ");
- this.verifyUncapitalizeOnStringStringBuffer("ORACLE", "ORACLE");
- this.verifyUncapitalizeOnStringStringBuffer("", "");
- this.verifyUncapitalizeOnStringStringBuffer("a", "A");
- this.verifyUncapitalizeOnStringStringBuffer("\u00E9cole", "\u00C9cole"); // �cole->�COLE
- }
-
- private void verifyUncapitalizeOnStringStringBuffer(String expected, String string) {
- StringBuffer sb = new StringBuffer();
- StringTools.uncapitalizeOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testUncapitalizeOnCharArrayWriter() {
- this.verifyUncapitalizeOnCharArrayWriter("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayWriter("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayWriter(" ", new char[] { ' ', ' ', ' ' });
- this.verifyUncapitalizeOnCharArrayWriter("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyUncapitalizeOnCharArrayWriter("", new char[0]);
- this.verifyUncapitalizeOnCharArrayWriter("a", new char[] { 'A' });
- this.verifyUncapitalizeOnCharArrayWriter("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyUncapitalizeOnCharArrayWriter(String expected, char[] string) {
- Writer writer = new StringWriter();
- StringTools.uncapitalizeOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testUncapitalizeOnStringWriter() {
- this.verifyUncapitalizeOnStringWriter("oracle", "Oracle");
- this.verifyUncapitalizeOnStringWriter("oracle", "oracle");
- this.verifyUncapitalizeOnStringWriter(" ", " ");
- this.verifyUncapitalizeOnStringWriter("ORACLE", "ORACLE");
- this.verifyUncapitalizeOnStringWriter("", "");
- this.verifyUncapitalizeOnStringWriter("a", "A");
- this.verifyUncapitalizeOnStringWriter("\u00E9cole", "\u00C9cole"); // �cole->�COLE
- }
-
- private void verifyUncapitalizeOnStringWriter(String expected, String string) {
- Writer writer = new StringWriter();
- StringTools.uncapitalizeOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- // ********** queries **********
-
- public void testStringIsEmptyString() {
- assertTrue(StringTools.stringIsEmpty((String) null));
- assertTrue(StringTools.stringIsEmpty(""));
- assertTrue(StringTools.stringIsEmpty(" "));
- assertTrue(StringTools.stringIsEmpty(" \t\t "));
- assertTrue(StringTools.stringIsEmpty(" \t\t " + StringTools.CR));
- }
-
- public void testStringIsEmptyCharArray() {
- assertTrue(StringTools.stringIsEmpty((char[]) null));
- this.verifyStringIsEmptyCharArray("");
- this.verifyStringIsEmptyCharArray(" \t\t ");
- this.verifyStringIsEmptyCharArray(" ");
- this.verifyStringIsEmptyCharArray(" \t\t " + StringTools.CR);
- }
-
- private void verifyStringIsEmptyCharArray(String string) {
- assertTrue(StringTools.stringIsEmpty(string.toCharArray()));
- }
-
- public void testStringsAreEqualIgnoreCaseStringString() {
- assertTrue(StringTools.stringsAreEqualIgnoreCase((String) null, (String) null));
- assertFalse(StringTools.stringsAreEqualIgnoreCase(null, "asdf"));
- assertFalse(StringTools.stringsAreEqualIgnoreCase("asdf", null));
- assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf", "asdf"));
- assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf", "ASDF"));
- }
-
- public void testStringsAreEqualIgnoreCaseCharArrayCharArray() {
- assertTrue(StringTools.stringsAreEqualIgnoreCase((char[]) null, (char[]) null));
- assertFalse(StringTools.stringsAreEqualIgnoreCase((char[]) null, "asdf".toCharArray()));
- assertFalse(StringTools.stringsAreEqualIgnoreCase("asdf".toCharArray(), (char[]) null));
- assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf".toCharArray(), "asdf".toCharArray()));
- assertTrue(StringTools.stringsAreEqualIgnoreCase("asdf".toCharArray(), "ASDF".toCharArray()));
- }
-
- public void testStringStartsWithIgnoreCaseStringString() {
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", "as"));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", "aS"));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", ""));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf", "A"));
-
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "bsdf"));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "g"));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "asdg"));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "asdfg"));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf", "asdfgggggg"));
- }
-
- public void testStringStartsWithIgnoreCaseCharArrayCharArray() {
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "as".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "aS".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "A".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "ASDF".toCharArray()));
- assertTrue(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdf".toCharArray()));
-
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "bsdf".toCharArray()));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "g".toCharArray()));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdg".toCharArray()));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdfg".toCharArray()));
- assertFalse(StringTools.stringStartsWithIgnoreCase("asdf".toCharArray(), "asdfgggggg".toCharArray()));
- }
-
- public void testCharactersAreEqualIgnoreCase() {
- assertTrue(StringTools.charactersAreEqualIgnoreCase('a', 'a'));
- assertTrue(StringTools.charactersAreEqualIgnoreCase('a', 'A'));
- assertTrue(StringTools.charactersAreEqualIgnoreCase('A', 'a'));
- assertTrue(StringTools.charactersAreEqualIgnoreCase('A', 'A'));
-
- assertFalse(StringTools.charactersAreEqualIgnoreCase('a', 'b'));
- assertFalse(StringTools.charactersAreEqualIgnoreCase('A', 'b'));
- }
-
- // ********** conversions **********
-
- public void testConvertCamelCaseToAllCaps() {
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("test"));
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("TEST"));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("testTest"));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTest"));
- assertEquals("TEST_TEST_TEST", StringTools.convertCamelCaseToAllCaps("testTESTTest"));
- assertEquals("TEST_TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTESTTest"));
- assertEquals("TEST_TEST_TEST_T", StringTools.convertCamelCaseToAllCaps("TestTESTTestT"));
- }
-
- public void testConvertCamelCaseToAllCapsOnWriter() {
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST", "test");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST", "TEST");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST", "testTest");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST", "TestTest");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST_TEST", "testTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST_TEST", "TestTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnWriter("TEST_TEST_TEST_T", "TestTESTTestT");
- }
-
- private void verifyConvertCamelCaseToAllCapsOnWriter(String expected, String string) {
- Writer writer = new StringWriter();
- StringTools.convertCamelCaseToAllCapsOn(string, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testConvertCamelCaseToAllCapsMaxLength() {
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("test", 44));
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("test", 4));
- assertEquals("TES", StringTools.convertCamelCaseToAllCaps("test", 3));
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("TEST", 5));
- assertEquals("TE", StringTools.convertCamelCaseToAllCaps("TEST", 2));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("testTest", 9));
- assertEquals("TEST_TES", StringTools.convertCamelCaseToAllCaps("testTest", 8));
- assertEquals("TEST_T", StringTools.convertCamelCaseToAllCaps("testTest", 6));
- assertEquals("TEST_", StringTools.convertCamelCaseToAllCaps("testTest", 5));
- assertEquals("TEST", StringTools.convertCamelCaseToAllCaps("testTest", 4));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTest", 9));
- assertEquals("TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTest", 1100));
- assertEquals("TEST_TEST_", StringTools.convertCamelCaseToAllCaps("testTESTTest", 10));
- assertEquals("TEST_TEST_TEST", StringTools.convertCamelCaseToAllCaps("TestTESTTest", 14));
- assertEquals("TEST_TEST_TEST_T", StringTools.convertCamelCaseToAllCaps("TestTESTTestT", 16));
- assertEquals("TEST_TEST_TEST_", StringTools.convertCamelCaseToAllCaps("TestTESTTestT", 15));
- }
-
- public void testConvertCamelCaseToAllCapsMaxLengthOnWriter() {
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "test", 44);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "test", 4);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TES", "test", 3);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "TEST", 5);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TE", "TEST", 2);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST", "testTest", 9);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TES", "testTest", 8);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_T", "testTest", 6);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_", "testTest", 5);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST", "testTest", 4);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST", "TestTest", 9);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST", "TestTest", 1100);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_", "testTESTTest", 10);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_TEST", "TestTESTTest", 14);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_TEST_T", "TestTESTTestT", 16);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnWriter("TEST_TEST_TEST_", "TestTESTTestT", 15);
- }
-
- private void verifyConvertCamelCaseToAllCapsMaxLengthOnWriter(String expected, String string, int max) {
- Writer writer = new StringWriter();
- StringTools.convertCamelCaseToAllCapsOn(string, max, writer);
- assertEquals(expected, writer.toString());
- }
-
- public void testConvertUnderscoresToCamelCase() {
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("TEST", false));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("TEST_", false));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("TEST____", false));
- assertEquals("Test", StringTools.convertUnderscoresToCamelCase("TEST", true));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("TeST", false));
- assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST", false));
- assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("TEST___TEST", false));
- assertEquals("TestTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST", true));
- assertEquals("testTestTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST", false));
- assertEquals("TestTestTest", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST", true));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST_T", false));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("_TEST_TEST_TEST_T", false));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("__TEST_TEST_TEST_T", false));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("TEST_TEST_TEST_T", true));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("_TEST_TEST_TEST_T", true));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("__TEST_TEST_TEST_T", true));
- }
-
- public void testConvertUnderscoresToCamelCaseLowercase() {
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("test", false));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("test_", false));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("test____", false));
- assertEquals("Test", StringTools.convertUnderscoresToCamelCase("test", true));
- assertEquals("test", StringTools.convertUnderscoresToCamelCase("test", false));
- assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("test_test", false));
- assertEquals("testTest", StringTools.convertUnderscoresToCamelCase("test___test", false));
- assertEquals("TestTest", StringTools.convertUnderscoresToCamelCase("test_test", true));
- assertEquals("testTestTest", StringTools.convertUnderscoresToCamelCase("test_test_test", false));
- assertEquals("TestTestTest", StringTools.convertUnderscoresToCamelCase("test_test_test", true));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("test_test_test_t", false));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("_test_test_test_t", false));
- assertEquals("testTestTestT", StringTools.convertUnderscoresToCamelCase("__test_test_test_t", false));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("test_test_test_t", true));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("_test_test_test_t", true));
- assertEquals("TestTestTestT", StringTools.convertUnderscoresToCamelCase("__test_test_test_t", true));
- }
-
- public void testConvertUnderscoresToCamelCaseOnWriter() {
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TEST_", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TEST____", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("Test", "TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "TeST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "TEST_TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "TEST___TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTest", "TEST_TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTest", "TEST_TEST_TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTest", "TEST_TEST_TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "_TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "__TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "TEST_TEST_TEST_T", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "_TEST_TEST_TEST_T", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "__TEST_TEST_TEST_T", true);
- }
-
- public void testConvertUnderscoresToCamelCaseOnWriterLowercase() {
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test_", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test____", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("Test", "test", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("test", "test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "test_test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTest", "test___test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTest", "test_test", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTest", "test_test_test", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTest", "test_test_test", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "_test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("testTestTestT", "__test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "test_test_test_t", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "_test_test_test_t", true);
- this.verifyConvertUnderscoresToCamelCaseOnWriter("TestTestTestT", "__test_test_test_t", true);
- }
-
- private void verifyConvertUnderscoresToCamelCaseOnWriter(String expected, String string, boolean capitalizeFirstLetter) {
- Writer writer = new StringWriter();
- StringTools.convertUnderscoresToCamelCaseOn(string, capitalizeFirstLetter, writer);
- assertEquals(expected, writer.toString());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java
deleted file mode 100644
index 04a3d84786..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import junit.framework.TestCase;
-import junit.framework.TestFailure;
-import junit.framework.TestResult;
-
-/**
- * various tools that can be used by test cases
- */
-public final class TestTools {
-
- /**
- * test an object's implementation of Serializable by serializing the
- * specified object to a byte array; then de-serializing the byte array and
- * returning the resultant object
- */
- public static <T> T serialize(T o) throws IOException, ClassNotFoundException {
- ByteArrayOutputStream baOutStream = new ByteArrayOutputStream(2000);
- ObjectOutputStream outStream = new ObjectOutputStream(baOutStream);
- outStream.writeObject(o);
- outStream.close();
-
- ByteArrayInputStream baInStream = new ByteArrayInputStream(baOutStream.toByteArray());
- ObjectInputStream inStream = new ObjectInputStream(baInStream);
- T o2 = readObject(inStream);
- inStream.close();
-
- return o2;
- }
-
- @SuppressWarnings("unchecked")
- private static <T> T readObject(ObjectInput objectInput) throws IOException, ClassNotFoundException {
- return (T) objectInput.readObject();
- }
-
- /**
- * some tests require access to the Web (e.g. any tests that parse an XML
- * document that specifies a DTD or Schema that is loaded from the Web); use
- * this method to configure the JDK proxy settings
- */
- public static void setUpOracleProxy() {
- System.setProperty("http.proxyHost", "www-proxy.us.oracle.com");
- System.setProperty("http.proxyPort", "80");
- }
-
- /**
- * some tests require access to the Web (e.g. any tests that parse an XML
- * document that specifies a DTD or Schema that is loaded from the Web); use
- * this method to configure the JDK proxy settings via the command-line
- */
- public static String[] buildOracleProxyCommandLineOptions() {
- return new String[] { "-Dhttp.proxyHost=www-proxy.us.oracle.com", "-Dhttp.proxyPort=80" };
- }
-
- /**
- * redirect std out and std err to the specified stream
- */
- public static void redirectSystemStreamsTo(OutputStream outputStream) {
- redirectSystemStreamsTo(new PrintStream(outputStream));
- }
-
- /**
- * redirect std out and std err to the specified stream
- */
- public static void redirectSystemStreamsTo(PrintStream printStream) {
- System.setOut(printStream);
- System.setErr(printStream);
- }
-
- /**
- * execute the specified test and dump the results to the console
- */
- public static String execute(TestCase testCase) {
- long start = System.currentTimeMillis();
- TestResult result = testCase.run();
- long end = System.currentTimeMillis();
-
- StringWriter stringWriter = new StringWriter();
- PrintWriter writer = new PrintWriter(stringWriter);
- writer.print(testCase.getName());
- writer.print(": ");
- if (result.wasSuccessful()) {
- writer.println("OK");
- } else {
- TestFailure failure = null;
- if (result.failures().hasMoreElements()) {
- failure = (TestFailure) result.failures().nextElement();
- } else {
- failure = (TestFailure) result.errors().nextElement();
- }
- failure.thrownException().printStackTrace(writer);
- }
- writer.print("elapsed time: ");
- long elapsed = end - start;
- writer.print(elapsed / 1000L);
- writer.println(" sec.");
- return stringWriter.toString();
- }
-
- private static final Class<TestCase> TestCase_class = TestCase.class;
-
- /**
- * Clear out all the instance variable of the specified test case, allowing
- * the various test fixtures to be garbage-collected. Typically this is
- * called in the #tearDown() method.
- */
- public static void clear(TestCase testCase) throws IllegalAccessException {
- for (Class<?> tempClass = testCase.getClass(); tempClass != TestCase_class; tempClass = tempClass.getSuperclass()) {
- Field[] fields = tempClass.getDeclaredFields();
- for (int i = fields.length; i-- > 0;) {
- Field field = fields[i];
- // leave primitives alone - they don't get garbage-collected, and we can't set them to null...
- if (field.getType().isPrimitive()) {
- continue;
- }
- // leave static fields alone (?)
- if (Modifier.isStatic(field.getModifiers())) {
- continue;
- }
- field.setAccessible(true);
- field.set(testCase, null);
- }
- }
- }
-
- /**
- * Workaround for a JUnit bug: JUnit does not configure the testing Thread
- * with a context class loader. This should probably happen in
- * TestRunner.doRunTest(Test), just before starting the thread.
- */
- public static void setUpJUnitThreadContextClassLoader() {
- Thread.currentThread().setContextClassLoader(TestTools.class.getClassLoader());
- }
-
- private TestTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java
deleted file mode 100644
index 3b104b9b89..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.FileTools;
-import org.eclipse.jpt.utility.internal.XMLStringEncoder;
-
-public class XMLStringEncoderTests extends TestCase {
-
- public XMLStringEncoderTests(String name) {
- super(name);
- }
-
- public void testEncodeNoCharacterSequences() {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
-
- String s = "foo";
- assertEquals(s, encoder.encode(s));
-
- s = "123foo123";
- assertEquals(s, encoder.encode(s));
- }
-
- public void testEncodeCharacterSequences() {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
-
- String s = "?foo?";
- String expected = "&#x3f;foo&#x3f;";
- assertEquals(expected, encoder.encode(s));
-
- s = "?foo&123";
- expected = "&#x3f;foo&#x26;123";
- assertEquals(expected, encoder.encode(s));
- }
-
- public void testDenormalizeValidFileName() {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
-
- String s = "foo";
- assertEquals(s, encoder.decode(s));
-
- s = "123foo123";
- assertEquals(s, encoder.decode(s));
- }
-
- public void testDenormalizeInvalidFileName() {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
-
- String s = "&#x3f;foo&#x3f;";
- String expected = "?foo?";
- assertEquals(expected, encoder.decode(s));
-
- s = "&#x3f;foo&#x26;123";
- expected = "?foo&123";
- assertEquals(expected, encoder.decode(s));
- }
-
- public void testRoundTripNoCharacterSequences() {
- this.verifyRoundTrip("foo");
- this.verifyRoundTrip("123foo456");
- }
-
- public void testRoundTripCharacterSequences() {
- this.verifyRoundTrip("?foo?");
- this.verifyRoundTrip("?foo&123&&&&&&>>>>");
- }
-
- private void verifyRoundTrip(String s) {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
- String actual = encoder.encode(s);
- assertEquals(s, encoder.decode(actual));
- }
-
- public void testInvalidCharacterSequence1() {
- this.verifyIllegalStateException("foo&");
- }
-
- public void testInvalidCharacterSequence2() {
- this.verifyIllegalStateException("foo&#");
- }
-
- public void testInvalidCharacterSequence3() {
- this.verifyIllegalStateException("foo&#x");
- }
-
- public void testInvalidCharacterSequence4() {
- this.verifyIllegalStateException("foo&#x3");
- }
-
- public void testInvalidCharacterSequence5() {
- this.verifyIllegalStateException("foo&#x;");
- }
-
- public void testInvalidCharacterSequence6() {
- this.verifyIllegalStateException("foo&A");
- }
-
- public void testInvalidCharacterSequence7() {
- this.verifyIllegalStateException("foo&#A");
- }
-
- private void verifyIllegalStateException(String s) {
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
- boolean exCaught = false;
- try {
- s = encoder.decode(s);
- fail(s);
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testInvalidCharacterSequence8() {
- String s = "foo&#xZZZZ;";
- XMLStringEncoder encoder = new XMLStringEncoder(FileTools.INVALID_FILENAME_CHARACTERS);
- boolean exCaught = false;
- try {
- s = encoder.decode(s);
- fail(s);
- } catch (NumberFormatException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java
deleted file mode 100644
index d7cf76ad44..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-public class ArrayIteratorTests extends TestCase {
-
- public ArrayIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildArray().length, i);
- }
-
- public void testNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- assertEquals("bogus element", ++i, Integer.parseInt(stream.next()));
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- if (stream.next().equals("3")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testIllegalArgumentException() {
- this.triggerIllegalArgumentException(-1, 1);
- this.triggerIllegalArgumentException(8, 1);
- this.triggerIllegalArgumentException(0, -1);
- this.triggerIllegalArgumentException(0, 9);
- }
-
- public void testGenerics() {
- Integer[] integers = new Integer[3];
- integers[0] = 0;
- integers[1] = 1;
- integers[2] = 2;
- int i = 0;
- for (Iterator<Number> stream = new ArrayIterator<Number>(integers); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(integers.length, i);
- }
-
- public void testVarargs() {
- int i = 0;
- for (Iterator<Number> stream = new ArrayIterator<Number>(0, 1, 2); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(3, i);
- }
-
- public void triggerIllegalArgumentException(int start, int length) {
- boolean exCaught = false;
- Iterator<String> stream = null;
- try {
- stream = this.buildIterator(start, length);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown: " + stream, exCaught);
- }
-
- Iterator<String> buildIterator() {
- return this.buildIterator(this.buildArray());
- }
-
- Iterator<String> buildIterator(String[] array) {
- return new ArrayIterator<String>(array);
- }
-
- Iterator<String> buildIterator(int start, int length) {
- return this.buildIterator(this.buildArray(), start, length);
- }
-
- Iterator<String> buildIterator(String[] array, int start, int length) {
- return new ArrayIterator<String>(array, start, length);
- }
-
- String[] buildArray() {
- return new String[] { "1", "2", "3", "4", "5", "6", "7", "8" };
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java
deleted file mode 100644
index 9d82950b94..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.iterators.ArrayListIterator;
-
-public class ArrayListIteratorTests extends ArrayIteratorTests {
-
- public ArrayListIteratorTests(String name) {
- super(name);
- }
-
- public void testHasPrevious() {
- ListIterator<String> stream = this.buildListIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- int i = 0;
- while (stream.hasPrevious()) {
- stream.previous();
- i++;
- }
- assertEquals(this.buildArray().length, i);
- }
-
- public void testPrevious() {
- ListIterator<String> stream = this.buildListIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- int i = this.buildArray().length;
- while (stream.hasPrevious()) {
- assertEquals("bogus element", i--, Integer.parseInt(stream.previous()));
- }
- }
-
- public void testNextIndex() {
- int i = 0;
- ListIterator<String> stream = this.buildListIterator();
- while (stream.hasNext()) {
- assertEquals(i, stream.nextIndex());
- stream.next();
- i++;
- }
- assertEquals(i, stream.nextIndex());
- }
-
- public void testPreviousIndex() {
- int i = 0;
- ListIterator<String> stream = this.buildListIterator();
- while (stream.hasNext()) {
- assertEquals(i - 1, stream.previousIndex());
- stream.next();
- i++;
- }
- assertEquals(i - 1, stream.previousIndex());
- }
-
- @Override
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<String> stream = this.buildListIterator();
- String string = null;
- try {
- string = stream.previous();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testUnsupportedOperationExceptionAdd() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildListIterator(); stream.hasNext();) {
- if (stream.next().equals("3")) {
- try {
- stream.add("3.5");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testUnsupportedOperationExceptionSet() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildListIterator(); stream.hasNext();) {
- if (stream.next().equals("3")) {
- try {
- stream.set("three");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- @Override
- public void testGenerics() {
- Integer[] integers = new Integer[3];
- integers[0] = 0;
- integers[1] = 1;
- integers[2] = 2;
- int i = 0;
- for (Iterator<Number> stream = new ArrayListIterator<Number>(integers); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(integers.length, i);
- }
-
- @Override
- public void testVarargs() {
- int i = 0;
- for (Iterator<Number> stream = new ArrayListIterator<Number>(0, 1, 2); stream.hasNext();) {
- assertEquals(i++, stream.next().intValue());
- }
- assertEquals(3, i);
- }
-
- private ListIterator<String> buildListIterator() {
- return this.buildListIterator(this.buildArray());
- }
-
- private ListIterator<String> buildListIterator(String[] array) {
- return new ArrayListIterator<String>(array);
- }
-
- @Override
- Iterator<String> buildIterator(String[] array) {
- return new ArrayListIterator<String>(array);
- }
-
- @Override
- Iterator<String> buildIterator(String[] array, int start, int length) {
- return new ArrayListIterator<String>(array, start, length);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java
deleted file mode 100644
index 59cd3073b9..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.AbstractCollection;
-import java.util.AbstractList;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.ChainIterator;
-
-public class ChainIteratorTests extends TestCase {
- private final static Class<?>[] VECTOR_HIERARCHY = { Vector.class, AbstractList.class, AbstractCollection.class, Object.class };
-
- public ChainIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<Class<?>> stream = this.buildIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(VECTOR_HIERARCHY.length, i);
- }
-
- public void testInnerHasNext() {
- int i = 0;
- for (Iterator<Class<?>> stream = this.buildInnerIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(VECTOR_HIERARCHY.length, i);
- }
-
- public void testNext() {
- int i = 0;
- for (Iterator<Class<?>> stream = this.buildIterator(); stream.hasNext(); i++) {
- assertEquals("bogus link", VECTOR_HIERARCHY[i], stream.next());
- }
- }
-
- public void testInnerNext() {
- int i = 0;
- for (Iterator<Class<?>> stream = this.buildInnerIterator(); stream.hasNext(); i++) {
- assertEquals("bogus link", VECTOR_HIERARCHY[i], stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<Class<?>> stream = this.buildIterator();
- Class<?> javaClass = null;
- while (stream.hasNext()) {
- javaClass = stream.next();
- }
- try {
- javaClass = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + javaClass, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<Class<?>> stream = this.buildIterator(); stream.hasNext();) {
- if (stream.next() == AbstractCollection.class) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- private Iterator<Class<?>> buildIterator() {
- return this.buildChainIterator(Vector.class, this.buildLinker());
- }
-
- private Iterator<Class<?>> buildInnerIterator() {
- return this.buildInnerChainIterator(Vector.class);
- }
-
- private Iterator<Class<?>> buildChainIterator(Class<?> startLink, ChainIterator.Linker<Class<?>> linker) {
- return new ChainIterator<Class<?>>(startLink, linker);
- }
-
- private ChainIterator.Linker<Class<?>> buildLinker() {
- // chain up the class's hierarchy
- return new ChainIterator.Linker<Class<?>>() {
- public Class<?> nextLink(Class<?> currentLink) {
- return currentLink.getSuperclass();
- }
- };
- }
-
- private Iterator<Class<?>> buildInnerChainIterator(Class<?> startLink) {
- // chain up the class's hierarchy
- return new ChainIterator<Class<?>>(startLink) {
- @Override
- protected Class<?> nextLink(Class<?> currentLink) {
- return currentLink.getSuperclass();
- }
- };
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java
deleted file mode 100644
index e3afdb585f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class CloneIteratorTests extends TestCase {
- Collection<String> originalCollection;
-
- private boolean concurrentProblem;
- private Collection<String> concurrentCollection;
-
- public CloneIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.originalCollection = this.buildCollection();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testHasNext() {
- int originalSize = this.originalCollection.size();
- int i = 0;
- for (Iterator<String> stream = this.buildCloneIterator(); stream.hasNext();) {
- stream.next();
- // should allow concurrent modification
- this.originalCollection.add("foo");
- i++;
- }
- assertTrue(originalSize != this.originalCollection.size());
- assertEquals(originalSize, i);
- }
-
- public void testNext() {
- Iterator<String> nestedIterator = this.originalCollection.iterator();
- for (Iterator<String> stream = this.buildCloneIterator(); stream.hasNext();) {
- assertEquals("bogus element", nestedIterator.next(), stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildCloneIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testRemoveDefault() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildCloneIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testRemoveEliminator() {
- CloneIterator.Mutator<String> eliminator = new CloneIterator.Mutator<String>() {
- public void remove(String current) {
- CloneIteratorTests.this.originalCollection.remove(current);
- }
- };
- this.verifyRemove(new CloneIterator<String>(this.originalCollection, eliminator));
- }
-
- public void testRemoveSubclass() {
- this.verifyRemove(new CloneIterator<String>(this.originalCollection) {
- @Override
- protected void remove(String current) {
- CloneIteratorTests.this.originalCollection.remove(current);
- }
- });
- }
-
- /**
- * Test concurrent access: First build a clone iterator in a separate thread
- * that hangs momentarily during its construction; then modify the shared
- * collection in this thread. This would cause a
- * ConcurrentModificationException in the other thread if the clone iterator
- * were not synchronized on the original collection.
- */
- public void testConcurrentAccess() throws Exception {
- SlowCollection<String> slow = new SlowCollection<String>();
- this.populateCollection(slow);
- // using the unsynchronized collection will cause the test to fail
- // this.originalCollection = slow;
- this.originalCollection = Collections.synchronizedCollection(slow);
-
- this.concurrentProblem = false;
- this.concurrentCollection = new ArrayList<String>();
- Thread thread = new Thread(this.buildRunnable());
- thread.start();
- while (!slow.hasStartedClone()) {
- // wait for the other thread to start the clone...
- Thread.yield();
- }
- // ...then sneak in an extra element
- this.originalCollection.add("seventeen");
- while (thread.isAlive()) {
- // wait for the other thread to finish
- Thread.yield();
- }
- assertFalse(this.concurrentProblem);
- Collection<String> expected = new ArrayList<String>();
- this.populateCollection(expected);
- assertEquals(expected, this.concurrentCollection);
- }
-
- private Runnable buildRunnable() {
- return new Runnable() {
- public void run() {
- CloneIteratorTests.this.loopWithCloneIterator();
- }
- };
- }
-
- /**
- * use a clone iterator to loop over the "slow" collection and copy its
- * contents to the concurrent collection
- */
- void loopWithCloneIterator() {
- try {
- for (Iterator<String> stream = this.buildCloneIterator(); stream.hasNext();) {
- this.concurrentCollection.add(stream.next());
- }
- } catch (Throwable t) {
- this.concurrentProblem = true;
- }
- }
-
- private void verifyRemove(Iterator<String> iterator) {
- Object removed = "three";
- assertTrue(this.originalCollection.contains(removed));
- // try to remove before calling #next()
- boolean exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- while (iterator.hasNext()) {
- if (iterator.next().equals(removed)) {
- iterator.remove();
- // try to remove twice
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
- }
- assertFalse(this.originalCollection.contains(removed));
- }
-
- private Iterator<String> buildCloneIterator() {
- return this.buildCloneIterator(this.originalCollection);
- }
-
- private Iterator<String> buildCloneIterator(Collection<String> c) {
- return new CloneIterator<String>(c);
- }
-
- private Collection<String> buildCollection() {
- Collection<String> c = this.buildEmptyCollection();
- this.populateCollection(c);
- return c;
- }
-
- protected Collection<String> buildEmptyCollection() {
- return new ArrayList<String>();
- }
-
- private void populateCollection(Collection<String> c) {
- c.add("one");
- c.add("two");
- c.add("three");
- c.add("four");
- c.add("five");
- c.add("six");
- c.add("seven");
- c.add("eight");
- }
-
- // ********** custom collection **********
- static class SlowCollection<E> extends ArrayList<E> {
- private static final long serialVersionUID = 1L;
- private boolean hasStartedClone = false;
-
- public SlowCollection() {
- super();
- }
-
- @Override
- public Object[] toArray() {
- this.setHasStartedClone(true);
- // take a little snooze before returning the array
- try {
- Thread.sleep(100);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- return super.toArray();
- }
-
- synchronized void setHasStartedClone(boolean hasStartedClone) {
- this.hasStartedClone = hasStartedClone;
- }
-
- synchronized boolean hasStartedClone() {
- return this.hasStartedClone;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java
deleted file mode 100644
index c6045a9f12..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java
+++ /dev/null
@@ -1,408 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class CloneListIteratorTests extends TestCase {
- List<String> originalList;
-
- private boolean concurrentProblem;
- private List<String> concurrentList;
-
- public CloneListIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.originalList = this.buildList();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testHasNext() {
- int originalSize = this.originalList.size();
- int i = 0;
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- stream.next();
- // should allow concurrent modification
- this.originalList.add("foo");
- i++;
- }
- assertTrue(originalSize != this.originalList.size());
- assertEquals(originalSize, i);
- }
-
- public void testNext() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- assertEquals("bogus element", nestedListIterator.next(), stream.next());
- }
- }
-
- public void testIndex() {
- ListIterator<String> cloneListIterator = this.buildCloneListIterator();
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- for (int i = 0; i < 7; i++) {
- nestedListIterator.next();
- cloneListIterator.next();
- assertEquals("bogus index", nestedListIterator.nextIndex(), cloneListIterator.nextIndex());
- assertEquals("bogus index", nestedListIterator.previousIndex(), cloneListIterator.previousIndex());
- }
-
- for (int i = 0; i < 3; i++) {
- nestedListIterator.previous();
- cloneListIterator.previous();
- assertEquals("bogus index", nestedListIterator.nextIndex(), cloneListIterator.nextIndex());
- assertEquals("bogus index", nestedListIterator.previousIndex(), cloneListIterator.previousIndex());
- }
-
- while (nestedListIterator.hasNext()) {
- nestedListIterator.next();
- cloneListIterator.next();
- assertEquals("bogus index", nestedListIterator.nextIndex(), cloneListIterator.nextIndex());
- assertEquals("bogus index", nestedListIterator.previousIndex(), cloneListIterator.previousIndex());
- }
- }
-
- public void testHasPrevious() {
- int originalSize = this.originalList.size();
- int i = 0;
- ListIterator<String> stream = this.buildCloneListIterator();
- while (stream.hasNext()) {
- stream.next();
- this.originalList.add("foo");
- i++;
- }
- assertTrue(originalSize != this.originalList.size());
- originalSize = this.originalList.size();
- while (stream.hasPrevious()) {
- stream.previous();
- // should allow concurrent modification
- this.originalList.add("bar");
- i--;
- }
- assertTrue(originalSize != this.originalList.size());
- assertEquals(0, i);
- }
-
- public void testPrevious() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<String> stream = this.buildCloneListIterator();
- while (stream.hasNext()) {
- nestedListIterator.next();
- stream.next();
- }
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previous(), stream.previous());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<String> stream = this.buildCloneListIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
-
- exCaught = false;
- while (stream.hasPrevious()) {
- string = stream.previous();
- }
- try {
- string = stream.previous();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testModifyDefault() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
-
- exCaught = false;
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.add("three and a half");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
-
- exCaught = false;
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.set("another three");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testModifyMutatorNext() {
- this.verifyModifyNext(new CloneListIterator<String>(this.originalList, this.buildMutator()));
- }
-
- public void testModifyMutatorPrevious() {
- this.verifyModifyPrevious(new CloneListIterator<String>(this.originalList, this.buildMutator()));
- }
-
- private CloneListIterator.Mutator<String> buildMutator() {
- return new CloneListIterator.Mutator<String>() {
- public void add(int index, String o) {
- CloneListIteratorTests.this.originalList.add(index, o);
- }
-
- public void remove(int index) {
- CloneListIteratorTests.this.originalList.remove(index);
- }
-
- public void set(int index, String o) {
- CloneListIteratorTests.this.originalList.set(index, o);
- }
- };
- }
-
- public void testModifySubclassNext() {
- this.verifyModifyNext(this.buildSubclass());
- }
-
- public void testModifySubclassPrevious() {
- this.verifyModifyPrevious(this.buildSubclass());
- }
-
- private ListIterator<String> buildSubclass() {
- return new CloneListIterator<String>(this.originalList) {
- @Override
- protected void add(int currentIndex, String o) {
- CloneListIteratorTests.this.originalList.add(currentIndex, o);
- }
-
- @Override
- protected void remove(int currentIndex) {
- CloneListIteratorTests.this.originalList.remove(currentIndex);
- }
-
- @Override
- protected void set(int currentIndex, String o) {
- CloneListIteratorTests.this.originalList.set(currentIndex, o);
- }
- };
- }
-
- private void verifyModifyNext(ListIterator<String> iterator) {
- String removed = "three";
- String addedAfter = "five";
- String added = "five and a half";
- String replaced = "seven";
- String replacement = "another seven";
- assertTrue(this.originalList.contains(removed));
- assertTrue(this.originalList.contains(addedAfter));
- assertTrue(this.originalList.contains(replaced));
- // try to remove before calling #next()
- boolean exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- while (iterator.hasNext()) {
- String next = iterator.next();
- if (next.equals(addedAfter)) {
- iterator.add(added);
- }
- if (next.equals(removed)) {
- iterator.remove();
- // try to remove twice
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
- if (next.equals(replaced)) {
- iterator.set(replacement);
- }
- }
- assertTrue(this.originalList.contains(added));
- assertFalse(this.originalList.contains(removed));
- assertFalse(this.originalList.contains(replaced));
- assertTrue(this.originalList.contains(replacement));
- }
-
- private void verifyModifyPrevious(ListIterator<String> iterator) {
- String removed = "three";
- String addedBefore = "five";
- String added = "four and a half";
- String replaced = "seven";
- String replacement = "another seven";
- assertTrue(this.originalList.contains(removed));
- assertTrue(this.originalList.contains(addedBefore));
- assertTrue(this.originalList.contains(replaced));
- while (iterator.hasNext()) {
- iterator.next();
- }
- while (iterator.hasPrevious()) {
- Object previous = iterator.previous();
- if (previous.equals(addedBefore)) {
- iterator.add(added);
- }
- if (previous.equals(removed)) {
- iterator.remove();
- // try to remove twice
- boolean exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
- if (previous.equals(replaced)) {
- iterator.set(replacement);
- }
- }
- assertTrue(this.originalList.contains(added));
- assertFalse(this.originalList.contains(removed));
- assertFalse(this.originalList.contains(replaced));
- assertTrue(this.originalList.contains(replacement));
- }
-
- private ListIterator<String> buildCloneListIterator() {
- return this.buildCloneListIterator(this.originalList);
- }
-
- private ListIterator<String> buildCloneListIterator(List<String> list) {
- return new CloneListIterator<String>(list);
- }
-
- private ListIterator<String> buildNestedListIterator() {
- return this.originalList.listIterator();
- }
-
- private List<String> buildList() {
- List<String> list = this.buildEmptyList();
- this.populateList(list);
- return list;
- }
-
- private void populateList(List<String> list) {
- list.add("zero");
- list.add("one");
- list.add("two");
- list.add("three");
- list.add("four");
- list.add("five");
- list.add("six");
- list.add("seven");
- list.add("eight");
- list.add("nine");
- }
-
- protected List<String> buildEmptyList() {
- return new ArrayList<String>();
- }
-
- /**
- * Test concurrent access: First build a clone iterator in a separate thread
- * that hangs momentarily during its construction; then modify the shared
- * collection in this thread. This would cause a
- * ConcurrentModificationException in the other thread if the clone iterator
- * were not synchronized on the original collection.
- */
- public void testConcurrentAccess() throws Exception {
- CloneIteratorTests.SlowCollection<String> slow = new CloneIteratorTests.SlowCollection<String>();
- this.populateList(slow);
- // using the unsynchronized list will cause the test to fail
- // this.originalList = slow;
- this.originalList = Collections.synchronizedList(slow);
-
- this.concurrentProblem = false;
- this.concurrentList = new ArrayList<String>();
- Thread thread = new Thread(this.buildRunnable());
- thread.start();
- while (!slow.hasStartedClone()) {
- // wait for the other thread to start the clone...
- Thread.yield();
- }
- // ...then sneak in an extra element
- this.originalList.add("seventeen");
- while (thread.isAlive()) {
- // wait for the other thread to finish
- Thread.yield();
- }
- assertFalse(this.concurrentProblem);
- List<String> expected = new ArrayList<String>();
- this.populateList(expected);
- assertEquals(expected, this.concurrentList);
- }
-
- private Runnable buildRunnable() {
- return new Runnable() {
- public void run() {
- CloneListIteratorTests.this.loopWithCloneListIterator();
- }
- };
- }
-
- /**
- * use a clone iterator to loop over the "slow" collection and copy its
- * contents to the concurrent collection
- */
- void loopWithCloneListIterator() {
- try {
- for (ListIterator<String> stream = this.buildCloneListIterator(); stream.hasNext();) {
- this.concurrentList.add(stream.next());
- }
- } catch (Throwable t) {
- this.concurrentProblem = true;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java
deleted file mode 100644
index d7173cefa8..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-
-public class CompositeIteratorTests extends TestCase {
-
- public CompositeIteratorTests(String name) {
- super(name);
- }
-
- public void testHasAnother() {
- this.verifyHasAnother(this.buildCompositeIterator());
- }
-
- public void testHasAnother2() {
- this.verifyHasAnother(this.buildCompositeIterator2());
- }
-
- public void testHasAnother3() {
- this.verifyHasAnother(this.buildCompositeIterator3());
- }
-
- void verifyHasAnother(Iterator<String> stream) {
- this.verifyHasAnother(8, stream);
- }
-
- void verifyHasAnother(int expected, Iterator<String> stream) {
- int i = 0;
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(expected, i);
- }
-
- public void testAnother() {
- this.verifyAnother(this.buildCompositeIterator());
- }
-
- public void testAnother2() {
- this.verifyAnother(this.buildCompositeIterator2());
- }
-
- public void testAnother3() {
- this.verifyAnother(this.buildCompositeIterator3());
- }
-
- void verifyAnother(Iterator<String> stream) {
- this.verifyAnother(1, stream);
- }
-
- void verifyAnother(int start, Iterator<String> stream) {
- int index = start;
- while (stream.hasNext()) {
- assertEquals("bogus element", String.valueOf(index++), stream.next().substring(0, 1));
- }
- }
-
- public void testRemove() {
- List<String> list1 = this.buildList1();
- Object lastElement1 = list1.get(list1.size() - 1);
- List<String> list2 = this.buildList2();
- List<String> list3 = this.buildList3();
-
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(list1.listIterator());
- list.add(list2.listIterator());
- list.add(list3.listIterator());
-
- Iterator<String> stream = this.buildCompositeIterator(list.listIterator());
- while (stream.hasNext()) {
- Object next = stream.next();
- if (next.equals("333")) {
- stream.remove();
- }
- // test special case - where we are between iterators
- if (next.equals(lastElement1)) {
- // this will trigger the next iterator to be loaded
- stream.hasNext();
- // now try to remove from the previous iterator
- stream.remove();
- }
- }
- stream.remove();
-
- assertEquals("nothing removed from collection 1", this.buildList1().size() - 2, list1.size());
- assertFalse("element still in collection 1", list1.contains("333"));
- assertFalse("last element still in collection 1", list1.contains(lastElement1));
- assertTrue("wrong element removed from collection 1", list1.contains("22"));
-
- assertEquals("nothing removed from collection 3", this.buildList3().size() - 1, list3.size());
- assertFalse("element still in collection 3", list3.contains("88888888"));
- assertTrue("wrong element removed from collection 3", list3.contains("666666"));
- }
-
- public void testSingleElement() {
- String item = "0";
- this.verifyHasAnother(9, this.buildCompositeIterator(item, this.buildCompositeIterator()));
- this.verifyAnother(0, this.buildCompositeIterator(item, this.buildCompositeIterator()));
- }
-
- public void testNoSuchElementException() {
- this.verifyNoSuchElementException(this.buildCompositeIterator());
- }
-
- void verifyNoSuchElementException(Iterator<String> stream) {
- boolean exCaught = false;
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- this.verifyUnsupportedOperationException(this.buildUnmodifiableCompositeIterator());
- }
-
- void verifyUnsupportedOperationException(Iterator<String> stream) {
- boolean exCaught = false;
- while (stream.hasNext()) {
- Object string = stream.next();
- if (string.equals("333")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testIllegalStateException() {
- this.verifyIllegalStateException(this.buildCompositeIterator());
- }
-
- void verifyIllegalStateException(Iterator<String> stream) {
- boolean exCaught = false;
- try {
- stream.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- public void testEmptyHasAnother1() {
- this.verifyEmptyHasAnother(this.buildEmptyCompositeIterator1());
- }
-
- void verifyEmptyHasAnother(Iterator<String> stream) {
- int i = 0;
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testEmptyNoSuchElementException1() {
- this.verifyNoSuchElementException(this.buildEmptyCompositeIterator1());
- }
-
- public void testEmptyIllegalStateException1() {
- this.verifyIllegalStateException(this.buildEmptyCompositeIterator1());
- }
-
- public void testEmptyHasAnother2() {
- this.verifyEmptyHasAnother(this.buildEmptyCompositeIterator2());
- }
-
- public void testEmptyNoSuchElementException2() {
- this.verifyNoSuchElementException(this.buildEmptyCompositeIterator2());
- }
-
- public void testEmptyIllegalStateException2() {
- this.verifyIllegalStateException(this.buildEmptyCompositeIterator2());
- }
-
- Iterator<String> buildCompositeIterator() {
- return this.buildCompositeIterator(this.buildIterators());
- }
-
- Iterator<String> buildEmptyCompositeIterator1() {
- return this.buildCompositeIterator(this.buildEmptyIterators1());
- }
-
- Iterator<String> buildEmptyCompositeIterator2() {
- return this.buildCompositeIterator(this.buildEmptyIterators2());
- }
-
- Iterator<String> buildUnmodifiableCompositeIterator() {
- return this.buildCompositeIterator(this.buildUnmodifiableIterators());
- }
-
- // leave unchecked so we can override in subclass
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator(Iterator iterators) {
- return new CompositeIterator<String>(iterators);
- }
-
- // use vararg constructor
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator2() {
- return new CompositeIterator<String>(this.buildIterator1(), this.buildIterator2(), this.buildIterator3());
- }
-
- // use vararg constructor
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator3() {
- return new CompositeIterator<String>(new Iterator[] { this.buildIterator1(), this.buildIterator2(), this.buildIterator3() });
- }
-
- Iterator<String> buildCompositeIterator(String string, Iterator<String> iterator) {
- return new CompositeIterator<String>(string, iterator);
- }
-
- ListIterator<Iterator<String>> buildIterators() {
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(this.buildIterator1());
- list.add(this.buildIterator2());
- list.add(this.buildIterator3());
- return list.listIterator();
- }
-
- ListIterator<Iterator<String>> buildEmptyIterators1() {
- return this.buildEmptyIteratorIterator();
- }
-
- ListIterator<Iterator<String>> buildEmptyIterators2() {
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(this.buildEmptyStringIterator());
- list.add(this.buildEmptyStringIterator());
- list.add(this.buildEmptyStringIterator());
- return list.listIterator();
- }
-
- ListIterator<Iterator<String>> buildUnmodifiableIterators() {
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(this.buildUnmodifiableIterator1());
- list.add(this.buildUnmodifiableIterator2());
- list.add(this.buildUnmodifiableIterator3());
- return list.listIterator();
- }
-
- ListIterator<String> buildIterator1() {
- return this.buildList1().listIterator();
- }
-
- ListIterator<String> buildIterator2() {
- return this.buildList2().listIterator();
- }
-
- ListIterator<String> buildIterator3() {
- return this.buildList3().listIterator();
- }
-
- ListIterator<String> buildUnmodifiableIterator1() {
- return this.buildUnmodifiableList1().listIterator();
- }
-
- ListIterator<String> buildUnmodifiableIterator2() {
- return this.buildUnmodifiableList2().listIterator();
- }
-
- ListIterator<String> buildUnmodifiableIterator3() {
- return this.buildUnmodifiableList3().listIterator();
- }
-
- ListIterator<Iterator<String>> buildEmptyIteratorIterator() {
- return (new ArrayList<Iterator<String>>()).listIterator();
- }
-
- ListIterator<String> buildEmptyStringIterator() {
- return (new ArrayList<String>()).listIterator();
- }
-
- List<String> buildList1() {
- List<String> list = new ArrayList<String>();
- list.add("1");
- list.add("22");
- list.add("333");
- list.add("4444");
- return list;
- }
-
- List<String> buildList2() {
- return new ArrayList<String>();
- }
-
- List<String> buildList3() {
- List<String> list = new ArrayList<String>();
- list.add("55555");
- list.add("666666");
- list.add("7777777");
- list.add("88888888");
- return list;
- }
-
- List<String> buildUnmodifiableList1() {
- return Collections.unmodifiableList(this.buildList1());
- }
-
- List<String> buildUnmodifiableList2() {
- return Collections.unmodifiableList(this.buildList2());
- }
-
- List<String> buildUnmodifiableList3() {
- return Collections.unmodifiableList(this.buildList3());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java
deleted file mode 100644
index f2de1d1426..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-
-public class CompositeListIteratorTests extends CompositeIteratorTests {
-
- public CompositeListIteratorTests(String name) {
- super(name);
- }
-
- @Override
- void verifyHasAnother(Iterator<String> stream) {
- super.verifyHasAnother(stream);
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- int i = 0;
- while (stream2.hasPrevious()) {
- stream2.previous();
- i++;
- }
- assertEquals(8, i);
- }
-
- @Override
- void verifyAnother(Iterator<String> stream) {
- super.verifyAnother(stream);
- int i = 8;
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- while (stream2.hasPrevious()) {
- assertEquals("bogus element", String.valueOf(i--), stream2.previous().substring(0, 1));
- }
- }
-
- @Override
- public void testRemove() {
- super.testRemove();
- List<String> list1 = this.buildList1();
- List<String> list2 = this.buildList2();
- List<String> list3 = this.buildList3();
- Object firstElement3 = list3.get(0);
-
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(list1.listIterator());
- list.add(list2.listIterator());
- list.add(list3.listIterator());
-
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator(list.listIterator());
- // position to end of stream
- while (stream.hasNext()) {
- stream.next();
- }
- while (stream.hasPrevious()) {
- Object previous = stream.previous();
- if (previous.equals("333")) {
- stream.remove();
- }
- // test special case - where we are between iterators
- if (previous.equals(firstElement3)) {
- // this will trigger the next iterator to be loaded
- stream.hasPrevious();
- // now try to remove from the previous iterator
- stream.remove();
- }
- }
- stream.remove();
-
- assertEquals("nothing removed from collection 1", this.buildList1().size() - 2, list1.size());
- assertFalse("element still in collection 1", list1.contains("1"));
- assertFalse("element still in collection 1", list1.contains("333"));
-
- assertEquals("nothing removed from collection 3", this.buildList3().size() - 1, list3.size());
- assertFalse("first element still in collection 3", list3.contains(firstElement3));
- assertTrue("wrong element removed from collection 3", list3.contains("666666"));
- }
-
- public void testAdd() {
- List<String> list1 = this.buildList1();
- Object lastElement1 = list1.get(list1.size() - 1);
- List<String> list2 = this.buildList2();
- List<String> list3 = this.buildList3();
- Object firstElement3 = list3.get(0);
-
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(list1.listIterator());
- list.add(list2.listIterator());
- list.add(list3.listIterator());
-
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator(list.listIterator());
- while (stream.hasNext()) {
- Object next = stream.next();
- if (next.equals("333")) {
- stream.add("3.5");
- }
- // test special case - where we are between iterators
- if (next.equals(lastElement1)) {
- // this will trigger the next iterator to be loaded
- stream.hasNext();
- // now try to add to the iterator
- stream.add("something in 3");
- }
- }
- stream.add("finale");
- boolean checkForFinale = true;
- while (stream.hasPrevious()) {
- Object previous = stream.previous();
- if (checkForFinale) {
- checkForFinale = false;
- assertEquals("added element dropped", "finale", previous);
- }
- if (previous.equals("333")) {
- stream.add("2.5");
- }
- // test special case - where we are between iterators
- if (previous.equals(firstElement3)) {
- // this will trigger the next iterator to be loaded
- stream.hasPrevious();
- // now try to remove from the previous iterator
- stream.add("old start of 3");
- }
- }
- stream.add("prelude");
- assertEquals("added element dropped", "prelude", stream.previous());
-
- assertEquals("elements not added to collection 1", this.buildList1().size() + 3, list1.size());
- assertEquals("element not added to collection 1", "prelude", list1.get(0));
- assertEquals("element not added to collection 1", "2.5", list1.get(3));
- assertEquals("element not added to collection 1", "3.5", list1.get(5));
-
- assertEquals("elements not added to collection 3", this.buildList3().size() + 3, list3.size());
- assertEquals("element not added to collection 3", "something in 3", list3.get(0));
- assertEquals("element not added to collection 3", "old start of 3", list3.get(1));
- assertEquals("element not added to collection 3", "finale", list3.get(list3.size() - 1));
-
- // add to the front
- stream = (ListIterator<String>) this.buildCompositeIterator();
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- while (stream.hasPrevious()) {
- stream.previous();
- }
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- while (stream.hasPrevious()) {
- stream.previous();
- }
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
-
- // add to the middle
- stream = (ListIterator<String>) this.buildCompositeIterator();
- stream.next();
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- stream.next();
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- stream.previous();
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.next().equals("blah"));
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- stream.previous();
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
-
- // add to the end
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- stream.add("blah");
- assertFalse("added element should be placed BEFORE the \"cursor\"", stream.hasNext());
-
- stream = (ListIterator<String>) this.buildCompositeIterator();
- while (stream.hasNext()) {
- stream.next();
- }
- stream.add("blah");
- assertTrue("added element should be placed BEFORE the \"cursor\"", stream.previous().equals("blah"));
- }
-
- public void testSet() {
- List<String> list1 = this.buildList1();
- Object lastElement1 = list1.get(list1.size() - 1);
- List<String> list2 = this.buildList2();
- List<String> list3 = this.buildList3();
- Object firstElement3 = list3.get(0);
-
- List<Iterator<String>> list = new ArrayList<Iterator<String>>();
- list.add(list1.listIterator());
- list.add(list2.listIterator());
- list.add(list3.listIterator());
-
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator(list.listIterator());
- // position to end of stream
- while (stream.hasNext()) {
- Object next = stream.next();
- if (next.equals("333")) {
- stream.set("333a");
- }
- // test special case - where we are between iterators
- if (next.equals(lastElement1)) {
- // this will trigger the next iterator to be loaded
- stream.hasNext();
- // now try to remove from the previous iterator
- stream.set("end of 1");
- }
- }
- while (stream.hasPrevious()) {
- Object previous = stream.previous();
- if (previous.equals("22")) {
- stream.set("22a");
- }
- // test special case - where we are between iterators
- if (previous.equals(firstElement3)) {
- // this will trigger the next iterator to be loaded
- stream.hasPrevious();
- // now try to remove from the previous iterator
- stream.set("start of 3");
- }
- }
-
- assertEquals("element(s) added to collection 1", this.buildList1().size(), list1.size());
- assertEquals("element not set in collection 1", "22a", list1.get(1));
- assertFalse("element not set in collection 1", list1.contains("22"));
- assertEquals("element not set in collection 1", "333a", list1.get(2));
- assertFalse("element not set in collection 1", list1.contains("333"));
- assertEquals("element not set in collection 1", "end of 1", list1.get(list1.size() - 1));
- assertFalse("element not set in collection 1", list1.contains(lastElement1));
-
- assertEquals("element(s) added to collection 3", this.buildList3().size(), list3.size());
- assertEquals("element not set in collection 3", "start of 3", list3.get(0));
- assertFalse("element not set in collection 3", list3.contains(firstElement3));
- }
-
- public void testNextIndexPreviousIndex() {
- int i = 0;
- ListIterator<String> stream = (ListIterator<String>) this.buildCompositeIterator();
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- while (stream.hasNext()) {
- Object next = stream.next();
- i++;
- if (next.equals("333")) {
- stream.remove();
- i--;
- }
- if (next.equals("7777777")) {
- stream.add("7.5");
- i++;
- }
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- }
- assertEquals("index is corrupt", 8, i);
-
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- while (stream.hasPrevious()) {
- Object previous = stream.previous();
- i--;
- if (previous.equals("666666")) {
- stream.remove();
- // removing a previous element, does not change the cursor
- }
- if (previous.equals("22")) {
- stream.add("1.5");
- i++;
- }
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- }
- assertEquals("index is corrupt", 0, i);
- }
-
- public void testPreviousIndex() {
- // TODO
- }
-
- @Override
- void verifyNoSuchElementException(Iterator<String> stream) {
- super.verifyNoSuchElementException(stream);
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- boolean exCaught = false;
- String string = null;
- while (stream2.hasPrevious()) {
- string = stream2.previous();
- }
- try {
- string = stream2.previous();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- @Override
- void verifyUnsupportedOperationException(Iterator<String> stream) {
- super.verifyUnsupportedOperationException(stream);
- boolean exCaught = false;
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- while (stream2.hasPrevious()) {
- Object string = stream2.previous();
- if (string.equals("333")) {
- try {
- stream2.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- @Override
- void verifyIllegalStateException(Iterator<String> stream) {
- super.verifyIllegalStateException(stream);
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- boolean exCaught = false;
- try {
- stream2.set("junk");
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- @Override
- void verifyEmptyHasAnother(Iterator<String> stream) {
- super.verifyEmptyHasAnother(stream);
- ListIterator<String> stream2 = (ListIterator<String>) stream;
- int i = 0;
- while (stream2.hasPrevious()) {
- stream2.previous();
- i++;
- }
- assertEquals(0, i);
- }
-
- // unchecked so we can override the unchecked method in superclass
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator(Iterator iterators) {
- return new CompositeListIterator<String>((ListIterator<ListIterator<String>>) iterators);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator2() {
- return new CompositeListIterator<String>(this.buildIterator1(), this.buildIterator2(), this.buildIterator3());
- }
-
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator3() {
- return new CompositeListIterator<String>(new ListIterator[] { this.buildIterator1(), this.buildIterator2(), this.buildIterator3() });
- }
-
- Iterator<String> buildCompositeIterator(String string, ListIterator<String> iterator) {
- return this.buildCompositeListIterator(string, iterator);
- }
-
- ListIterator<String> buildCompositeListIterator(String string, ListIterator<String> iterator) {
- return new CompositeListIterator<String>(string, iterator);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java
deleted file mode 100644
index 98697897b7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyEnumerationTests.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.EmptyEnumeration;
-
-public class EmptyEnumerationTests extends TestCase {
-
- public EmptyEnumerationTests(String name) {
- super(name);
- }
-
- public void testHasMoreElements() {
- int i = 0;
- for (Enumeration<Object> stream = EmptyEnumeration.instance(); stream.hasMoreElements();) {
- stream.nextElement();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testNextElement() {
- for (Enumeration<Object> stream = EmptyEnumeration.instance(); stream.hasMoreElements();) {
- fail("bogus element: " + stream.nextElement());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Enumeration<Object> stream = EmptyEnumeration.instance();
- Object element = null;
- while (stream.hasMoreElements()) {
- element = stream.nextElement();
- }
- try {
- element = stream.nextElement();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + element, exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java
deleted file mode 100644
index 6985ad4ffa..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-public class EmptyIteratorTests extends TestCase {
-
- public EmptyIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<Object> stream = EmptyIterator.instance(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testNext() {
- for (Iterator<String> stream = EmptyIterator.instance(); stream.hasNext();) {
- fail("bogus element: " + stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<Number> stream = EmptyIterator.instance();
- Object element = null;
- while (stream.hasNext()) {
- element = stream.next();
- }
- try {
- element = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + element, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- try {
- EmptyIterator.instance().remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java
deleted file mode 100644
index 35c8efc011..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-public class EmptyListIteratorTests extends TestCase {
-
- public EmptyListIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (ListIterator<Object> stream = EmptyListIterator.instance(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testNext() {
- for (ListIterator<Object> stream = EmptyListIterator.instance(); stream.hasNext();) {
- fail("bogus element: " + stream.next());
- }
- }
-
- public void testNextIndex() {
- ListIterator<Object> stream = EmptyListIterator.instance();
- assertEquals(0, stream.nextIndex());
- }
-
- public void testHasPrevious() {
- ListIterator<Object> stream = EmptyListIterator.instance();
- int i = 0;
- while (stream.hasPrevious()) {
- stream.previous();
- i++;
- }
- assertEquals(0, i);
-
- while (stream.hasNext()) {
- stream.next();
- }
- i = 0;
- while (stream.hasPrevious()) {
- stream.previous();
- i++;
- }
- assertEquals(0, i);
- }
-
- public void testPrevious() {
- ListIterator<Object> stream = EmptyListIterator.instance();
- while (stream.hasPrevious()) {
- fail("bogus element: " + stream.previous());
- }
- while (stream.hasNext()) {
- stream.next();
- }
- while (stream.hasPrevious()) {
- fail("bogus element: " + stream.previous());
- }
- }
-
- public void testPreviousIndex() {
- ListIterator<Object> stream = EmptyListIterator.instance();
- assertEquals(-1, stream.previousIndex());
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<Object> stream = EmptyListIterator.instance();
- Object element = null;
- while (stream.hasNext()) {
- element = stream.next();
- }
- try {
- element = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown (next): " + element, exCaught);
- while (stream.hasPrevious()) {
- element = stream.previous();
- }
- try {
- element = stream.previous();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown (previous): " + element, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- try {
- EmptyListIterator.instance().remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("UnsupportedOperationException not thrown (remove)", exCaught);
- try {
- EmptyListIterator.instance().set(new Object());
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("UnsupportedOperationException not thrown (set)", exCaught);
- try {
- EmptyListIterator.instance().add(new Object());
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("UnsupportedOperationException not thrown (add)", exCaught);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java
deleted file mode 100644
index 528f101110..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.EnumerationIterator;
-
-public class EnumerationIteratorTests extends TestCase {
-
- public EnumerationIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testHasNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildIteratorUpcast(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testNext() {
- Enumeration<String> enumeration = this.buildEnumeration();
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- assertEquals("bogus element", enumeration.nextElement(), stream.next());
- }
- }
-
- public void testNextUpcast() {
- Enumeration<String> enumeration = this.buildEnumeration();
- for (Iterator<Object> stream = this.buildIteratorUpcast(); stream.hasNext();) {
- assertEquals("bogus element", enumeration.nextElement(), stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- private Iterator<String> buildIterator() {
- return this.buildIterator(this.buildEnumeration());
- }
-
- private Iterator<String> buildIterator(Enumeration<String> enumeration) {
- return new EnumerationIterator<String>(enumeration);
- }
-
- private Enumeration<String> buildEnumeration() {
- return this.buildVector().elements();
- }
-
- private Vector<String> buildVector() {
- Vector<String> v = new Vector<String>();
- v.addElement("one");
- v.addElement("two");
- v.addElement("three");
- v.addElement("four");
- v.addElement("five");
- v.addElement("six");
- v.addElement("seven");
- v.addElement("eight");
- return v;
- }
-
- private Iterator<Object> buildIteratorUpcast() {
- return this.buildIteratorUpcast(this.buildEnumeration());
- }
-
- private Iterator<Object> buildIteratorUpcast(Enumeration<String> enumeration) {
- return new EnumerationIterator<Object>(enumeration);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java
deleted file mode 100644
index c268245304..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Filter;
-import org.eclipse.jpt.utility.internal.SimpleFilter;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-public class FilteringIteratorTests extends TestCase {
-
- private static final String PREFIX = "prefix";
-
- public FilteringIteratorTests(String name) {
- super(name);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildAcceptIterator(); stream.hasNext();) {
- String string = stream.next();
- if (string.equals(PREFIX + "3")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildAcceptIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testAcceptHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildAcceptIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testAcceptNext() {
- for (Iterator<String> stream = this.buildAcceptIterator(); stream.hasNext();) {
- assertTrue("bogus accept", stream.next().startsWith(PREFIX));
- }
- }
-
- public void testInnerHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildInnerIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testInnerNext() {
- for (Iterator<String> stream = this.buildInnerIterator(); stream.hasNext();) {
- assertTrue("bogus accept", stream.next().startsWith(PREFIX));
- }
- }
-
- public void testRejectHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildRejectIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(2, i);
- }
-
- public void testRejectNext() {
- for (Iterator<String> stream = this.buildRejectIterator(); stream.hasNext();) {
- assertFalse("bogus reject", stream.next().startsWith(PREFIX));
- }
- }
-
- public void testBothHasNext() {
- // if both accept() and reject() are overridden, accept() is used
- int i = 0;
- for (Iterator<String> stream = this.buildBothIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testLoadNext() {
- // loadNext() used to cause a NPE when executing during the
- // constructor because the "outer" class is not bound until completion
- // of the constructor
- for (Iterator<String> stream = this.buildInnerIterator2(); stream.hasNext();) {
- assertTrue("bogus accept", stream.next().startsWith(PREFIX));
- }
- }
-
- // test a filtered iterator with a nested iterator of a sub-type (Number vs. Integer)
- public void testGenerics1() {
- List<Integer> integers = new ArrayList<Integer>();
- integers.add(new Integer(0));
- integers.add(new Integer(1));
- integers.add(new Integer(2));
- integers.add(new Integer(3));
- Iterator<Number> stream = new FilteringIterator<Number>(integers.iterator()) {
- @Override
- protected boolean accept(Object o) {
- return ((Number) o).intValue() > 1;
- }
- };
- assertEquals(2, CollectionTools.size(stream));
- }
-
- // test a filtered iterator with a nested iterator of a super-type (Integer vs. Number)
- // i.e. trust that Filter will only return the appropriate sub-type objects
- public void testGenerics2() {
- List<Number> integers = new ArrayList<Number>();
- integers.add(new Integer(0));
- integers.add(new Long(1));
- integers.add(new Integer(2));
- integers.add(new Float(3));
- Iterator<Integer> stream = new FilteringIterator<Integer>(integers.iterator()) {
- @Override
- protected boolean accept(Object o) {
- return o instanceof Integer;
- }
- };
- assertEquals(2, CollectionTools.size(stream));
- }
-
- public void testFilterHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildFilterIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testFilterNext() {
- for (Iterator<String> stream = this.buildFilterIterator(); stream.hasNext();) {
- assertTrue("bogus accept", stream.next().startsWith(PREFIX));
- }
- }
-
- private Iterator<String> buildFilteredIterator(Iterator<String> nestedIterator, Filter<String> filter) {
- return new FilteringIterator<String>(nestedIterator, filter);
- }
-
- private Iterator<String> buildInnerFilteredIterator(Iterator<String> nestedIterator) {
- return new FilteringIterator<String>(nestedIterator) {
- @Override
- protected boolean accept(Object o) {
- return ((String) o).startsWith(PREFIX);
- }
- };
- }
-
- String getPrefix() {
- return PREFIX;
- }
-
- // this inner iterator will call the "outer" object
- private Iterator<String> buildInnerFilteredIterator2(Iterator<String> nestedIterator) {
- return new FilteringIterator<String>(nestedIterator) {
- @Override
- protected boolean accept(Object o) {
- return ((String) o).startsWith(FilteringIteratorTests.this.getPrefix());
- }
- };
- }
-
- private Iterator<String> buildNestedIterator() {
- Collection<String> c = new ArrayList<String>();
- c.add(PREFIX + "1");
- c.add(PREFIX + "2");
- c.add(PREFIX + "3");
- c.add("4");
- c.add(PREFIX + "5");
- c.add(PREFIX + "6");
- c.add(PREFIX + "7");
- c.add("8");
- return c.iterator();
- }
-
- private Iterator<String> buildAcceptIterator() {
- return this.buildFilteredIterator(this.buildNestedIterator(), this.buildAcceptFilter(PREFIX));
- }
-
- private Iterator<String> buildInnerIterator() {
- return this.buildInnerFilteredIterator(this.buildNestedIterator());
- }
-
- // this inner iterator will call the "outer" object
- private Iterator<String> buildInnerIterator2() {
- return this.buildInnerFilteredIterator2(this.buildNestedIterator());
- }
-
- private Iterator<String> buildFilterIterator() {
- return this.buildFilteredIterator(this.buildNestedIterator(), this.buildFilterFilter(PREFIX));
- }
-
- private Filter<String> buildAcceptFilter(String prefix) {
- return new SimpleFilter<String, String>(prefix) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public boolean accept(String s) {
- return s.startsWith(this.criterion);
- }
- };
- }
-
- private Iterator<String> buildRejectIterator() {
- return this.buildFilteredIterator(this.buildNestedIterator(), this.buildRejectFilter(PREFIX));
- }
-
- private Filter<String> buildRejectFilter(String prefix) {
- return new SimpleFilter<String, String>(prefix) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public boolean reject(String s) {
- return s.startsWith(this.criterion);
- }
- };
- }
-
- // use anonymous inner Filter
- private Filter<String> buildFilterFilter(final String prefix) {
- return new Filter<String>() {
- public boolean accept(String s) {
- return s.startsWith(prefix);
- }
- };
- }
-
- private Iterator<String> buildBothIterator() {
- return this.buildFilteredIterator(this.buildNestedIterator(), this.buildBothFilter(PREFIX));
- }
-
- private Filter<String> buildBothFilter(String prefix) {
- return new SimpleFilter<String, String>(prefix) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public boolean reject(String s) {
- return s.startsWith(this.criterion);
- }
-
- @Override
- public boolean accept(String s) {
- return s.startsWith(this.criterion);
- }
- };
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java
deleted file mode 100644
index d7f884c04e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.GraphIterator;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class GraphIteratorTests extends TestCase {
- /** this will be populated with all the nodes created for the test */
- Collection<GraphNode> nodes = new ArrayList<GraphNode>();
-
- public GraphIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testHasNext1() {
- this.verifyHasNext(this.buildGraphIterator1());
- }
-
- public void testHasNext2() {
- this.verifyHasNext(this.buildGraphIterator2());
- }
-
- private void verifyHasNext(Iterator<GraphNode> iterator) {
- int i = 0;
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(this.nodes.size(), i);
- }
-
- public void testNext1() {
- this.verifyNext(this.buildGraphIterator1());
- }
-
- public void testNext2() {
- this.verifyNext(this.buildGraphIterator2());
- }
-
- private void verifyNext(Iterator<GraphNode> iterator) {
- while (iterator.hasNext()) {
- assertTrue("bogus element", this.nodes.contains(iterator.next()));
- }
- }
-
- public void testNoSuchElementException1() {
- this.verifyNoSuchElementException(this.buildGraphIterator1());
- }
-
- public void testNoSuchElementException2() {
- this.verifyNoSuchElementException(this.buildGraphIterator2());
- }
-
- private void verifyNoSuchElementException(Iterator<GraphNode> iterator) {
- boolean exCaught = false;
- while (iterator.hasNext()) {
- iterator.next();
- }
- try {
- iterator.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
- public void testSize1() {
- this.verifySize(this.buildGraphIterator1());
- }
-
- public void testSize2() {
- this.verifySize(this.buildGraphIterator2());
- }
-
- private void verifySize(Iterator<GraphNode> iterator) {
- int iteratorSize = CollectionTools.size(iterator);
- int actualSize = this.nodes.size();
- assertTrue("Too few items in iterator.", iteratorSize >= actualSize);
- assertTrue("Too many items in iterator.", iteratorSize <= actualSize);
- }
-
- /**
- * build a graph iterator with an explicit misterRogers
- */
- private Iterator<GraphNode> buildGraphIterator1() {
- return new GraphIterator<GraphNode>(this.buildGraphRoot(), this.buildMisterRogers());
- }
-
- private GraphIterator.MisterRogers<GraphNode> buildMisterRogers() {
- return new GraphIterator.MisterRogers<GraphNode>() {
- public Iterator<GraphNode> neighbors(GraphNode next) {
- return next.neighbors();
- }
- };
- }
-
- /**
- * build a graph iterator with an override
- */
- private Iterator<GraphNode> buildGraphIterator2() {
- return new GraphIterator<GraphNode>(this.buildGraphRoot()) {
- @Override
- public Iterator<GraphNode> neighbors(GraphNode next) {
- return next.neighbors();
- }
- };
- }
-
- private GraphNode buildGraphRoot() {
- GraphNode ncNode = new GraphNode("North Carolina");
- GraphNode vaNode = new GraphNode("Virginia");
- GraphNode scNode = new GraphNode("South Carolina");
- GraphNode gaNode = new GraphNode("Georgia");
- GraphNode flNode = new GraphNode("Florida");
- GraphNode alNode = new GraphNode("Alabama");
- GraphNode msNode = new GraphNode("Mississippi");
- GraphNode tnNode = new GraphNode("Tennessee");
-
- ncNode.setNeighbors(new GraphNode[] { vaNode, scNode, gaNode, tnNode });
- vaNode.setNeighbors(new GraphNode[] { ncNode, tnNode });
- scNode.setNeighbors(new GraphNode[] { ncNode, gaNode });
- gaNode.setNeighbors(new GraphNode[] { ncNode, scNode, flNode, alNode, tnNode });
- flNode.setNeighbors(new GraphNode[] { gaNode });
- alNode.setNeighbors(new GraphNode[] { gaNode, msNode, tnNode });
- msNode.setNeighbors(new GraphNode[] { alNode, tnNode });
- tnNode.setNeighbors(new GraphNode[] { vaNode, ncNode, gaNode, alNode, msNode });
-
- return ncNode;
- }
-
- private class GraphNode {
- private String name;
-
- private Collection<GraphNode> neighbors = new ArrayList<GraphNode>();
-
- public GraphNode(String name) {
- super();
- GraphIteratorTests.this.nodes.add(this); // log node
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- void setNeighbors(GraphNode[] neighbors) {
- this.neighbors = CollectionTools.list(neighbors);
- }
-
- public Iterator<GraphNode> neighbors() {
- return this.neighbors.iterator();
- }
-
- public int neighborsSize() {
- return this.neighbors.size();
- }
-
- @Override
- public String toString() {
- return "GraphNode(" + this.name + ")";
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java
deleted file mode 100644
index 42d8eb459e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/IteratorEnumerationTests.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.IteratorEnumeration;
-
-public class IteratorEnumerationTests extends TestCase {
-
- public IteratorEnumerationTests(String name) {
- super(name);
- }
-
- public void testHasMoreElements() {
- int i = 0;
- for (Enumeration<String> stream = this.buildEnumeration(); stream.hasMoreElements();) {
- stream.nextElement();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testHasMoreElementsUpcast() {
- int i = 0;
- for (Enumeration<Object> stream = this.buildEnumerationUpcast(); stream.hasMoreElements();) {
- stream.nextElement();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testNextElement() {
- Iterator<String> iterator = this.buildIterator();
- for (Enumeration<String> stream = this.buildEnumeration(); stream.hasMoreElements();) {
- assertEquals("bogus element", iterator.next(), stream.nextElement());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Enumeration<String> stream = this.buildEnumeration();
- String string = null;
- while (stream.hasMoreElements()) {
- string = stream.nextElement();
- }
- try {
- string = stream.nextElement();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- private Enumeration<String> buildEnumeration() {
- return this.buildEnumeration(this.buildIterator());
- }
-
- private Enumeration<Object> buildEnumerationUpcast() {
- return this.buildEnumerationUpcast(this.buildIterator());
- }
-
- private Enumeration<String> buildEnumeration(Iterator<String> iterator) {
- return new IteratorEnumeration<String>(iterator);
- }
-
- private Enumeration<Object> buildEnumerationUpcast(Iterator<String> iterator) {
- return new IteratorEnumeration<Object>(iterator);
- }
-
- private Iterator<String> buildIterator() {
- return this.buildVector().iterator();
- }
-
- private Vector<String> buildVector() {
- Vector<String> v = new Vector<String>();
- v.addElement("one");
- v.addElement("two");
- v.addElement("three");
- v.addElement("four");
- v.addElement("five");
- v.addElement("six");
- v.addElement("seven");
- v.addElement("eight");
- return v;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java
deleted file mode 100644
index 76e6717b34..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptUtilityIteratorsTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityIteratorsTests.class.getPackage().getName());
-
- suite.addTestSuite(ArrayIteratorTests.class);
- suite.addTestSuite(ArrayListIteratorTests.class);
- suite.addTestSuite(ChainIteratorTests.class);
- suite.addTestSuite(CloneIteratorTests.class);
- suite.addTestSuite(CloneListIteratorTests.class);
- suite.addTestSuite(CompositeIteratorTests.class);
- suite.addTestSuite(CompositeListIteratorTests.class);
- suite.addTestSuite(EmptyEnumerationTests.class);
- suite.addTestSuite(EmptyIteratorTests.class);
- suite.addTestSuite(EmptyListIteratorTests.class);
- suite.addTestSuite(EnumerationIteratorTests.class);
- suite.addTestSuite(FilteringIteratorTests.class);
- suite.addTestSuite(GraphIteratorTests.class);
- suite.addTestSuite(IteratorEnumerationTests.class);
- suite.addTestSuite(PeekableIteratorTests.class);
- suite.addTestSuite(ReadOnlyIteratorTests.class);
- suite.addTestSuite(ReadOnlyListIteratorTests.class);
- suite.addTestSuite(SingleElementIteratorTests.class);
- suite.addTestSuite(SingleElementListIteratorTests.class);
- suite.addTestSuite(TransformationIteratorTests.class);
- suite.addTestSuite(TransformationListIteratorTests.class);
- suite.addTestSuite(TreeIteratorTests.class);
-
- return suite;
- }
-
- private JptUtilityIteratorsTests() {
- super();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java
deleted file mode 100644
index 1a3b47b78f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.PeekableIterator;
-
-public class PeekableIteratorTests extends TestCase {
-
- public PeekableIteratorTests(String name) {
- super(name);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildPeekableIterator(); stream.hasNext();) {
- String string = stream.next();
- if (string.equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildPeekableIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildPeekableIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testHasNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildPeekableIteratorUpcast(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(6, i);
- }
-
- public void testNext() {
- Iterator<String> stream = this.buildPeekableIterator();
- assertEquals("zero", stream.next());
- assertEquals("one", stream.next());
- assertEquals("two", stream.next());
- assertEquals("three", stream.next());
- assertEquals("four", stream.next());
- assertEquals("five", stream.next());
- }
-
- public void testNextUpcast() {
- Iterator<Object> stream = this.buildPeekableIteratorUpcast();
- assertEquals("zero", stream.next());
- assertEquals("one", stream.next());
- assertEquals("two", stream.next());
- assertEquals("three", stream.next());
- assertEquals("four", stream.next());
- assertEquals("five", stream.next());
- }
-
- public void testPeek() {
- Object next = null;
- for (PeekableIterator<String> stream = this.buildPeekableIterator(); stream.hasNext();) {
- Object peek = stream.peek();
- assertTrue("peek and next are prematurely identical", peek != next);
- next = stream.next();
- assertTrue("peek and next are not identical", peek == next);
- }
- }
-
- public void testPeekUpcast() {
- Object next = null;
- for (PeekableIterator<Object> stream = this.buildPeekableIteratorUpcast(); stream.hasNext();) {
- Object peek = stream.peek();
- assertTrue("peek and next are prematurely identical", peek != next);
- next = stream.next();
- assertTrue("peek and next are not identical", peek == next);
- }
- }
-
- private PeekableIterator<String> buildPeekableIterator() {
- return this.buildPeekableIterator(this.buildNestedIterator());
- }
-
- private PeekableIterator<Object> buildPeekableIteratorUpcast() {
- return this.buildPeekableIteratorUpcast(this.buildNestedIterator());
- }
-
- private PeekableIterator<String> buildPeekableIterator(Iterator<String> nestedIterator) {
- return new PeekableIterator<String>(nestedIterator);
- }
-
- private PeekableIterator<Object> buildPeekableIteratorUpcast(Iterator<String> nestedIterator) {
- return new PeekableIterator<Object>(nestedIterator);
- }
-
- private Iterator<String> buildNestedIterator() {
- Collection<String> c = new ArrayList<String>();
- c.add("zero");
- c.add("one");
- c.add("two");
- c.add("three");
- c.add("four");
- c.add("five");
- return c.iterator();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java
deleted file mode 100644
index 4defa2e414..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-
-public class ReadOnlyIteratorTests extends TestCase {
-
- public ReadOnlyIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildReadOnlyIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testHasNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildReadOnlyIteratorUpcast(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(this.buildVector().size(), i);
- }
-
- public void testNext() {
- Iterator<String> nestedIterator = this.buildNestedIterator();
- for (Iterator<String> stream = this.buildReadOnlyIterator(); stream.hasNext();) {
- assertEquals("bogus element", nestedIterator.next(), stream.next());
- }
- }
-
- public void testNextUpcast() {
- Iterator<String> nestedIterator = this.buildNestedIterator();
- for (Iterator<Object> stream = this.buildReadOnlyIteratorUpcast(); stream.hasNext();) {
- assertEquals("bogus element", nestedIterator.next(), stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildReadOnlyIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testRemove() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildReadOnlyIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- private Iterator<String> buildReadOnlyIterator() {
- return this.buildReadOnlyIterator(this.buildNestedIterator());
- }
-
- private Iterator<Object> buildReadOnlyIteratorUpcast() {
- return this.buildReadOnlyIteratorUpcast(this.buildNestedIterator());
- }
-
- private Iterator<String> buildReadOnlyIterator(Iterator<String> nestedIterator) {
- return new ReadOnlyIterator<String>(nestedIterator);
- }
-
- private Iterator<Object> buildReadOnlyIteratorUpcast(Iterator<String> nestedIterator) {
- return new ReadOnlyIterator<Object>(nestedIterator);
- }
-
- private Iterator<String> buildNestedIterator() {
- return this.buildVector().iterator();
- }
-
- private Vector<String> buildVector() {
- Vector<String> v = new Vector<String>();
- v.addElement("one");
- v.addElement("two");
- v.addElement("three");
- v.addElement("four");
- v.addElement("five");
- v.addElement("six");
- v.addElement("seven");
- v.addElement("eight");
- return v;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java
deleted file mode 100644
index 4db72f6754..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-
-public class ReadOnlyListIteratorTests extends TestCase {
-
- public ReadOnlyListIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNextAndHasPrevious() {
- int i = 0;
- ListIterator<String> stream = this.buildReadOnlyListIterator();
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(this.buildList().size(), i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testHasNextAndHasPreviousUpcast() {
- int i = 0;
- ListIterator<Object> stream = this.buildReadOnlyListIteratorUpcast();
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(this.buildList().size(), i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testNextAndPrevious() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<String> stream = this.buildReadOnlyListIterator();
- while (stream.hasNext()) {
- assertEquals("bogus element", nestedListIterator.next(), stream.next());
- }
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previous(), stream.previous());
- }
- }
-
- public void testNextAndPreviousUpcast() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<Object> stream = this.buildReadOnlyListIteratorUpcast();
- while (stream.hasNext()) {
- assertEquals("bogus element", nestedListIterator.next(), stream.next());
- }
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previous(), stream.previous());
- }
- }
-
- public void testNextIndexAndPreviousIndex() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<String> stream = this.buildReadOnlyListIterator();
- while (stream.hasNext()) {
- assertEquals("bogus index", nestedListIterator.nextIndex(), stream.nextIndex());
- nestedListIterator.next();
- stream.next();
- }
- assertEquals("bogus index", this.buildList().size(), stream.nextIndex());
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previousIndex(), stream.previousIndex());
- nestedListIterator.previous();
- stream.previous();
- }
- assertEquals("bogus index", -1, stream.previousIndex());
- }
-
- public void testNextIndexAndPreviousIndexUpcast() {
- ListIterator<String> nestedListIterator = this.buildNestedListIterator();
- ListIterator<Object> stream = this.buildReadOnlyListIteratorUpcast();
- while (stream.hasNext()) {
- assertEquals("bogus index", nestedListIterator.nextIndex(), stream.nextIndex());
- nestedListIterator.next();
- stream.next();
- }
- assertEquals("bogus index", this.buildList().size(), stream.nextIndex());
- while (stream.hasPrevious()) {
- assertEquals("bogus element", nestedListIterator.previousIndex(), stream.previousIndex());
- nestedListIterator.previous();
- stream.previous();
- }
- assertEquals("bogus index", -1, stream.previousIndex());
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<String> stream = this.buildReadOnlyListIterator();
- String string = null;
- while (stream.hasNext()) {
- string = stream.next();
- }
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testRemove() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildReadOnlyListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testSet() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildReadOnlyListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.set("bogus");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testAdd() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildReadOnlyListIterator(); stream.hasNext();) {
- if (stream.next().equals("three")) {
- try {
- stream.add("bogus");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- private ListIterator<String> buildReadOnlyListIterator() {
- return this.buildReadOnlyListIterator(this.buildNestedListIterator());
- }
-
- private ListIterator<Object> buildReadOnlyListIteratorUpcast() {
- return this.buildReadOnlyListIteratorUpcast(this.buildNestedListIterator());
- }
-
- private ListIterator<String> buildReadOnlyListIterator(ListIterator<String> nestedListIterator) {
- return new ReadOnlyListIterator<String>(nestedListIterator);
- }
-
- private ListIterator<Object> buildReadOnlyListIteratorUpcast(ListIterator<String> nestedListIterator) {
- return new ReadOnlyListIterator<Object>(nestedListIterator);
- }
-
- private ListIterator<String> buildNestedListIterator() {
- return this.buildList().listIterator();
- }
-
- private List<String> buildList() {
- List<String> l = new ArrayList<String>();
- l.add("one");
- l.add("two");
- l.add("three");
- l.add("four");
- l.add("five");
- l.add("six");
- l.add("seven");
- l.add("eight");
- return l;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java
deleted file mode 100644
index e84657c93d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-
-public class SingleElementIteratorTests extends TestCase {
-
- public SingleElementIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<String> stream = this.buildSingleElementIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(1, i);
- }
-
- public void testNext() {
- for (Iterator<String> stream = this.buildSingleElementIterator(); stream.hasNext();) {
- assertEquals("bogus element", this.singleElement(), stream.next());
- }
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<String> stream = this.buildSingleElementIterator();
- String string = stream.next();
- try {
- string = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + string, exCaught);
- }
-
- public void testRemove() {
- boolean exCaught = false;
- for (Iterator<String> stream = this.buildSingleElementIterator(); stream.hasNext();) {
- if (stream.next().equals(this.singleElement())) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- protected Iterator<String> buildSingleElementIterator() {
- return new SingleElementIterator<String>(this.singleElement());
- }
-
- protected String singleElement() {
- return "single element";
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java
deleted file mode 100644
index e3e4197c7d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-
-public class SingleElementListIteratorTests extends SingleElementIteratorTests {
-
- public SingleElementListIteratorTests(String name) {
- super(name);
- }
-
- public void testNextIndex() {
- ListIterator<String> stream = this.buildSingleElementListIterator();
- while (stream.hasNext()) {
- assertEquals("bogus index", 0, stream.nextIndex());
- stream.next();
- }
- assertEquals("bogus index", 1, stream.nextIndex());
- }
-
- public void testHasPrevious() {
- int i = 0;
- ListIterator<String> stream = this.buildSingleElementListIterator();
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(1, i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i++;
- }
- assertEquals(2, i);
- }
-
- public void testPrevious() {
- ListIterator<String> stream = this.buildSingleElementListIterator();
-
- while (stream.hasNext()) {
- assertEquals("bogus element", this.singleElement(), stream.next());
- }
-
- while (stream.hasPrevious()) {
- assertEquals("bogus element", this.singleElement(), stream.previous());
- }
- }
-
- public void testPreviousIndex() {
- ListIterator<String> stream = this.buildSingleElementListIterator();
-
- while (stream.hasNext()) {
- assertEquals("bogus index", 0, stream.nextIndex());
- stream.next();
- }
-
- while (stream.hasPrevious()) {
- assertEquals("bogus index", 0, stream.previousIndex());
- stream.previous();
- }
-
- assertEquals("bogus index", -1, stream.previousIndex());
- }
-
- public void testAdd() {
- boolean exCaught = false;
- ListIterator<String> stream = this.buildSingleElementListIterator();
-
- try {
- stream.add("foo");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
-
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testSet() {
- boolean exCaught = false;
- for (ListIterator<String> stream = this.buildSingleElementListIterator(); stream.hasNext();) {
- if (stream.next().equals(this.singleElement())) {
- try {
- stream.set("foo");
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- @Override
- protected Iterator<String> buildSingleElementIterator() {
- return new SingleElementListIterator<String>(this.singleElement());
- }
-
- protected ListIterator<String> buildSingleElementListIterator() {
- return (ListIterator<String>) this.buildSingleElementIterator();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java
deleted file mode 100644
index 6ec0d082b1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-public class TransformationIteratorTests extends TestCase {
-
- public TransformationIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNext() {
- int i = 0;
- for (Iterator<Integer> stream = this.buildIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
- }
-
- public void testHasNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildIteratorUpcast(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
- }
-
- public void testInnerHasNext() {
- int i = 0;
- for (Iterator<Integer> stream = this.buildInnerIterator(); stream.hasNext();) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
- }
-
- public void testNext() {
- int i = 0;
- for (Iterator<Integer> stream = this.buildIterator(); stream.hasNext();) {
- assertEquals("bogus transformation", ++i, stream.next().intValue());
- }
- }
-
- public void testNextUpcast() {
- int i = 0;
- for (Iterator<Object> stream = this.buildIteratorUpcast(); stream.hasNext();) {
- assertEquals("bogus transformation", ++i, ((Integer) stream.next()).intValue());
- }
- }
-
- public void testInnerNext() {
- int i = 0;
- for (Iterator<Integer> stream = this.buildInnerIterator(); stream.hasNext();) {
- assertEquals("bogus transformation", ++i, stream.next().intValue());
- }
- }
-
- public void testRemove() {
- Collection<String> c = this.buildCollection();
- for (Iterator<Integer> stream = this.buildInnerTransformationIterator(c.iterator()); stream.hasNext();) {
- if (stream.next().intValue() == 3) {
- stream.remove();
- }
- }
- assertEquals("nothing removed", this.buildCollection().size() - 1, c.size());
- assertFalse("element still in collection", c.contains("333"));
- assertTrue("wrong element removed", c.contains("22"));
- }
-
- public void testInnerRemove() {
- Collection<String> c = this.buildCollection();
- for (Iterator<Integer> stream = this.buildTransformationIterator(c.iterator(), this.buildTransformer()); stream.hasNext();) {
- if (stream.next().intValue() == 3) {
- stream.remove();
- }
- }
- assertEquals("nothing removed", this.buildCollection().size() - 1, c.size());
- assertFalse("element still in collection", c.contains("333"));
- assertTrue("wrong element removed", c.contains("22"));
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- Iterator<Integer> stream = this.buildIterator();
- Integer integer = null;
- while (stream.hasNext()) {
- integer = stream.next();
- }
- try {
- integer = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + integer, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<Integer> stream = this.buildUnmodifiableIterator(); stream.hasNext();) {
- int i = stream.next().intValue();
- if (i == 3) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testIllegalStateException() {
- boolean exCaught = false;
- try {
- this.buildIterator().remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- private Iterator<Integer> buildIterator() {
- return this.buildTransformationIterator(this.buildNestedIterator(), this.buildTransformer());
- }
-
- private Iterator<Object> buildIteratorUpcast() {
- return this.buildTransformationIteratorUpcast(this.buildNestedIterator(), this.buildTransformerUpcast());
- }
-
- private Iterator<Integer> buildInnerIterator() {
- return this.buildInnerTransformationIterator(this.buildNestedIterator());
- }
-
- private Iterator<Integer> buildUnmodifiableIterator() {
- return this.buildTransformationIterator(this.buildUnmodifiableNestedIterator(), this.buildTransformer());
- }
-
- private Iterator<Integer> buildTransformationIterator(Iterator<String> nestedIterator, Transformer<String, Integer> transformer) {
- return new TransformationIterator<String, Integer>(nestedIterator, transformer);
- }
-
- private Iterator<Object> buildTransformationIteratorUpcast(Iterator<String> nestedIterator, Transformer<Object, Integer> transformer) {
- return new TransformationIterator<Object, Object>(nestedIterator, transformer);
- }
-
- private Transformer<String, Integer> buildTransformer() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<String, Integer>() {
- public Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private Transformer<Object, Integer> buildTransformerUpcast() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<Object, Integer>() {
- public Integer transform(Object next) {
- return new Integer(((String) next).length());
- }
- };
- }
-
- private Iterator<Integer> buildInnerTransformationIterator(Iterator<String> nestedIterator) {
- // transform each string into an integer with a value of the string's length
- return new TransformationIterator<String, Integer>(nestedIterator) {
- @Override
- protected Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private Iterator<String> buildNestedIterator() {
- return this.buildCollection().iterator();
- }
-
- private Iterator<String> buildUnmodifiableNestedIterator() {
- return this.buildUnmodifiableCollection().iterator();
- }
-
- private Collection<String> buildCollection() {
- Collection<String> c = new ArrayList<String>();
- c.add("1");
- c.add("22");
- c.add("333");
- c.add("4444");
- c.add("55555");
- c.add("666666");
- c.add("7777777");
- c.add("88888888");
- return c;
- }
-
- private Collection<String> buildUnmodifiableCollection() {
- return Collections.unmodifiableCollection(this.buildCollection());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java
deleted file mode 100644
index fb507d5af4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.TransformationListIterator;
-
-public class TransformationListIteratorTests extends TestCase {
- public TransformationListIteratorTests(String name) {
- super(name);
- }
-
- public void testHasNextAndHasPrevious() {
- int i = 0;
- ListIterator<Integer> stream = this.buildIterator();
-
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testHasNextAndHasPreviousUpcast() {
- int i = 0;
- ListIterator<Object> stream = this.buildIteratorUpcast();
-
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testInnerHasNextAndHasPrevious() {
- int i = 0;
- ListIterator<Integer> stream = this.buildInnerIterator();
-
- while (stream.hasNext()) {
- stream.next();
- i++;
- }
- assertEquals(8, i);
-
- while (stream.hasPrevious()) {
- stream.previous();
- i--;
- }
- assertEquals(0, i);
- }
-
- public void testNextAndPrevious() {
- int i = 0;
- ListIterator<Integer> stream = this.buildIterator();
-
- while (stream.hasNext()) {
- assertEquals(++i, stream.next().intValue());
- }
-
- ++i;
-
- while (stream.hasPrevious()) {
- assertEquals(--i, stream.previous().intValue());
- }
- }
-
- public void testInnerNextAndPrevious() {
- int i = 0;
- ListIterator<Integer> stream = this.buildInnerIterator();
-
- while (stream.hasNext()) {
- assertEquals(++i, stream.next().intValue());
- }
-
- ++i;
-
- while (stream.hasPrevious()) {
- assertEquals(--i, stream.previous().intValue());
- }
- }
-
- public void testNextIndexAndPreviousIndex() {
- int i = -1;
- ListIterator<Integer> stream = this.buildIterator();
-
- while (stream.hasNext()) {
- assertEquals(++i, stream.nextIndex());
- stream.next();
- }
-
- ++i;
-
- while (stream.hasPrevious()) {
- assertEquals(--i, stream.previousIndex());
- stream.previous();
- }
- }
-
- public void testInnerNextIndexAndPreviousIndex() {
- int i = -1;
- ListIterator<Integer> stream = this.buildInnerIterator();
-
- while (stream.hasNext()) {
- assertEquals(++i, stream.nextIndex());
- stream.next();
- }
-
- ++i;
-
- while (stream.hasPrevious()) {
- assertEquals(--i, stream.previousIndex());
- stream.previous();
- }
- }
-
- public void testRemove() {
- List<String> l = this.buildList();
- for (ListIterator<Integer> stream = this.buildInnerTransformationListIterator(l.listIterator()); stream.hasNext();) {
- if (stream.next().intValue() == 3) {
- stream.remove();
- }
- }
- assertEquals("nothing removed", this.buildList().size() - 1, l.size());
- assertFalse("element still in list", l.contains("333"));
- assertTrue("wrong element removed", l.contains("22"));
- }
-
- public void testInnerRemove() {
- List<String> l = this.buildList();
- for (ListIterator<Integer> stream = this.buildTransformationListIterator(l.listIterator(), this.buildTransformer()); stream.hasNext();) {
- if (stream.next().intValue() == 3) {
- stream.remove();
- }
- }
- assertEquals("nothing removed", this.buildList().size() - 1, l.size());
- assertFalse("element still in list", l.contains("333"));
- assertTrue("wrong element removed", l.contains("22"));
- }
-
- public void testUnsupportedOperationExceptionOnAdd() {
- ListIterator<Integer> stream = this.buildIterator();
- boolean exCaught = false;
- try {
- stream.add(new Integer(0));
- fail("exception not thrown");
- } catch (UnsupportedOperationException e) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testUnsupportedOperationExceptionOnSet() {
- ListIterator<Integer> stream = this.buildIterator();
- boolean exCaught = false;
- try {
- stream.set(new Integer(0));
- fail("exception not thrown");
- } catch (UnsupportedOperationException e) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testNoSuchElementException() {
- boolean exCaught = false;
- ListIterator<Integer> stream = this.buildIterator();
- Integer integer = null;
- while (stream.hasNext()) {
- integer = stream.next();
- }
- try {
- integer = stream.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown: " + integer, exCaught);
- }
-
- public void testUnsupportedOperationException() {
- boolean exCaught = false;
- for (Iterator<Integer> stream = this.buildUnmodifiableIterator(); stream.hasNext();) {
- int i = stream.next().intValue();
- if (i == 3) {
- try {
- stream.remove();
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- }
- }
- assertTrue("UnsupportedOperationException not thrown", exCaught);
- }
-
- public void testIllegalStateException() {
- boolean exCaught = false;
- try {
- this.buildIterator().remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue("IllegalStateException not thrown", exCaught);
- }
-
- private ListIterator<Integer> buildIterator() {
- return this.buildTransformationListIterator(this.buildNestedIterator(), this.buildTransformer());
- }
-
- private ListIterator<Object> buildIteratorUpcast() {
- return this.buildTransformationListIteratorUpcast(this.buildNestedIterator(), this.buildTransformerUpcast());
- }
-
- private ListIterator<Integer> buildInnerIterator() {
- return this.buildInnerTransformationListIterator(this.buildNestedIterator());
- }
-
- private ListIterator<Integer> buildUnmodifiableIterator() {
- return this.buildTransformationListIterator(this.buildUnmodifiableNestedIterator(), this.buildTransformer());
- }
-
- private ListIterator<Integer> buildTransformationListIterator(ListIterator<String> nestedIterator, Transformer<String, Integer> transformer) {
- return new TransformationListIterator<String, Integer>(nestedIterator, transformer);
- }
-
- private ListIterator<Object> buildTransformationListIteratorUpcast(ListIterator<String> nestedIterator, Transformer<Object, Integer> transformer) {
- return new TransformationListIterator<Object, Object>(nestedIterator, transformer);
- }
-
- private Transformer<String, Integer> buildTransformer() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<String, Integer>() {
- public Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private Transformer<Object, Integer> buildTransformerUpcast() {
- // transform each string into an integer with a value of the string's length
- return new Transformer<Object, Integer>() {
- public Integer transform(Object next) {
- return new Integer(((String) next).length());
- }
- };
- }
-
- private ListIterator<Integer> buildInnerTransformationListIterator(ListIterator<String> nestedIterator) {
- // transform each string into an integer with a value of the string's length
- return new TransformationListIterator<String, Integer>(nestedIterator) {
- @Override
- protected Integer transform(String next) {
- return new Integer(next.length());
- }
- };
- }
-
- private ListIterator<String> buildNestedIterator() {
- return this.buildList().listIterator();
- }
-
- private ListIterator<String> buildUnmodifiableNestedIterator() {
- return this.buildUnmodifiableList().listIterator();
- }
-
- private List<String> buildList() {
- List<String> l = new ArrayList<String>();
- l.add("1");
- l.add("22");
- l.add("333");
- l.add("4444");
- l.add("55555");
- l.add("666666");
- l.add("7777777");
- l.add("88888888");
- return l;
- }
-
- private List<String> buildUnmodifiableList() {
- return Collections.unmodifiableList(this.buildList());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java
deleted file mode 100644
index 655d0835c0..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.iterators.TreeIterator;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class TreeIteratorTests extends TestCase {
- /** this will be populated with all the nodes created for the test */
- Collection<TreeNode> nodes = new ArrayList<TreeNode>();
-
- public TreeIteratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testHasNext1() {
- this.verifyHasNext(this.buildTreeIterator1());
- }
-
- public void testHasNext2() {
- this.verifyHasNext(this.buildTreeIterator2());
- }
-
- private void verifyHasNext(Iterator<TreeNode> iterator) {
- int i = 0;
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(this.nodes.size(), i);
- }
-
- public void testNext1() {
- this.verifyNext(this.buildTreeIterator1());
- }
-
- public void testNext2() {
- this.verifyNext(this.buildTreeIterator2());
- }
-
- private void verifyNext(Iterator<TreeNode> iterator) {
- while (iterator.hasNext()) {
- assertTrue("bogus element", this.nodes.contains(iterator.next()));
- }
- }
-
- public void testNoSuchElementException1() {
- this.verifyNoSuchElementException(this.buildTreeIterator1());
- }
-
- public void testNoSuchElementException2() {
- this.verifyNoSuchElementException(this.buildTreeIterator2());
- }
-
- private void verifyNoSuchElementException(Iterator<TreeNode> iterator) {
- boolean exCaught = false;
- while (iterator.hasNext()) {
- iterator.next();
- }
- try {
- iterator.next();
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
- public void testRemove1() {
- this.verifyRemove(this.buildTreeIterator1());
- }
-
- public void testRemove2() {
- this.verifyRemove(this.buildTreeIterator2());
- }
-
- private void verifyRemove(Iterator<TreeNode> iterator) {
- String parentName = "child 2";
- String childName = "grandchild 2A";
- int startSize = this.childrenSize(parentName);
- while (iterator.hasNext()) {
- TreeNode node = iterator.next();
- if (node.getName().equals(childName)) {
- iterator.remove();
- }
- }
- int endSize = this.childrenSize(parentName);
- assertEquals(startSize - 1, endSize);
- }
-
- private int childrenSize(String nodeName) {
- for (Iterator<TreeNode> stream = this.nodes.iterator(); stream.hasNext();) {
- TreeNode node = stream.next();
- if (node.getName().equals(nodeName)) {
- return node.childrenSize();
- }
- }
- throw new IllegalArgumentException(nodeName);
- }
-
- /**
- * build a tree iterator with an explicit midwife
- */
- private Iterator<TreeNode> buildTreeIterator1() {
- return new TreeIterator<TreeNode>(this.buildTree(), this.buildMidwife());
- }
-
- private TreeIterator.Midwife<TreeNode> buildMidwife() {
- return new TreeIterator.Midwife<TreeNode>() {
- public Iterator<TreeNode> children(TreeNode next) {
- return next.children();
- }
- };
- }
-
- /**
- * build a tree iterator with an override
- */
- private Iterator<TreeNode> buildTreeIterator2() {
- return new TreeIterator<TreeNode>(this.buildTree()) {
- @Override
- public Iterator<TreeNode> children(TreeNode next) {
- return next.children();
- }
- };
- }
-
- private TreeNode buildTree() {
- TreeNode root = new TreeNode("root");
- TreeNode child1 = new TreeNode(root, "child 1");
- new TreeNode(child1, "grandchild 1A");
- TreeNode child2 = new TreeNode(root, "child 2");
- new TreeNode(child2, "grandchild 2A");
- TreeNode grandchild2B = new TreeNode(child2, "grandchild 2B");
- new TreeNode(grandchild2B, "great-grandchild 2B1");
- new TreeNode(grandchild2B, "great-grandchild 2B2");
- TreeNode grandchild2C = new TreeNode(child2, "grandchild 2C");
- new TreeNode(grandchild2C, "great-grandchild 2C1");
- new TreeNode(root, "child 3");
- return root;
- }
-
- private class TreeNode {
- private String name;
- private Collection<TreeNode> children = new ArrayList<TreeNode>();
-
- public TreeNode(String name) {
- super();
- TreeIteratorTests.this.nodes.add(this); // log node
- this.name = name;
- }
-
- public TreeNode(TreeNode parent, String name) {
- this(name);
- parent.addChild(this);
- }
-
- public String getName() {
- return this.name;
- }
-
- private void addChild(TreeNode child) {
- this.children.add(child);
- }
-
- public Iterator<TreeNode> children() {
- return this.children.iterator();
- }
-
- public int childrenSize() {
- return this.children.size();
- }
-
- @Override
- public String toString() {
- return "TreeNode(" + this.name + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/test.xml b/jpa/tests/org.eclipse.jpt.utility.tests/test.xml
deleted file mode 100644
index 8598dc69f7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/test.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name, and library-file -->
- <property name="plugin-name" value="org.eclipse.jpt.utility.tests"/>
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jpt.utility.tests.internal.JptUtilityTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-</project> \ No newline at end of file

Back to the top